---
title: "avgPooling4DGradient(_:source:descriptor:name:)"
framework: metalperformanceshadersgraph
role: symbol
role_heading: Instance Method
path: "metalperformanceshadersgraph/mpsgraph/avgpooling4dgradient(_:source:descriptor:name:)"
---

# avgPooling4DGradient(_:source:descriptor:name:)

Creates an average pooling gradient operation and returns the result tensor.

## Declaration

```swift
func avgPooling4DGradient(_ gradient: MPSGraphTensor, source: MPSGraphTensor, descriptor: MPSGraphPooling4DOpDescriptor, name: String?) -> MPSGraphTensor
```

## Parameters

- `gradient`: An input gradient tensor.
- `source`: The input tensor for the forward pass.
- `descriptor`: A pooling operation descriptor that specifies pooling window sizes, strides, dilation rates and paddings.
- `name`: The name for the operation.

## Return Value

Return Value A valid MPSGraphTensor object.
