---
title: "reLUGradient(withIncomingGradient:sourceTensor:name:)"
framework: metalperformanceshadersgraph
role: symbol
role_heading: Instance Method
path: "metalperformanceshadersgraph/mpsgraph/relugradient(withincominggradient:sourcetensor:name:)"
---

# reLUGradient(withIncomingGradient:sourceTensor:name:)

Computes the gradient of the ReLU  (rectified linear activation unit) function using the incoming gradient.

## Declaration

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

## Parameters

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

## Return Value

Return Value A valid MPSGraphTensor object.
