relu¶
torch.relu(input) → Tensor
torch.nn.functional.relu(input, inplace=False) → Tensor
Applies the rectified linear unit function element-wise:
\[
\text{ReLU}(x) = \max(0, x)
\]
Parameters¶
- input (
Tensor) – Input tensor ondevice="tvarant".
Shape¶
- Input: \((*)\)
- Output: \((*)\), same as input
Example¶
y = torch.relu(x)