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/09/14 01:54:36 UTC

[GitHub] [tvm] masahi commented on a change in pull request #8971: [Relay][Topi][Op][Onnx] Support negative indices in gather, gathernd. Fixes NLL Loss tests

masahi commented on a change in pull request #8971:
URL: https://github.com/apache/tvm/pull/8971#discussion_r707846211



##########
File path: include/tvm/topi/transform.h
##########
@@ -1242,6 +1244,8 @@ inline Tensor gather(const Tensor& data, int axis, const Tensor& indices,
     out_shape.push_back(indices->shape[i]);
   }
 
+  PrimExpr axis_size = data->shape[axis];

Review comment:
       remove it

##########
File path: include/tvm/topi/transform.h
##########
@@ -1252,12 +1256,13 @@ inline Tensor gather(const Tensor& data, int axis, const Tensor& indices,
         Array<PrimExpr> real_indices;
         for (size_t i = 0; i < ndim_i; ++i) {
           if (i == static_cast<size_t>(axis)) {
-            real_indices.push_back(indices(indices_position));
+            PrimExpr index = indices(indices_position);
+            real_indices.push_back(index);

Review comment:
       remove this diff




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