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



##########
File path: python/tvm/relay/op/algorithm.py
##########
@@ -115,3 +115,36 @@ def topk(data, k=1, axis=-1, ret_type="both", 
is_ascend=False, dtype="int32"):
     if ret_type == "both":
         return TupleWrapper(out, 2)
     return out
+
+
+def searchsorted(sorted_sequence, values, side="left", dtype="int32"):
+    """Find indices where elements should be inserted to maintain order.
+       If `sorted_sequence` is N-dimensional, the innermost dimension of
+       `values` are searched in the corresponding dimension of 
`sorted_sequence`.
+
+    Parameters
+    ----------
+    sorted_sequence : relay.Expr
+        N-D or 1-D Tensor, containing monotonically increasing sequence
+        on the innermost dimension.
+
+    values : relay.Expr
+        N-D Tensor containing the search values. When `sorted_sequence` is 1-D,
+        the shape of `values` can be arbitrary. Otherwise, ranks of 
`sorted_sequence`
+        and `values` must be the same, and outer N-1 axes must have the same 
size.
+
+    side : string, optional
+        It can be `left` or `right`. If `left`, gets the lower bound index for 
each value
+        in `values` on the corresponding innermost dimension of the 
`sorted_sequence`.
+        If `right`, gets the upper bound index instead.
+
+    dtype : string, optional
+        The data type of the output indices.
+
+    Returns
+    -------
+    indices : relay.Expr
+        Tensor with same shape as values, representing the indices of
+        elements of `values` if they are inserted in `sorted_sequence`.
+    """

Review comment:
       made it a boolean, no need to check




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to