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



##########
File path: python/tvm/relay/frontend/tensorflow.py
##########
@@ -2324,6 +2324,39 @@ def _impl(inputs, attr, params, mod):
     return _impl
 
 
+def _unique(return_counts=True):
+    def _impl(inputs, attr, params, mod):
+        assert len(inputs) == 1
+        data = inputs[0]
+        if return_counts:
+            [unique, indices, num_uniq, counts] = _op.unique(
+                data, is_sorted=False, return_counts=True
+            )
+            unique_sliced = _op.strided_slice(unique, begin=[0], end=num_uniq, 
slice_mode="size")
+            counts_sliced = _op.strided_slice(counts, begin=[0], end=num_uniq, 
slice_mode="size")
+            return _expr.TupleWrapper(
+                _expr.Tuple([unique_sliced, indices, counts_sliced]),
+                3,
+            )
+        else:
+            [unique, indices, num_uniq] = _op.unique(data, is_sorted=False, 
return_counts=False)
+            unique_sliced = _op.strided_slice(unique, begin=[0], end=num_uniq, 
slice_mode="size")
+            return _expr.TupleWrapper(
+                _expr.Tuple([unique_sliced, indices]),
+                2,
+            )
+
+    return _impl
+
+
+def _unique_with_counts():
+    def _impl(inputs, attr, params, mod):

Review comment:
       Remove this




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


Reply via email to