函数: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,acl算子属性地址对象, 此对象使用调用acl.op.create_attr创建。

attr_name:str,属性名。

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

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

返回值说明

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

约束说明

注意事项

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