---
title: "init(kernelWidth:kernelHeight:strideInX:strideInY:dilationRateInX:dilationRateInY:paddingLeft:paddingRight:paddingTop:paddingBottom:paddingStyle:dataLayout:)"
framework: metalperformanceshadersgraph
role: symbol
role_heading: Initializer
path: "metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/init(kernelwidth:kernelheight:strideinx:strideiny:dilationrateinx:dilationrateiny:paddingleft:paddingright:paddingtop:paddingbottom:paddingstyle:datalayout:)"
---

# init(kernelWidth:kernelHeight:strideInX:strideInY:dilationRateInX:dilationRateInY:paddingLeft:paddingRight:paddingTop:paddingBottom:paddingStyle:dataLayout:)

Creates a 2D pooling descriptor with given values.

## Declaration

```swift
convenience init?(kernelWidth: Int, kernelHeight: Int, strideInX: Int, strideInY: Int, dilationRateInX: Int, dilationRateInY: Int, paddingLeft: Int, paddingRight: Int, paddingTop: Int, paddingBottom: Int, paddingStyle: MPSGraphPaddingStyle, dataLayout: MPSGraphTensorNamedDataLayout)
```

## Parameters

- `kernelWidth`: See kernelWidth property.
- `kernelHeight`: See kernelHeight property.
- `strideInX`: See strideInX property.
- `strideInY`: See strideInY property.
- `dilationRateInX`: See dilationRateInX property.
- `dilationRateInY`: See dilationRateInY property.
- `paddingLeft`: See paddingLeft property.
- `paddingRight`: See paddingRight property.
- `paddingTop`: See paddingTop property.
- `paddingBottom`: See paddingBottom property.
- `paddingStyle`: See paddingStyle property.
- `dataLayout`: See dataLayout property.

## Return Value

Return Value The descriptor on autoreleasepool.
