Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Fix CLI benchmark errors #1071

Merged
merged 4 commits into from
Jun 15, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/deepsparse/utils/onnx.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ def override_onnx_batch_size(
return save_onnx_to_temp_files(model, with_external_data=not inplace)


@contextlib.contextmanager
def override_onnx_input_shapes(
onnx_filepath: str,
input_shapes: Union[List[int], List[List[int]]],
Expand Down Expand Up @@ -303,7 +304,7 @@ def override_onnx_input_shapes(
"Overwriting in-place the input shapes of the model " f"at {onnx_filepath}"
dbogunowicz marked this conversation as resolved.
Show resolved Hide resolved
dbogunowicz marked this conversation as resolved.
Show resolved Hide resolved
)
onnx.save(model, onnx_filepath)
return onnx_filepath
yield onnx_filepath
dbogunowicz marked this conversation as resolved.
Show resolved Hide resolved
else:
_LOGGER.info(
f"Saving the input shapes of the model at {onnx_filepath} "
Expand Down
Loading