fn
divide
→Tensordivide(a: Tensor, b: Tensor | Scalar)Element-wise true division.
Verbose alias of the / operator. Always performs floating-point
division — integer operands are promoted to a floating dtype before
the division so that the result preserves fractional parts.
Parameters
aTensorNumerator.
bTensor | ScalarDenominator.
Returns
TensorElement-wise quotient of the broadcast shape of a and b,
in a floating-point dtype.
Notes
Mathematical definition:
Division by zero produces (or NaN for 0/0)
rather than raising. Gradients are
and
.
Examples
>>> import lucid
>>> a = lucid.tensor([6.0, 9.0])
>>> lucid.divide(a, 3.0)
Tensor([2., 3.])