---
title: "leakyReLUGradient(withIncomingGradient:sourceTensor:alphaTensor:name:)"
framework: metalperformanceshadersgraph
role: symbol
role_heading: Instance Method
path: "metalperformanceshadersgraph/mpsgraph/leakyrelugradient(withincominggradient:sourcetensor:alphatensor:name:)"
---

# leakyReLUGradient(withIncomingGradient:sourceTensor:alphaTensor:name:)

Computes the gradient of the leaky rectified linear unit (ReLU) activation.

## Declaration

```swift
func leakyReLUGradient(withIncomingGradient gradient: MPSGraphTensor, sourceTensor source: MPSGraphTensor, alphaTensor: MPSGraphTensor, name: String?) -> MPSGraphTensor
```

## Parameters

- `gradient`: The incoming gradient tensor.
- `source`: The input tensor in forward pass.
- `name`: The name for the operation.

## Return Value

Return Value A valid MPSGraphTensor object

## Discussion

Discussion This operation supports broadcasting with the alpha tensor.
