ganler commented on issue #10738:
URL: https://github.com/apache/tvm/issues/10738#issuecomment-1076767344


   One quick way to fix it is to check rank of tensor being reduced during 
conversion:
   
   ```python
   class Reduce(OnnxOpConverter):
   # ...
       @classmethod
       def _impl_v1(cls, inputs, attr, params):
   +        if not infer_shape(inputs[0]):
   +            return inputs[0]
   +
           if "axes" in attr:
               axis = attr.get("axes", 0)
           else:
               axis_len = len(infer_shape(inputs[0]))
               axis = list(range(axis_len))
   
           return cls.run_calculation(inputs, axis, attr.get("keepdims", True))
   ```
   
   But I think it won't be compatible with other reduce operators like 
`ReduceL2` etc.


-- 
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]


Reply via email to