---
title: MPSGraphPooling2DOpDescriptor
framework: metalperformanceshadersgraph
role: symbol
role_heading: Class
path: metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor
---

# MPSGraphPooling2DOpDescriptor

The class that defines the parameters for a 2D pooling operation.

## Declaration

```swift
class MPSGraphPooling2DOpDescriptor
```

## Overview

Overview Use this descriptor with the following methods: maxPooling2D(withSourceTensor:descriptor:name:) maxPooling2DReturnIndices(_:descriptor:name:) maxPooling2DGradient(withGradientTensor:sourceTensor:descriptor:name:) maxPooling2DGradient(withGradientTensor:indicesTensor:outputShape:descriptor:name:) maxPooling2DGradient(withGradientTensor:indicesTensor:outputShapeTensor:descriptor:name:) avgPooling2D(withSourceTensor:descriptor:name:) avgPooling2DGradient(withGradientTensor:sourceTensor:descriptor:name:)

## Topics

### Initializers

- [init(kernelWidth:kernelHeight:strideInX:strideInY:dilationRateInX:dilationRateInY:paddingLeft:paddingRight:paddingTop:paddingBottom:paddingStyle:dataLayout:)](metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/init(kernelwidth:kernelheight:strideinx:strideiny:dilationrateinx:dilationrateiny:paddingleft:paddingright:paddingtop:paddingbottom:paddingstyle:datalayout:).md)
- [init(kernelWidth:kernelHeight:strideInX:strideInY:paddingStyle:dataLayout:)](metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/init(kernelwidth:kernelheight:strideinx:strideiny:paddingstyle:datalayout:).md)

### Instance Properties

- [ceilMode](metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/ceilmode.md)
- [dataLayout](metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/datalayout.md)
- [dilationRateInX](metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/dilationrateinx.md)
- [dilationRateInY](metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/dilationrateiny.md)
- [includeZeroPadToAverage](metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/includezeropadtoaverage.md)
- [kernelHeight](metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/kernelheight.md)
- [kernelWidth](metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/kernelwidth.md)
- [paddingBottom](metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/paddingbottom.md)
- [paddingLeft](metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/paddingleft.md)
- [paddingRight](metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/paddingright.md)
- [paddingStyle](metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/paddingstyle.md)
- [paddingTop](metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/paddingtop.md)
- [returnIndicesDataType](metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/returnindicesdatatype.md)
- [returnIndicesMode](metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/returnindicesmode.md)
- [strideInX](metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/strideinx.md)
- [strideInY](metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/strideiny.md)

### Instance Methods

- [setExplicitPaddingWithPaddingLeft(_:paddingRight:paddingTop:paddingBottom:)](metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor/setexplicitpaddingwithpaddingleft(_:paddingright:paddingtop:paddingbottom:).md)

## Relationships

### Inherits From

- [MPSGraphObject](metalperformanceshadersgraph/mpsgraphobject.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Classes

- [MPSGraph](metalperformanceshadersgraph/mpsgraph.md)
- [MPSGraphCompilationDescriptor](metalperformanceshadersgraph/mpsgraphcompilationdescriptor.md)
- [MPSGraphConvolution2DOpDescriptor](metalperformanceshadersgraph/mpsgraphconvolution2dopdescriptor.md)
- [MPSGraphConvolution3DOpDescriptor](metalperformanceshadersgraph/mpsgraphconvolution3dopdescriptor.md)
- [MPSGraphCreateSparseOpDescriptor](metalperformanceshadersgraph/mpsgraphcreatesparseopdescriptor.md)
- [MPSGraphDepthwiseConvolution2DOpDescriptor](metalperformanceshadersgraph/mpsgraphdepthwiseconvolution2dopdescriptor.md)
- [MPSGraphDepthwiseConvolution3DOpDescriptor](metalperformanceshadersgraph/mpsgraphdepthwiseconvolution3dopdescriptor.md)
- [MPSGraphDevice](metalperformanceshadersgraph/mpsgraphdevice.md)
- [MPSGraphExecutable](metalperformanceshadersgraph/mpsgraphexecutable.md)
- [MPSGraphExecutableExecutionDescriptor](metalperformanceshadersgraph/mpsgraphexecutableexecutiondescriptor.md)
- [MPSGraphExecutableSerializationDescriptor](metalperformanceshadersgraph/mpsgraphexecutableserializationdescriptor.md)
- [MPSGraphExecutionDescriptor](metalperformanceshadersgraph/mpsgraphexecutiondescriptor.md)
- [MPSGraphFFTDescriptor](metalperformanceshadersgraph/mpsgraphfftdescriptor.md)
- [MPSGraphGRUDescriptor](metalperformanceshadersgraph/mpsgraphgrudescriptor.md)
- [MPSGraphImToColOpDescriptor](metalperformanceshadersgraph/mpsgraphimtocolopdescriptor.md)
