torch.
abs
Computes the absolute value of each element in input.
input
input (Tensor) – the input tensor.
out (Tensor, optional) – the output tensor.
Example:
>>> torch.abs(torch.tensor([-1, -2, 3])) tensor([ 1, 2, 3])
此页内容是否对您有帮助
感谢反馈!