Rate This Document
Findability
Accuracy
Completeness
Readability

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

Table 1 Parameters

Parameter

Input/Output

Description

Constraint

input

Input

The tensor on which modulo operations are performed.

  • This pointer is not null and only 1D tensors are accepted. Scalars are accepted, but input cannot be a scalar together with mod.
  • The matrix does not contain NaN or infinity, which must be checked by the user to prevent undefined calculation results.

mod

Input

Divider used for modulo operations.

  • This pointer is not null and only 1D tensors are accepted. Scalars are accepted, but mod cannot be a scalar together with input.
  • The elements do not contain 0; when the input is a matrix, the elements do not contain NaN or infinity. The two constraints must be checked by the user to prevent undefined calculation results.

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.