---
title: GatherND
description: "对于秩r≥1的输入Tensor data，和秩q≥1的输入Tensor indices，将数据切片收集到秩为 (q-1) + (r - indices_shape[-1]) 的输出Tensor output中。indices是一个q维的整型Tensor，可视作一个q-1维的由索引对构成的特殊张量（每个索引对是一个长度为indices_shape[-1]的一维张量，每个索引对指向data中一个切片）。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/aolapi/atlasoxol_09_0064.html
sourcePath: /source/zh/canncommercial/900/API/aolapi/atlasoxol_09_0064.html
indexId: bb9a3e0134bfe85cc434f4a0b215f6cfa21b2b1eb39b1abb79be5d3dc32a009663
---
# GatherND

#### 功能

对于秩r≥1的输入Tensor data，和秩q≥1的输入Tensor indices，将数据切片收集到秩为 (q-1) + (r - indices_shape[-1]) 的输出Tensor output中。indices是一个q维的整型Tensor，可视作一个q-1维的由索引对构成的特殊张量（每个索引对是一个长度为indices_shape[-1]的一维张量，每个索引对指向data中一个切片）。


#### 输入

- data：输入Tensor，秩r>=1，数据类型：int8、uint8、float16、float、double、int32、int64。
- indices：输入Tensor，秩q>=1，数据类型：int64。


#### 属性

batch_dims：数据类型支持int，批处理轴的数量，当前仅支持配置为0。


#### 输出

output：输出Tensor，秩为(q-1) + (r - indices_shape[-1])，即output的shape为[indices_shape[0:q-1], self_shape[indices_shape[-1]:r]] 。


#### 约束

不支持atc工具参数--precision_mode=must_keep_origin_dtype时double的输入。


#### 支持的ONNX版本

Opset v11/v12/v13/v14/v15/v16/v17/v18
