torch_abs function

Abs

Abs

torch_abs(self)

Arguments

  • self: (Tensor) the input tensor.

abs(input) -> Tensor

Computes the element-wise absolute value of the given input tensor.

\mboxouti=\mboxinputi \mbox{out}_{i} = |\mbox{input}_{i}|

Examples

if (torch_is_installed()) { torch_abs(torch_tensor(c(-1, -2, 3))) }
  • Maintainer: Daniel Falbel
  • License: MIT + file LICENSE
  • Last published: 2025-02-14