You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/06/07 22:07:56 UTC

[GitHub] [tvm] sfvaroglu commented on a diff in pull request #11606: [ONNX] Add ReduceSum opset13 support (non-dynamic)

sfvaroglu commented on code in PR #11606:
URL: https://github.com/apache/tvm/pull/11606#discussion_r891749259


##########
python/tvm/relay/frontend/onnx.py:
##########
@@ -2270,6 +2270,27 @@ def _impl_v12(cls, inputs, attr, params):
 
         return cls._impl_v1(inputs, attr, params)
 
+    @classmethod
+    def _impl_v13(cls, inputs, attr, params):
+        data = inputs[0]
+        axes = inputs[1]
+
+        if not infer_shape(data):  # promote scalar to 1-D tensor
+            data = _op.expand_dims(data, axis=0)
+
+        noop_with_empty_axes = attr.get("noop_with_empty_axes", 0)
+        num_axis = int(infer_type(axes).checked_type.shape[0]) if axes is not None else 0
+
+        if noop_with_empty_axes and num_axis == 0:
+            return inputs[0]
+
+        if num_axis > 0:

Review Comment:
   Oh, thanks!



-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org