<!--
{
  "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/MPSCNNConvolution",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Metal Performance Shaders"
    ],
    "preciseIdentifier" : "c:objc(cs)MPSCNNConvolution"
  },
  "title" : "MPSCNNConvolution"
}
-->

# MPSCNNConvolution

A convolution kernel that convolves the input image with a set of filters, with each producing one feature map in the output image.

```
class MPSCNNConvolution
```

## Overview

The attributes of a convolution operation are described by an [`MPSCNNConvolutionDescriptor`](/documentation/MetalPerformanceShaders/MPSCNNConvolutionDescriptor) object.

## Topics

### Initializers

[`init(coder:device:)`](/documentation/MetalPerformanceShaders/MPSCNNConvolution/init(coder:device:))

[`init(device:convolutionDescriptor:kernelWeights:biasTerms:flags:)`](/documentation/MetalPerformanceShaders/MPSCNNConvolution/init(device:convolutionDescriptor:kernelWeights:biasTerms:flags:))

Initializes a convolution kernel.

[`MPSCNNConvolutionDescriptor`](/documentation/MetalPerformanceShaders/MPSCNNConvolutionDescriptor)

A description of the attributes of a convolution kernel.

[`MPSCNNConvolutionFlags`](/documentation/MetalPerformanceShaders/MPSCNNConvolutionFlags)

Options used to control how kernel weights are stored and used in the CNN kernels

[`init(device:weights:)`](/documentation/MetalPerformanceShaders/MPSCNNConvolution/init(device:weights:))

[`MPSCNNConvolutionDataSource`](/documentation/MetalPerformanceShaders/MPSCNNConvolutionDataSource)

The protocol that provides convolution filter weights and bias terms.

### Instance Properties

[`inputFeatureChannels`](/documentation/MetalPerformanceShaders/MPSCNNConvolution/inputFeatureChannels)

The number of feature channels per pixel in the input image.

[`outputFeatureChannels`](/documentation/MetalPerformanceShaders/MPSCNNConvolution/outputFeatureChannels)

The number of feature channels per pixel in the output image.

[`groups`](/documentation/MetalPerformanceShaders/MPSCNNConvolution/groups)

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

[`subPixelScaleFactor`](/documentation/MetalPerformanceShaders/MPSCNNConvolution/subPixelScaleFactor)

[`neuron`](/documentation/MetalPerformanceShaders/MPSCNNConvolution/neuron)

The neuron filter to be applied as part of the convolution operation.

[`MPSCNNNeuron`](/documentation/MetalPerformanceShaders/MPSCNNNeuron)

A filter that applies a neuron activation function.

[`neuronType`](/documentation/MetalPerformanceShaders/MPSCNNConvolution/neuronType)

[`MPSCNNNeuronType`](/documentation/MetalPerformanceShaders/MPSCNNNeuronType)

The types of neuron filter to append to a convolution.

[`neuronParameterA`](/documentation/MetalPerformanceShaders/MPSCNNConvolution/neuronParameterA)

[`neuronParameterB`](/documentation/MetalPerformanceShaders/MPSCNNConvolution/neuronParameterB)

[`accumulatorPrecisionOption`](/documentation/MetalPerformanceShaders/MPSCNNConvolution/accumulatorPrecisionOption)

[`channelMultiplier`](/documentation/MetalPerformanceShaders/MPSCNNConvolution/channelMultiplier)

[`dataSource`](/documentation/MetalPerformanceShaders/MPSCNNConvolution/dataSource)

[`fusedNeuronDescriptor`](/documentation/MetalPerformanceShaders/MPSCNNConvolution/fusedNeuronDescriptor)

[`neuronParameterC`](/documentation/MetalPerformanceShaders/MPSCNNConvolution/neuronParameterC)



---

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)