Skip to content
masterclass Buddy

PyTorch · Function

F.relu

torch.nn.functional.relu applies the rectified linear unit element by element. It returns a Tensor and can optionally operate in place.

Last updated

Syntax

torch.nn.functional.relu(input, inplace=False) → Tensor

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

Subscribe
  • ReLU
  • torch.nn.functional

Source: torch.nn.functional.relu — PyTorch 2.14 documentation. Checked 2026-11-03.