Skip to content

Commit

Permalink
fix attribute name from inputs_names to input_names (#2010)
Browse files Browse the repository at this point in the history
fix attribute name `inputs_names`

fix attribute name of ORTmodel from `inputs_names` to `input_names`
  • Loading branch information
J4BEZ authored Sep 5, 2024
1 parent 8cb6832 commit 1de4e25
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions optimum/onnxruntime/io_binding/io_binding_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@ def prepare_io_binding(ort_model: "ORTModel", **inputs) -> ort.IOBinding:
Returns an IOBinding object for an inference session. This method is for general purpose, if the inputs and outputs
are determined, you can prepare data buffers directly to avoid tensor transfers across frameworks.
"""
if not all(input_name in inputs.keys() for input_name in ort_model.inputs_names):
if not all(input_name in inputs.keys() for input_name in ort_model.input_names):
raise ValueError(
f"The ONNX model takes {ort_model.inputs_names.keys()} as inputs, but only {inputs.keys()} are given."
f"The ONNX model takes {ort_model.input_names.keys()} as inputs, but only {inputs.keys()} are given."
)

name_to_np_type = TypeHelper.get_io_numpy_type_map(ort_model.model)
Expand All @@ -168,7 +168,7 @@ def prepare_io_binding(ort_model: "ORTModel", **inputs) -> ort.IOBinding:
io_binding = ort_model.model.io_binding()

# Bind inputs
for input_name in ort_model.inputs_names:
for input_name in ort_model.input_names:
onnx_input = inputs.pop(input_name)
onnx_input = onnx_input.contiguous()

Expand Down

0 comments on commit 1de4e25

Please sign in to comment.