Function: set_attr_list_float

Applicable Products

Product

Supported (√/x)

Ascend 950PR/Ascend 950DT

√

Atlas A3 training products/Atlas A3 inference products

√

Atlas A2 training products/Atlas A2 inference products

√

Atlas training products

√

Atlas inference products

√

Atlas 200I/500 A2 inference products

√

Function Usage

Sets the values (a list of floats) of an attribute.

Prototype

  • C Prototype
    1
    aclError aclopSetAttrListFloat(aclopAttr *attr, const char *attrName, int numValues, const float  *attrValue)
    
  • Python Function
    1
    ret = acl.op.set_attr_list_float(attr, attr_name, num_values , attr_value)
    

Parameter Description

Parameter

Description

attr

Int, pointer address of the data of the aclopAttr type.

Call acl.op.create_attr to create data of the aclopAttr type in advance.

attr_name

Str, attribute name.

attr_value

Two data types are supported:

  • List, which consists of elements of the float type.
  • NumPy object, one-dimensional array. The type is float32.

Return Value Description

Return Value

Description

ret

Int, error code.

Restrictions

  • You are advised to use the list data type for attr_value because NumPy will not be supported as the input in future releases.
  • To use NumPy for attr_value, ensure that the operating environment is Python 3.8 or later and NumPy 1.22.0 or later.