relu

dragon.vm.torch.nn.functional.relu(
  input,
  inplace=False
)[source]

Apply the rectified linear unit to input. [Nair & Hinton, 2010].

The ReLU function is defined as:

\[\text{ReLU}(x) = \begin{cases} x, & \text{ if } x \geq 0 \\ 0, & \text{ otherwise } \end{cases} \]
Parameters:
  • input (dragon.vm.torch.Tensor) – The input tensor.
  • inplace (bool, optional, default=False) – Whether to do the operation in-place.
Returns:

dragon.vm.torch.Tensor – The output tensor.