跳到主要内容

函数:create_attr

函数:create_handle_for_cast

C函数原型aclError aclopCreateHandleForCast(const aclTensorDesc *srcDesc, const aclTensorDesc *dstDesc, uint8_t truncate, aclopHandle **handle)
Python函数handle, ret = acl.op.create_handle_for_cast(src_desc, dst_desc, truncate)
函数功能创建数据类型转换的handle,同步接口。 创建handle成功后,需调用acl.op.execute_with_handle接口执行算子。
输入说明src_desc:int,输入tensor描述指针地址。 dst_desc:int,输出tensor描述指针地址。 truncate:预留。
返回值说明handle:int,输出的handle的指针地址。 ret:int,错误码。
- 返回0表示成功。
- 返回其它值表示失败
约束说明

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

函数:create_attr

C函数原型aclopAttr *aclopCreateAttr()
Python函数attr = acl.op.create_attr()
函数功能创建acl算子属性类型的数据,同步接口。
输入说明
返回值说明attr:int,acl算子属性地址对象。
约束说明

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

函数:destroy_attr

C函数原型void aclopDestroyAttr(const aclopAttr *attr)
Python函数acl.op.destroy_attr(attr)
函数功能销毁acl算子属性类型的数据,同步接口。
输入说明attr:int,acl算子属性地址对象, 此对象使用调用acl.op.create_attr创建。
返回值说明
约束说明销毁类接口:调用该接口后,不能继续使用已释放或销毁的资源,建议调用该接口后,将相关资源设置为无效值(例如,置为0或None)。

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

在线提单