---
title: "applyReduction(_:input:output:weights:filterParameters:)"
framework: accelerate
role: symbol
role_heading: Type Method
path: "accelerate/bnns/applyreduction(_:input:output:weights:filterparameters:)"
---

# applyReduction(_:input:output:weights:filterParameters:)

Applies the specified reduction function.

## Declaration

```swift
static func applyReduction(_ reductionFunction: BNNS.ReductionFunction, input: BNNSNDArrayDescriptor, output: BNNSNDArrayDescriptor, weights: BNNSNDArrayDescriptor?, filterParameters: BNNSFilterParameters? = nil) throws
```

## Parameters

- `reductionFunction`: The variable that specifies the reduction function.
- `input`: The descriptor of the input.
- `output`: The descriptor of the output.
- `weights`: The descriptor of the weights.
- `filterParameters`: The filter runtime parameters.

## See Also

### Reduction layers

- [BNNS.ReductionLayer](accelerate/bnns/reductionlayer.md)
- [BNNSReduceFunction](accelerate/bnnsreducefunction.md)
- [BNNSLayerParametersReduction](accelerate/bnnslayerparametersreduction.md)
- [BNNSFilterCreateLayerReduction(_:_:)](accelerate/bnnsfiltercreatelayerreduction(_:_:).md)
- [BNNSDirectApplyReduction(_:_:)](accelerate/bnnsdirectapplyreduction(_:_:).md)
