---
title: "init(dimension:reductionType:)"
framework: ML Compute
role: symbol
role_heading: Initializer
platforms: [iOS 14.5+, iPadOS 14.5+, Mac Catalyst 14.5+, macOS 11.3+, tvOS 14.5+]
path: "mlcompute/mlcscatterlayer/init(dimension:reductiontype:)"
---

# init(dimension:reductionType:)

Creates a scatter layer with the dimension and reduction type you specify.

## Declaration

```swift
convenience init?(dimension: Int, reductionType: MLCReductionType)
```

## Parameters

- `dimension`: The dimension to index.
- `reductionType`: The reduction type that applies to all values in a source tensor.

## Discussion

Discussion important: The reduction type can be either MLCReductionType.none or MLCReductionType.sum.
