Skip to content
fn

reciprocal_inplace_op

→TensorImplPtr
int reciprocal_inplace_op(const int & a)

In-place reciprocal: writes 1/x1/x back into a.

Math

ai←1aia_i \leftarrow \frac{1}{a_i}

See Also

reciprocal_op — out-of-place counterpart.

Parameters

aTensorImplPtr
Tensor to invert in place. Must be non-null. Behaviour at ai=0a_i = 0 follows the dispatching backend (typically ±∞\pm\infty).

Returns

TensorImplPtr

The same pointer as a.