Function: float_to_float16

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas training product

Atlas inference product

Atlas 200I/500 A2 inference product

Description

Converts data of the float32 type to data of the aclFloat16 type.

Prototype

  • C Prototype
    1
    aclFloat16 aclFloatToFloat16(float value)
    
  • Python Function
    1
    output = acl.float_to_float16(value)
    

Parameters

Parameter

Description

value

float: data to be converted.

Return Value

Return Value

Description

output

Int, error code. 0 on success; else, failure.