TensorPlay
latest (dev)
Copy
View Markdown

Latest development documentation · Updated 2026-10-15

tensorplay.functional.abs

tensorplay.functional.abs(input: Tensor, *, out: Tensor | None) → Tensor[source]

Computes the absolute value of each element in input.

outi=∣inputi∣\text{out}_{i} = |\text{input}_{i}|
Parameters:

input (Tensor) – the input tensor.

Keyword Arguments:

out (Tensor, optional) – the output tensor.

Example:

>>> tensorplay.abs(tensorplay.tensor([-1, -2, 3]))
tensor([ 1,  2,  3])

On this page

Ask DeepWiki