函数:set_attr_list_int

C函数原型

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

Python函数

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

函数功能

设置int64_t类型列表的属性值。

输入说明

attr:int,aclopAttr类型数据的指针地址。

需提前调用acl.op.create_attr接口创建aclopAttr类型数据。

attr_name:str,属性名。

attr_value:同时支持两种数据类型作为输入。

  • list,list中每个元素的数据类型为int。
  • numpy,一维数组numpy对象,类型为int64。

返回值说明

ret:int,错误码。
  • 返回0表示成功。
  • 返回其它值表示失败。

约束说明

  • 建议“attr_value”使用list数据类型,后续将不支持numpy作为输入。
  • “attr_value”需使用numpy数组,需要运行环境为python ≥ 3.8且numpy ≥ 1.22.0。