Skip to content

Commit d2e54b6

Browse files
authored
Simplify setting inputs in Module execute.
Differential Revision: D61499723 Pull Request resolved: #4782
1 parent 49156d0 commit d2e54b6

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

extension/module/module.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,8 @@ Result<std::vector<EValue>> Module::execute(
185185
ET_CHECK_OK_OR_RETURN_ERROR(load_method(method_name));
186186
auto& method = methods_.at(method_name).method;
187187

188-
for (auto index = 0; index < input.size(); ++index) {
189-
ET_CHECK_OK_OR_RETURN_ERROR(method->set_input(input[index], index));
190-
}
188+
ET_CHECK_OK_OR_RETURN_ERROR(method->set_inputs(
189+
exec_aten::ArrayRef<EValue>(input.data(), input.size())));
191190
ET_CHECK_OK_OR_RETURN_ERROR(method->execute());
192191

193192
const auto outputs_size = method->outputs_size();

0 commit comments

Comments
 (0)