fn

positive

Tensor
positive(x: Tensor)
source

Element-wise identity — returns the input unchanged.

Provided as the unary-+ counterpart of negative, matching the convention that +x is a no-op on numeric data.

Parameters

xTensor
Input tensor.

Returns

Tensor

The input x, returned without modification (no copy, no autograd op inserted).

Notes

Mathematical definition:

outi=+xi=xi\text{out}_i = +x_i = x_i

Useful only for symmetry with frameworks that treat +x as a unary operator.

Examples

>>> import lucid
>>> x = lucid.tensor([1.0, -2.0])
>>> lucid.positive(x) is x
True