mindspore.ops.GatherNd
- class mindspore.ops.GatherNd[source]
Gathers slices from a tensor by indices.
Refer to
mindspore.ops.gather_nd()
for more detail.- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> op = ops.GatherNd() >>> input_x = Tensor(np.array([[-0.1, 0.3, 3.6], [0.4, 0.5, -3.2]]), mindspore.float32) >>> indices = Tensor(np.array([[0, 0], [1, 1]]), mindspore.int32) >>> output = op(input_x, indices) >>> print(output) [-0.1 0.5]