File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
extension/training/module Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -162,23 +162,24 @@ TrainingModule::named_attributes(const std::string& method_name) {
162
162
method_named_attributes_.insert ({method_name, {}});
163
163
164
164
// get method metadata
165
- auto meta_res = executorch::extension::Module:: method_meta (method_name);
165
+ auto meta_res = method_meta (method_name);
166
166
if (!meta_res.ok ()) {
167
167
return meta_res.error ();
168
168
}
169
169
// get method
170
- auto method_res = executorch::extension::Module::method (method_name);
171
- if (!method_res. ok () ) {
172
- return method_res. error () ;
170
+ auto e = load_method (method_name);
171
+ if (e != runtime::Error::Ok ) {
172
+ return e ;
173
173
}
174
+ auto & method = methods_.at (method_name).method ;
174
175
// get tensor by name
175
176
for (int idx = 0 ; idx < meta_res->num_attributes (); idx++) {
176
177
const auto tensor_res = meta_res->attribute_tensor_meta (idx);
177
178
if (!tensor_res.ok ()) {
178
179
return tensor_res.error ();
179
180
}
180
181
const auto tensorName = tensor_res.get ().name ();
181
- const auto attribute_res = (*method_res) ->get_attribute (tensorName);
182
+ const auto attribute_res = method ->get_attribute (tensorName);
182
183
if (!attribute_res.ok ()) {
183
184
return attribute_res.error ();
184
185
}
You can’t perform that action at this time.
0 commit comments