---
title: "depthwiseConvolution3DWeightsGradient(_:source:outputShape:descriptor:name:)"
framework: metalperformanceshadersgraph
role: symbol
role_heading: Instance Method
path: "metalperformanceshadersgraph/mpsgraph/depthwiseconvolution3dweightsgradient(_:source:outputshape:descriptor:name:)"
---

# depthwiseConvolution3DWeightsGradient(_:source:outputShape:descriptor:name:)

Creates a 3D depthwise convolution gradient for weights operation and returns the result tensor.

## Declaration

```swift
func depthwiseConvolution3DWeightsGradient(_ incomingGradient: MPSGraphTensor, source: MPSGraphTensor, outputShape: [NSNumber], descriptor: MPSGraphDepthwiseConvolution3DOpDescriptor, name: String?) -> MPSGraphTensor
```

## Parameters

- `incomingGradient`: A 3D input gradient tensor - must be at least rank=4 (NCDHW).
- `source`: The forward pass 3D Image source as tensor - must be at least rank=4 (NCDHW).
- `outputShape`: The shape of the οutput tensor (and therefore weight tensor of forward pass).
- `descriptor`: The descriptor object that specifies strides, dilation rates and paddings.
- `name`: The name for the operation.

## Return Value

Return Value A valid MPSGraphTensor object
