<!--
{
  "availability" : [
    "iOS: 14.5.0 - 17.4.0",
    "iPadOS: 14.5.0 - 17.4.0",
    "macCatalyst: 14.5.0 - 17.4.0",
    "macOS: 11.3.0 - 14.3.0",
    "tvOS: 14.5.0 - 17.4.0"
  ],
  "documentType" : "symbol",
  "framework" : "MLCompute",
  "identifier" : "/documentation/MLCompute/MLCScatterLayer/init(dimension:reductionType:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "ML Compute"
    ],
    "preciseIdentifier" : "c:objc(cs)MLCScatterLayer(cm)layerWithDimension:reductionType:"
  },
  "title" : "init(dimension:reductionType:)"
}
-->

# init(dimension:reductionType:)

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

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

> Important:
> The reduction type can be either ``doc://com.apple.mlcompute/documentation/MLCompute/MLCReductionType/none`` or ``doc://com.apple.mlcompute/documentation/MLCompute/MLCReductionType/sum``.

---

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)