---
title: "leakyReLU(with:alphaTensor:name:)"
framework: metalperformanceshadersgraph
role: symbol
role_heading: Instance Method
path: "metalperformanceshadersgraph/mpsgraph/leakyrelu(with:alphatensor:name:)"
---

# leakyReLU(with:alphaTensor:name:)

Computes the leaky rectified linear unit (ReLU) activation function on the input tensor.

## Declaration

```swift
func leakyReLU(with tensor: MPSGraphTensor, alphaTensor: MPSGraphTensor, name: String?) -> MPSGraphTensor
```

## Parameters

- `tensor`: The input tensor.
- `name`: The name for the operation.

## Return Value

Return Value A valid MPSGraphTensor object

## Discussion

Discussion The operation is: f(x) = max(x, alpha). This operation supports broadcasting with the alpha tensor.
