ClikaRT::ops::div
function
2 overloads.
div(Tensor, ScalarOrTensor, RoundingMode, Activation)
Tensor div(
Tensor a,
ScalarOrTensor other,
RoundingMode rounding_mode = RoundingMode::None,
Activation activation = Activation::Identity
)
Divides a by other elementwise, with an optional quotient rounding.
Broadcasts and promotes as add.
Parameters
a: dividend tensor.other: divisor: tensor or scalar literal.rounding_mode:RoundingMode::None(default) is true division;Truncrounds the quotient toward zero;Floortoward-inf(ops::floor_divideis exactlydivwithFloor).activation: fused float-only epilogue applied AFTER the rounding, in the same kernel pass; defaultActivation::Identity.
Returns: the broadcast-shaped quotient at the promoted dtype.
Throws
-
ClikaRT::Error: (INVALID_ARGUMENT) when the operand shapes are not broadcast-compatible. Also raises (INVALID_ARGUMENT) for a non-floatactivationoperand dtype.auto q = ClikaRT::ops::div(a, b); // true divisionauto f = ClikaRT::ops::div(a, b, ClikaRT::ops::RoundingMode::Floor);
Declared in ClikaRT/compute/ops.h, line 1388
div(Scalar, Tensor, RoundingMode, Activation)
Tensor div(
Scalar a,
Tensor b,
RoundingMode rounding_mode = RoundingMode::None,
Activation activation = Activation::Identity
)
Scalar-LHS a / b. a keeps its kind (see Scalar). The parameter set mirrors the tensor-first form: rounding_mode picks true/trunc/floor division, activation applies to the result.
Declared in ClikaRT/compute/ops.h, line 1395