ClikaRT::ops::div
function
2 overloads.
div(Tensor, ScalarOrTensor, RoundingMode, Activation)
Tensor div(
Tensor input,
ScalarOrTensor other,
RoundingMode rounding_mode = RoundingMode::None,
Activation activation = Activation::Identity
)
Divides input by other elementwise, with an optional quotient rounding.
Broadcasts and promotes as add.
Parameters
input: 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 1400
div(Scalar, Tensor, RoundingMode, Activation)
Tensor div(
Scalar input,
Tensor other,
RoundingMode rounding_mode = RoundingMode::None,
Activation activation = Activation::Identity
)
Scalar-LHS a / b. input 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 1407