Skip to content

Commit

Permalink
fix default axis behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Zhao Luo committed Sep 23, 2021
1 parent 8ef89ea commit a718b2a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/tvm/relay/frontend/onnx.py
Original file line number Diff line number Diff line change
Expand Up @@ -1461,7 +1461,8 @@ def run_calculation(cls, tensor, axes):

@classmethod
def _impl_v1(cls, inputs, attr, params):
axes = sorted(attr["axes"])
shape = infer_shape(inputs[0])
axes = sorted(attr.get("axes", [i for i, size in enumerate(shape) if size == 1]))
return cls.run_calculation(inputs[0], axes)

@classmethod
Expand Down

0 comments on commit a718b2a

Please sign in to comment.