ClikaRT::ops::mod
function
mod()
Tensor mod(
Tensor a,
ScalarOrTensor other,
ModMode mode = ModMode::Python
)
Elementwise modulo with a selectable sign convention.
ModMode::Python (default) follows the DIVISOR's sign; ModMode::C follows the DIVIDEND's. ops::remainder is exactly the Python form, ops::fmod exactly the C form. Broadcasts and promotes as add.
Parameters
a: dividend tensor.other: divisor: tensor or scalar literal.mode: the sign convention; defaultModMode::Python.
Returns: the broadcast-shaped remainders at the promoted dtype.
Throws
-
ClikaRT::Error: (INVALID_ARGUMENT) when the operand shapes are not broadcast-compatible.auto r = ClikaRT::ops::mod(a, 3); // sign follows the divisor
Declared in ClikaRT/compute/ops.h, line 1465