fn
float_power
→Tensorfloat_power(x: Tensor | Scalar, y: Tensor | Scalar)Element-wise power that always promotes operands to float64.
Unlike the regular lucid.pow, float_power upcasts both
operands to float64 before exponentiation, so that negative bases
raised to non-integer powers and very large exponents behave
consistently without integer overflow or domain errors.
Parameters
xTensor | ScalarBase.
yTensor | ScalarExponent.
Returns
TensorElement-wise x ** y evaluated in float64.
Notes
Mathematical definition:
Promotion is mandatory — even integer inputs are cast to float64.
The result is always float64 regardless of input dtype.
Examples
>>> import lucid
>>> x = lucid.tensor([2, 3], dtype=lucid.int32)
>>> lucid.float_power(x, 0.5).dtype
lucid.float64