You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

mindspore.ops.GatherNd.rst 906 B

123456789101112131415161718192021222324252627
  1. mindspore.ops.GatherNd
  2. =======================
  3. .. py:class:: mindspore.ops.GatherNd
  4. 根据索引获取输入Tensor指定位置上的元素。
  5. 若 `indices` 是K维整型Tensor,则可看作是从 `input_x` 中取K-1维Tensor,每个元素都是一个切片:
  6. .. math::
  7. output[(i_0, ..., i_{K-2})] = input\_x[indices[(i_0, ..., i_{K-2})]]
  8. `indices` 的最后一维的长度不能超过 `input_x` 的秩: :math:`indices.shape[-1] <= input\_x.rank` 。
  9. **输入:**
  10. - **input_x** (Tensor) - GatherNd的输入。任意维度的Tensor。
  11. - **indices** (Tensor) - 索引Tensor,其数据类型为int32或int64。
  12. **输出:**
  13. Tensor,数据类型与 `input_x` 相同,shape为 `indices_shape[:-1] + x_shape[indices_shape[-1]:]` 。
  14. **异常:**
  15. - **ValueError** - `input_x` 的shape长度小于 `indices` 的最后一维的长度。