<!--
{
  "availability" : [
    "*: -",
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/BNNS/gather(input:indices:output:axis:filterParameters:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "s:10Accelerate4BNNSO6gather5input7indices6output4axis16filterParametersySo21BNNSNDArrayDescriptora_A2KSiSo010BNNSFilterI0aSgtKFZ"
  },
  "title" : "gather(input:indices:output:axis:filterParameters:)"
}
-->

# gather(input:indices:output:axis:filterParameters:)

Gathers the elements of a tensor along a single axis.

```
static func gather(input: BNNSNDArrayDescriptor, indices: BNNSNDArrayDescriptor, output: BNNSNDArrayDescriptor, axis: Int, filterParameters: BNNSFilterParameters? = nil) throws
```

## Parameters

`input`

The input descriptor.

`indices`

The indices descriptor.

`output`

The output descriptor.

`axis`

The axis along which the operation gathers the indices.

`filterParameters`

The filter runtime parameters.

## See Also

[`func BNNSGather(Int, UnsafePointer<BNNSNDArrayDescriptor>, UnsafePointer<BNNSNDArrayDescriptor>, UnsafeMutablePointer<BNNSNDArrayDescriptor>, UnsafePointer<BNNSFilterParameters>?) -> Int32`](/documentation/Accelerate/BNNSGather(_:_:_:_:_:))

Gathers the elements of a tensor along a single axis.



---

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)