跳到主要内容

函数:set_attr_float

函数:set_attr_bool

C函数原型aclError **aclopSetAttrBool(**aclopAttr *attr, const char *attrName, uint8_t attrValue)
Python函数ret = acl.op.set_attr_bool(attr, attr_name, attr_value)
函数功能设置bool类型标量的属性值,同步接口。
输入说明attr:int,acl算子属性地址对象, 此对象使用调用acl.op.create_attr创建。 attr_name:str,属性名。 attr_value:int,属性值。
返回值说明ret:int,错误码。
- 返回0表示成功。
- 返回其它值表示失败。
约束说明

父主题: 算子加载与执行(op)

函数:set_attr_int

C函数原型aclError **aclopSetAttrInt(**aclopAttr *attr, const char *attrName, int64_t attrValue);
Python函数ret = acl.op.set_attr_int(attr, attr_name, attr_value)
函数功能设置int64_t类型标量的属性值,同步接口。
输入说明attr:int,acl算子属性地址对象, 此对象使用调用acl.op.create_attr创建。 attr_name:str,属性名。 attr_value:int,属性值。
返回值说明ret:int,错误码。
- 返回0表示成功。
- 返回其它值表示失败。
约束说明

父主题: 算子加载与执行(op)

函数:set_attr_float

C函数原型aclError **aclopSetAttrFloat(**aclopAttr *attr, const char *attrName, float attrValue);
Python函数ret = acl.op.set_attr_float(attr, attr_name, attr_value)
函数功能设置float类型标量的属性值,同步接口。
输入说明attr:int,acl算子属性地址对象, 此对象使用调用acl.op.create_attr创建。 attr_name:str,属性名。 attr_value:float,属性值。
返回值说明ret:int,错误码。
- 返回0表示成功。
- 返回其它值表示失败。
约束说明

父主题: 算子加载与执行(op)

函数:set_attr_string

C函数原型aclError **aclopSetAttrString(**aclopAttr *attr, const char *attrName, const char* attrValue);
Python函数ret = acl.op.set_attr_string(attr, attr_name, attr_value)
函数功能设置字符串类型标量的属性值,同步接口。
输入说明attr:int,acl算子属性地址对象, 此对象使用调用acl.op.create_attr创建。 attr_name:str,属性名。 attr_value:str,属性值。
返回值说明ret:int,错误码。
- 返回0表示成功。
- 返回其它值表示失败。
约束说明

父主题: 算子加载与执行(op)

函数:set_attr_list_bool

C函数原型aclError aclopSetAttrListBool**(**aclopAttr *attr, const char *attrName, int numValues, const uint8_t *attrValue);
Python函数ret = acl.op.set_attr_list_bool(attr, attr_name, attr_value)
函数功能设置bool类型列表的属性值,同步接口。
输入说明attr:int,acl算子属性地址对象, 此对象使用调用acl.op.create_attr创建。 attr_name:str,属性名。 attr_value:同时支持两种数据类型作为输入。
- list,list中每个元素的数据类型为int,取值范围为0~255。
- numpy,一维数组numpy对象,类型为uint8。
返回值说明ret:int,错误码。
- 返回0表示成功。
- 返回其它值表示失败。
约束说明- 建议attr_value使用list数据类型,后续将不支持numpy作为输入。
- 若attr_value需使用numpy数组,需要运行环境为python>=3.8且numpy>=1.22.0。

父主题: 算子加载与执行(op)

函数: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:同时支持两种数据类型作为输入。
- list,list中每个元素的数据类型为int。
- numpy,一维数组numpy对象,类型为int64。
返回值说明ret:int,错误码。
- 返回0表示成功。
- 返回其它值表示失败。
约束说明- 建议attr_value使用list数据类型,后续将不支持numpy作为输入。
- 若attr_value需使用numpy数组,需要运行环境为python>=3.8且numpy>=1.22.0。

父主题: 算子加载与执行(op)

在线提单