Skip to main content
Log in

Mojo function

log1p

log1p(value: Symbol) -> Symbol

Computes the elementwise logarithm of 1 plus a symbolic tensor.

Creates a new op node to compute the elementwise log1p of a symbolic tensor and adds it to the graph, returning the symbolic result.

The log1p function is defined as log1p(x) = log(1 + x), where log() is the natural logarithm.

Using log1p(x) rather than computing log(1 + x) can give greater numerical precision results.

log(x) is undefined for x <= 0 for real numbers. Complex numbers are currently unsupported.

Args:

  • value (Symbol): The symbolic tensor to use as the input to the log1p computation.

Returns:

A new symbolic tensor value representing the output of the absolute value computation.

Raises:

If the symbol doesn't represent a tensor value.

Was this page helpful?