powered by
Abs
torch_abs(self)
(Tensor) the input tensor.
Computes the element-wise absolute value of the given input tensor.
input
$$ \mbox{out}_{i} = |\mbox{input}_{i}| $$
if (torch_is_installed()) { torch_abs(torch_tensor(c(-1, -2, 3))) }
Run the code above in your browser using DataLab