---
title: "reLU(with:name:)"
framework: metalperformanceshadersgraph
role: symbol
role_heading: Instance Method
path: "metalperformanceshadersgraph/mpsgraph/relu(with:name:)"
---

# reLU(with:name:)

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

## Declaration

```swift
func reLU(with tensor: 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, 0).
