codeislife99 commented on a change in pull request #7562:
URL: https://github.com/apache/tvm/pull/7562#discussion_r585911611
##########
File path: python/tvm/relay/op/transform.py
##########
@@ -1450,6 +1450,61 @@ def sparse_reshape(sparse_indices, prev_shape,
new_shape):
return TupleWrapper(_make.sparse_reshape(sparse_indices, prev_shape,
new_shape), 2)
+def segment_sum(data, indices, num_segments=None):
+ """
+ Computes the sum along segments of a tensor. This op is much better
understood with
+ visualization articulated in the following links and examples at the end
of this docstring.
+
+
https://www.tensorflow.org/api_docs/python/tf/raw_ops/UnsortedSegmentSum?hl=fr
+
https://caffe2.ai/docs/sparse-operations.html#null__unsorted-segment-reduction-ops
+
+ Parameters
+ ----------
+ data : relay.Expr
Review comment:
No, . The reduction is only over the zeroth dimension. I clarified it in
the documentation one.
##########
File path: python/tvm/relay/op/transform.py
##########
@@ -1450,6 +1450,61 @@ def sparse_reshape(sparse_indices, prev_shape,
new_shape):
return TupleWrapper(_make.sparse_reshape(sparse_indices, prev_shape,
new_shape), 2)
+def segment_sum(data, indices, num_segments=None):
+ """
+ Computes the sum along segments of a tensor. This op is much better
understood with
+ visualization articulated in the following links and examples at the end
of this docstring.
+
+
https://www.tensorflow.org/api_docs/python/tf/raw_ops/UnsortedSegmentSum?hl=fr
Review comment:
Oops, fixed it 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.
For queries about this service, please contact Infrastructure at:
[email protected]