<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/BNNSGraph/Builder/Tensor/gatherND(indices:batchDimensionCount:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "s:10Accelerate9BNNSGraphO7BuilderV6TensorV8gatherND7indices19batchDimensionCountAGy__xGqd___SitAE18OperationParameterRd__s5Int32V7ElementRtd__lF"
  },
  "title" : "gatherND(indices:batchDimensionCount:)"
}
-->

# gatherND(indices:batchDimensionCount:)

Adds a gather-nd operation to the current graph.

```
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

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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)