---
title: "gatherND(indices:batchDimensionCount:)"
framework: accelerate
role: symbol
role_heading: Instance Method
path: "accelerate/bnnsgraph/builder/tensor/gathernd(indices:batchdimensioncount:)"
---

# gatherND(indices:batchDimensionCount:)

Adds a gather-nd operation to the current graph.

## Declaration

```swift
func gatherND(indices: some BNNSGraph.Builder.OperationParameter<Int32>, batchDimensionCount: Int) -> BNNSGraph.Builder.Tensor<T>
```

## Parameters

- `indices`: The indices that the operation gathers.
- `batchDimensionCount`: The number of additional leading dimensions.

## Discussion

Discussion Register a gather-nd op, which indexes self at the coordinates provided in indices. In particular, output y such that y[i...] = self[indices[i..., :]]. indices can be viewed as a rank(indices)-1-rank tensor of coordinates into self. batchDimensionCount specifies the number of additional leading dimensions present in both selfx and indices which should be only used for a batch processing loop.
