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 2021/02/08 16:26:12 UTC

[GitHub] [tvm] mbrookhart commented on a change in pull request #7391: [ONNX] Add CumSum operator to ONNX frontend

mbrookhart commented on a change in pull request #7391:
URL: https://github.com/apache/tvm/pull/7391#discussion_r572180871



##########
File path: python/tvm/relay/op/transform.py
##########
@@ -1368,4 +1377,8 @@ def cumsum(data, axis=None, dtype=None):
         cumsum(a, dtype=int32)  # dtype should be provided to get the expected results
         -> [1, 1, 2, 2, 3, 4, 4]
     """
-    return _make.cumsum(data, axis, dtype)
+    if rev is not None and rev != 0:
+        out = _make.reverse(data, axis)
+        out = _make.cumsum(out, axis, dtype, exclusive)
+        return _make.reverse(out, axis)
+    return _make.cumsum(data, axis, dtype, exclusive)

Review comment:
       Hmm, you do reverse here, but exclusive in the topi kernel.

##########
File path: python/tvm/topi/cumsum.py
##########
@@ -75,6 +84,12 @@ def maybe_cast(x):
             elif i > axis:
                 axis_mul_after *= value
 
+    if exclusive is None:
+        exclusive = 0
+
+    if reverse is None:
+        reverse = 0
+

Review comment:
       You're not using reverse in the topi?




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

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