Skip to content
fn

div_op

→TensorImplPtr
int div_op(const int & a, const int & b)

Python wrappers

Public Python APIs implemented by this engine symbol.

Public entry point — element-wise division with autograd support.

Math

y=aby = \frac{a}{b}

See Also

add_op, sub_op, mul_op

Parameters

a, bconst TensorImplPtr&
Operands of any rank. Shapes must be NumPy-broadcast-compatible.

Returns

TensorImplPtr

Output tensor of shape broadcast_shapes(a.shape, b.shape) and promoted dtype. Participates in autograd via DivBackward.

Raises

LucidError
If a and b have incompatible shapes under NumPy broadcasting rules, or if their devices differ.

Examples

>>> auto c = div_op(a, b);    // c = a / b