Skip to content

Fix dynamic axes for ONNX models #1187

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

Merged
merged 3 commits into from
Jun 30, 2020
Merged
Changes from all commits
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: 1 addition & 2 deletions pkg/workloads/cortex/lib/client/onnx.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ def transform_to_numpy(input_pyobj, input_metadata, model_name):

try:
for idx, dim in enumerate(target_shape):
# dynamic_axes implies that a given dimension can have any size
if type(dim) is str and "dynamic_axes" in dim:
if type(dim) is str:
target_shape[idx] = -1
elif type(dim) is not int:
target_shape[idx] = 1
Expand Down