If aclTensor inputs of an API (such as aclnnAdd or aclnnMul) are of different data types, the API internally deduces a data type and converts the input data into this data type for computation.
Some supported by aclTensor meet the following deduction rules, which are similar to those of .
[object Object]
Table 1 Data type deduction relationship
- When aclnnAdd is called, if the data types of the input parameters are different (one is float16 and the other is float32), the API converts float16 to float32 for computation.
- When aclnnAdd is called, if the data types of the input parameters are different (one is float32 and the other is bool), the API converts bool to float32 for computation.
If the input tensor data type of an API (such as aclnnAdds or aclnnMuls) is different from that of the input scalar data type, the API internally deduces a data type and converts the input data into the deduced data type for computation.
The rules for type deduction are as follows.
[object Object]
Table 1 Data type deduction relationship
- If the data type of the input tensor is float16 and that of the input scalar is float32, the API will convert the float32 data type of the input scalar to float16 and then perform computation.
- If the data type of the input tensor is bool and that of the input scalar is float32, the API will convert the bool data type of the input tensor to float32 and then perform computation.