Function: set_attr_list_int

C Prototype

aclError aclopSetAttrListInt(aclopAttr *attr, const char *attrName, int numValues, const int64_t *attrValue);

Python Function

ret = acl.op.set_attr_list_int(attr, attr_name, attr_value)

Function Usage

Sets the values (a list of int64_t elements) of an attribute.

Input Description

attr: int, pointer address of the aclopAttr type data.

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 int type.
  • NumPy, one-dimensional array NumPy object. The type is int64.

Return Value

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.