mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-22 22:01:08 +00:00
Move a function call outside a loop in ORTModule (#13771)
### Description The proposed change is useful for ORTModule when the output graph has multiple outputs. ### Motivation and Context performance Signed-off-by: xadupre <xadupre@microsoft.com>
This commit is contained in:
parent
08ed09d20b
commit
441b30b2d2
1 changed files with 2 additions and 1 deletions
|
|
@ -196,8 +196,9 @@ def _create_iobinding(io_binding, inputs, model, device):
|
|||
for idx, value_info in enumerate(model.graph.input):
|
||||
io_binding.bind_ortvalue_input(value_info.name, OrtValue(_ortvalue_from_torch_tensor(inputs[idx])))
|
||||
|
||||
device_id = get_device_index(device)
|
||||
for value_info in model.graph.output:
|
||||
io_binding.bind_output(value_info.name, device.type, device_id=get_device_index(device))
|
||||
io_binding.bind_output(value_info.name, device.type, device_id=device_id)
|
||||
|
||||
|
||||
def check_for_name_collisions_and_bind_methods_to_ortmodule(ortmodule: torch.nn.Module, user_module: torch.nn.Module):
|
||||
|
|
|
|||
Loading…
Reference in a new issue