torch.abs# torch.abs(input: Tensor, *, out: Optional[Tensor]) → Tensor# Computes the absolute value of each element in input. outi=∣inputi∣\text{out}_{i} = |\text{input}_{i}| outi=∣inputi∣ Parameters input (Tensor) – the input tensor. Keyword Arguments out (Tensor, optional) – the output tensor. Example: >>> torch.abs(torch.tensor([-1, -2, 3])) tensor([ 1, 2, 3])
torch.abs# torch.abs(input: Tensor, *, out: Optional[Tensor]) → Tensor# Computes the absolute value of each element in input. outi=∣inputi∣\text{out}_{i} = |\text{input}_{i}| outi=∣inputi∣ Parameters input (Tensor) – the input tensor. Keyword Arguments out (Tensor, optional) – the output tensor. Example: >>> torch.abs(torch.tensor([-1, -2, 3])) tensor([ 1, 2, 3])