Skip to content
fn

log1p_op

→TensorImplPtr
int log1p_op(const int & a)

Python wrappers

Public Python APIs implemented by this engine symbol.

Natural log of 1 + x: y=ln⁡(1+x)y = \ln(1 + x).

Composite over add_op + log_op, with a rounding correction that keeps full relative precision for ∣x∣≪1|x| \ll 1. The gradient is LogBackward's 1/(1+x)1 / (1 + x): +∞+\infty at x=−1x = -1 and finite below it.

Math

y=ln⁡(1+x),∂y∂x=11+x y = \ln(1 + x), \qquad \frac{\partial y}{\partial x} = \frac{1}{1 + x}

See Also

log_op, log10_op.

Parameters

aTensorImplPtr
Input tensor. x=−1x = -1 gives −∞-\infty, x<−1x < -1 NaN, +∞+\infty gives +∞+\infty.

Returns

TensorImplPtr

Tensor of the same shape and dtype as a.