FloorMod
Function
Perform element-wise modulo operations of two input tensors.
Prototype
1 2 3 4 5 | int FloorMod(T *input, T *mod, T *output, size_t length); // input and mod are pointer variables. int FloorMod(T input, T *mod, T *output, size_t length); // input is a pointer variable. int FloorMod(T *input, T mod, T *output, size_t length); // mod is a pointer variable. |
- This API accepts only 1D tensors as inputs.
- Template type T: float and double are supported.
- The valid length of the pointer is determined by the user.
- Ensure that the valid spaces of the input pointers do not overlap.
Parameters
Parameter |
Input/Output |
Description |
Constraint |
|---|---|---|---|
input |
Input |
The tensor on which modulo operations are performed. |
|
mod |
Input |
Divider used for modulo operations. |
|
output |
Input |
Tensor used to store the calculation results as the output. |
This pointer is not null and only 1D tensors are accepted. |
length |
Input |
Length of the tensor used for calculation. |
The value range is [0, 2^64 – 1]. The length value is equal to the minimum value of the valid space of output, input, or mod. The value must be checked by the user to prevent security issues such as buffer overflow. |
Parent topic: Operator APIs