fn

resolve_neg

Tensor
resolve_neg(x: Tensor)
source

Materialise any pending lazy negation — no-op in Lucid.

Reference frameworks that maintain a lazy-negation flag use this op to force the flag to be applied to the underlying buffer. Lucid has no such flag (see is_neg), so this returns the input unchanged.

Parameters

xTensor
Input tensor.

Returns

Tensor

The input x, returned unchanged.

Notes

Equivalent to the identity map:

out=x.\text{out} = x.

Provided strictly for API parity. Calling this op is free — no copy is made, no autograd node is inserted.

Examples

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