This API broadcasts the scalar self to a tensor with the same shape as the tensor other. Each element in the tensor is converted to the remainder obtained by dividing the corresponding element in other. The sign of the result is the same as that of the divisor other, and the absolute value of the result is less than that of other.
The calculation formula is as follows: remainder(self, other) is equivalent to the following formula:
Example:
[object Object]
Each operator is divided into two APIs (../common/two-phase-apis.md). You must call aclnnRemainderScalarTensorGetWorkspaceSize to obtain the workspace size required for computation and the executor that contains the operator computation process, and then call aclnnRemainderScalarTensor to perform the computation.
Parameters:
[object Object]- [object Object]Atlas training products[object Object]: The data type cannot be BFLOAT16.
Returns
[object Object]: status code. For details, see .The first-phase API implements input parameter validation. The following error codes may be returned.
[object Object]
Deterministic computation:
- Default deterministic implementation of aclnnRemainderScalarTensor.
When the data type of
[object Object]is INT32, the functionality and precision within the range of [–2^24, 2^24] are preferentially ensured.When
[object Object]is 0 and the data type of[object Object]is an integer, the result of[object Object]is[object Object].
The following example is for reference only. For details, see .