Function: float_to_float16

Applicable Products

  • Ascend 950PR&950DT products: Supported
  • Atlas A3 products: supported
  • Atlas A2 products: Supported
  • Atlas 200I/500 A2 inference products: Supported
  • Atlas inference products: Supported
  • Atlas training products: Supported

Function

Converts data from float32 to aclFloat16.

Prototype

  • C Prototype

    aclFloat16 aclFloatToFloat16(float value)
    
  • Python Function

    output = acl.float_to_float16(value)
    

Parameters

Parameter Description
value float: data to be converted.

Return Values

Return Value Description
output aclFloat16 type.