mindspore.ops.intopk
- mindspore.ops.intopk(x1, x2, k)[source]
mindspore.ops.intopk is deprecated from version 2.9.0 and will be removed in a future version.
Return whether the elements in second input tensor exist among the top k elements of the first input tensor.
- Parameters:
- Returns:
A 1-D tensor whose data type is bool, has the same shape as x2.
- Supported Platforms:
Deprecated
Examples
>>> import mindspore >>> x1 = mindspore.tensor([[1, 8, 5, 2, 7], [4, 9, 1, 3, 5]], mindspore.float32) >>> x2 = mindspore.tensor([1, 3], mindspore.int32) >>> mindspore.ops.intopk(x1, x2, 3) Tensor(shape=[2], dtype=Bool, value= [ True, False])