<!--
{
  "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/gatherAlongAxis(indices:axis:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "s:10Accelerate9BNNSGraphO7BuilderV6TensorV15gatherAlongAxis7indices4axisAGy__xGqd___SitAE18OperationParameterRd__s5Int32V7ElementRtd__lF"
  },
  "title" : "gatherAlongAxis(indices:axis:)"
}
-->

# gatherAlongAxis(indices:axis:)

Adds a gather-along-axis operation to the current graph.

```
func gatherAlongAxis(indices: some BNNSGraph.Builder.OperationParameter<Int32>, axis: Int) -> BNNSGraph.Builder.Tensor<T>
```

## Parameters

`indices`

The indices that the operation gathers.

`axis`

The axis over which the operation gathers.

## Discussion

Register a gather along axis op, which shuffles the input along one axis. In particular, output
`y` such that `y[L…, i, T…] = x[L…, indices[L…, i, T…], T…].

---

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)