abs

dragon.vm.torch.abs(
  input,
  out=None
)[source]

Compute the absolute value of input.

\[\text{out} = \left| \text{input} \right| \]

Examples:

print(torch.abs(torch.tensor([-1, 0, 1])))  # [1, 0, 1]
Parameters:
Returns:

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