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.
Parameter description:
[object Object][object Object]Atlas training products[object Object]: The data type cannot be BFLOAT16.
Ascend 950PR/Ascend 950DT:
- When mode is set to 0, the supported data types of out are FLOAT, FLOAT16, DOUBLE, BFLOAT16, COMPLEX128, and COMPLEX64.
- When mode is set to 1 or 2, the supported data types of out are FLOAT, FLOAT16, DOUBLE, INT32, INT64, INT16, INT8, UINT8, BOOL, BFLOAT16, COMPLEX128, and COMPLEX64.
- When mode is 0 and the derived data types of self and other are integer or Boolean, the derived data types will be converted to FLOAT.
Returns
[object Object]: status code. For details, see .The first-phase API performs input parameter validation. The following errors may be returned:
[object Object]
Parameter description:
[object Object][object Object]Atlas training products[object Object]: The data type cannot be BFLOAT16.
Ascend 950PR/Ascend 950DT:
- When mode is set to 0, the selfRef data type can be FLOAT, FLOAT16, DOUBLE, or BFLOAT16.
- When mode is set to 1 or 2, the selfRef data type can be FLOAT, FLOAT16, DOUBLE, INT32, INT64, INT16, INT8, UINT8, BOOL, or BFLOAT16.
- When mode is set to 0 and the derived data type of selfRef and other is an integer or Boolean type, the derived data type is converted to FLOAT.
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 .