<!--
{
  "availability" : [
    "*: -",
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: -",
    "macOS: 11.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: -",
    "watchOS: 7.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/BNNS/ReductionLayer/init(function:input:output:weights:filterParameters:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "s:10Accelerate4BNNSO14ReductionLayerC8function5input6output7weights16filterParametersAESgAC0C8FunctionO_So21BNNSNDArrayDescriptoraA2OSgSo010BNNSFilterJ0aSgtcfc"
  },
  "title" : "init(function:input:output:weights:filterParameters:)"
}
-->

# init(function:input:output:weights:filterParameters:)

Returns a new reduction layer.

```
convenience init?(function reductionFunction: BNNS.ReductionFunction, input: BNNSNDArrayDescriptor, output: BNNSNDArrayDescriptor, weights: BNNSNDArrayDescriptor?, filterParameters: BNNSFilterParameters? = nil)
```

## 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.

## Discussion

> Important:
> The number of input dimensions must be equal to number of output dimensions, and equal to the number of weights dimensions. The reduction layer only supports `float`, with the exception of ``doc://com.apple.accelerate/documentation/Accelerate/BNNSReduceFunctionLogicalOr`` and ``doc://com.apple.accelerate/documentation/Accelerate/BNNSReduceFunctionLogicalAnd`` that support `float` and `BNNSDataTypeBoolean`.

---

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)