---
title: "convolution3DDataGradient(_:weights:outputShape:forwardConvolutionDescriptor:name:)"
framework: metalperformanceshadersgraph
role: symbol
role_heading: Instance Method
path: "metalperformanceshadersgraph/mpsgraph/convolution3ddatagradient(_:weights:outputshape:forwardconvolutiondescriptor:name:)"
---

# convolution3DDataGradient(_:weights:outputShape:forwardConvolutionDescriptor:name:)

Creates a 3D convolution gradient operation with respect to the source tensor of the forward convolution.

## Declaration

```swift
func convolution3DDataGradient(_ incomingGradient: MPSGraphTensor, weights: MPSGraphTensor, outputShape: [NSNumber], forwardConvolutionDescriptor: MPSGraphConvolution3DOpDescriptor, name: String?) -> MPSGraphTensor
```

## Parameters

- `incomingGradient`: Incoming loss gradient tensor
- `weights`: Forward pass weights tensor
- `outputShape`: Shape of the forward pass source tensor
- `forwardConvolutionDescriptor`: Forward convolution 2D op descriptor
- `name`: The name for the operation.

## Return Value

Return Value A valid MPSGraphTensor object

## Discussion

Discussion If S is source tensor to forward convolution, R is the result/returned tensor of forward convolution, and L is the loss function, convolution3DDataGradientWithIncomingGradientTensor returns tensor dL/dS = dL/dR * dR/dS, where dL/dR is the incomingGradient parameter.
