- This API performs division and selects the rounding operation based on the mode parameter.
- Formula:
[object Object] and [object Object] implement the same function in different ways. Select a proper operator based on your requirements.
[object Object]: An output tensor object needs to be created to store the computation result.[object Object]: No output tensor object needs to be created, and the computation result is stored in the memory of the input tensor.
Each operator has calls. First, [object Object] or [object Object] is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, [object Object] or [object Object] is called to perform computation.
Parameters
[object Object][object Object]Atlas training products[object Object]: The data type cannot be BFLOAT16.
Ascend 950PR/Ascend 950DT:
- The data type must comply with the [object Object]TensorScalar[object Object]. If the derived data type is an integer or Boolean type, it will be converted to FLOAT.
- When mode is set to 0, the following data types are supported: FLOAT, FLOAT16, DOUBLE, BFLOAT16, COMPLEX128, and COMPLEX64.
- When mode is set to 1 or 2, the following data types are supported: FLOAT, FLOAT16, DOUBLE, INT32, INT64, INT16, INT8, UINT8, BOOL, BFLOAT16, COMPLEX128, and COMPLEX64.
Returns
[object Object]: status code. For details, see .The first-phase API performs input parameter validation. The following errors may be returned:
[object Object]
Parameters
[object Object][object Object]Atlas training products[object Object]: The data type cannot be BFLOAT16.
Ascend 950PR/Ascend 950DT:
- The data type must meet the requirements of [object Object]TensorScalar Deduction Relationship[object Object].
- When mode is set to 0 and the derived data type of selfRef and other is integer or Boolean, the derived data type is converted to FLOAT.
- When mode is set to 0, selfRef supports FLOAT, FLOAT16, DOUBLE, and BFLOAT16. When mode is set to 1 or 2, selfRef supports FLOAT, FLOAT16, DOUBLE, INT32, INT64, INT16, INT8, UINT8, BOOL, and BFLOAT16. other does not support COMPLEX128 or COMPLEX64.
Returns
[object Object]: status code. For details, see .The first-phase API performs input parameter validation. The following errors may be returned:
[object Object]
- Deterministic computation:
[object Object]and[object Object]default to a deterministic implementation.
- [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training products/Atlas A3 inference products[object Object]: When
[object Object]is set to[object Object]([object Object]mode) or[object Object]([object Object]mode), the limited precision of FLOAT16/BFLOAT16 may result in errors during rounding or rounding down because not all fractional parts can be represented. You are advised to use data types with higher precision, such as FLOAT32.
The following example is for reference only. For details, see .