Skip to content
fn

exp2_op

→TensorImplPtr
int exp2_op(const int & a)

Python wrappers

Public Python APIs implemented by this engine symbol.

Base-2 exponential: y=2x=exp⁡(xln⁡2)y = 2^{x} = \exp(x \ln 2).

Composite over mul_op + exp_op. Multiplying against a constant tensor keeps the gradient chain visible to MulBackward and ExpBackward.

Math

y=exp⁡(x⋅ln⁡2),∂y∂x=(ln⁡2)⋅2x y = \exp(x \cdot \ln 2), \qquad \frac{\partial y}{\partial x} = (\ln 2) \cdot 2^{x}

See Also

exp_op.

Parameters

aTensorImplPtr
Input tensor.

Returns

TensorImplPtr

Tensor of the same shape and dtype as a.