Skip to content
masterclass Buddy

PyTorch · Function

torch.relu

torch.relu_ applies ReLU to a tensor in place. Negative values become zero, while nonnegative values stay unchanged.

Last updated

Syntax

torch.relu_(input)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • torch.relu
  • torch.nn.ReLU

Source: torch.relu_ — PyTorch 2.14 documentation. Checked 2026-11-03.