50% off | Unlimited Data & AI Learning
Get 50% off unlimited learning

torch (version 0.3.0)

torch_abs: Abs

Description

Abs

Usage

torch_abs(self)

Arguments

self

(Tensor) the input tensor.

abs(input) -> Tensor

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

outi=|inputi|

Examples

Run this code
# NOT RUN {
if (torch_is_installed()) {

torch_abs(torch_tensor(c(-1, -2, 3)))
}
# }

Run the code above in your browser using DataLab