---
title: "init(function:input:output:weights:filterParameters:)"
framework: accelerate
role: symbol
role_heading: Initializer
path: "accelerate/bnns/reductionlayer/init(function:input:output:weights:filterparameters:)"
---

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

Returns a new reduction layer.

## Declaration

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

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 BNNSReduceFunctionLogicalOr and BNNSReduceFunctionLogicalAnd that support float and BNNSDataTypeBoolean.
