fn
true_divide
→Tensortrue_divide(a: Tensor, b: Tensor | Scalar)Element-wise true (floating-point) division.
Equivalent to divide; named true_divide for parity with
NumPy / reference-framework spellings that distinguish it from
integer-flavored floor_divide.
Parameters
aTensorNumerator.
bTensor | ScalarDenominator.
Returns
TensorElement-wise quotient in a floating-point dtype.
Notes
Mathematical definition:
Even for integer inputs, the output dtype is a floating type — this is
the defining property that separates true_divide from
floor_divide.
Examples
>>> import lucid
>>> a = lucid.tensor([7, 8], dtype=lucid.int32)
>>> lucid.true_divide(a, 2)
Tensor([3.5, 4.])