AndrewZhaoLuo commented on a change in pull request #10047:
URL: https://github.com/apache/tvm/pull/10047#discussion_r791254790
##########
File path: python/tvm/relay/frontend/onnx.py
##########
@@ -3804,10 +3804,13 @@ def _impl_v10(cls, inputs, attr, params):
#
# This function attempts to present 'x' in a form that meets both of
those
# requirements.
- def try_resolve_to_const_scalar(x, dtype_override=None):
+ def try_resolve_to_const(x, dtype_override=None):
x2 = try_resolve_var_to_const(x, params)
- x3 = ensure_scalar_shape(x2)
-
+ num_elem = np.prod(infer_shape(x))
+ if num_elem == 1:
Review comment:
nit: This can be
```
if num_elem == 1:
x2 = ensure_scalar_shape(x2)
```
And we dont need x3 now
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]