<!--
{
  "availability" : [
    "iOS: 10.0.0 - 11.0.0",
    "iPadOS: 10.0.0 - 11.0.0",
    "macOS: 10.13.0 -",
    "tvOS: 10.0.0 - 11.0.0",
    "visionOS: 1.0.0 - 1.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "MetalPerformanceShaders",
  "identifier" : "/documentation/MetalPerformanceShaders/MPSCNNConvolutionDescriptor/init(kernelWidth:kernelHeight:inputFeatureChannels:outputFeatureChannels:neuronFilter:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Metal Performance Shaders"
    ],
    "preciseIdentifier" : "c:objc(cs)MPSCNNConvolutionDescriptor(cm)cnnConvolutionDescriptorWithKernelWidth:kernelHeight:inputFeatureChannels:outputFeatureChannels:neuronFilter:"
  },
  "title" : "init(kernelWidth:kernelHeight:inputFeatureChannels:outputFeatureChannels:neuronFilter:)"
}
-->

# init(kernelWidth:kernelHeight:inputFeatureChannels:outputFeatureChannels:neuronFilter:)

Creates a convolution descriptor with an optional neuron filter.

```
convenience init(kernelWidth: Int, kernelHeight: Int, inputFeatureChannels: Int, outputFeatureChannels: Int, neuronFilter: MPSCNNNeuron?)
```

## Parameters

`kernelWidth`

The width of the kernel window.

    This value must be     `>0`    . Larger values will take a longer time to process.

`kernelHeight`

The height of the kernel window.

    The value must be     `>0`    . Larger values will take a longer time to process.

`inputFeatureChannels`

The number of feature channels in the input image.

    This value must be     `>=1`    .

`outputFeatureChannels`

The number of feature channels in the output image.

    This value must be     `>=1`    .

`neuronFilter`

An optional neuron filter that can be applied to the output of the convolution operation.

## Return Value

A valid [`MPSCNNConvolution`](/documentation/MetalPerformanceShaders/MPSCNNConvolution) object or `nil`, if failure.

---

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)