Compute the elementwise floor division .
Floor division is non-differentiable (piecewise constant with jumps at
every integer crossing), so no autograd node is registered: the returned
tensor never carries a grad_fn and the result effectively detaches its
inputs from the graph.
Math
Shape
a.shape == b.shape. The result is the same shape; the dtype is always
I64.
See Also
div_op : True (real-valued) elementwise division, fully differentiable.
Parameters
aTensorImplPtrbTensorImplPtra — no broadcasting and no implicit dtype promotion is performed.Returns
TensorImplPtrTensor of shape a.shape and dtype Dtype::I64 holding . The cast to I64 is unconditional regardless of the input dtype, matching Python's // operator semantics.
Raises
LucidErrora.shape != b.shape or a.dtype != b.dtype.Notes
Behaviour on division by zero is delegated to the backend primitive
(backend.floordiv). Because the output is forced to I64, any
floating-point NaN / Inf produced by the backend is reinterpreted
to a platform-defined integer value.