Skip to content
fn

relu_

→Tensor
relu_(input: Tensor, inplace: bool = True)

Implementing kernel

C++ engine symbols that back this Python API.

In-place ReLU — input is overwritten with max(0, input).

Backed by the engine's native in-place ReLU kernel when no autograd graph has to be extended (no temporary buffer).

Parameters

inputTensor
Input; modified in place and also returned.
inplacebool= True
False returns relu's fresh result instead. Default True.

Returns

Tensor

The same input tensor, now holding max(0, input).

Used by 1