<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.13.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MetalPerformanceShaders",
  "identifier" : "/documentation/MetalPerformanceShaders/MPSCNNConvolutionDescriptor/groups",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Metal Performance Shaders"
    ],
    "preciseIdentifier" : "c:objc(cs)MPSCNNConvolutionDescriptor(py)groups"
  },
  "title" : "groups"
}
-->

# groups

The number of groups that the input and output channels are divided into.

```
var groups: Int { get set }
```

## Discussion

The default value is `1`.

Groups let you reduce parametrization. If the value of this property is set to `n`, the input is divided into `n` groups with `inputFeatureChannels``/n` channels in each group. Similarly, the output is divided into `n` groups with `outputFeatureChannels/n` channels in each group.  The `ith` group in the input is only connected to the `ith` group in the output, so the number of weights (parameters) needed is reduced by a factor of `n`. Both the value of the [`inputFeatureChannels`](/documentation/MetalPerformanceShaders/MPSCNNConvolutionDescriptor/inputFeatureChannels) and [`outputFeatureChannels`](/documentation/MetalPerformanceShaders/MPSCNNConvolutionDescriptor/outputFeatureChannels) properties must be divisible by `n` and the number of channels in each group must be a multiple of `4`.

---

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)