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:
- input (dragon.vm.torch.Tensor) – The input tensor.
- out (dragon.vm.torch.Tensor, optional) – The output tensor.
- Returns:
dragon.vm.torch.Tensor – The output tensor.