昇腾社区首页
中文
注册

函数:create_handle_for_cast

产品支持情况

产品

是否支持

Atlas A3 训练系列产品/Atlas A3 推理系列产品

Atlas A2 训练系列产品/Atlas 800I A2 推理产品/A200I A2 Box 异构组件

Atlas 训练系列产品

Atlas 推理系列产品

Atlas 200I/500 A2 推理产品

Atlas 200/300/500 推理产品

功能说明

创建数据类型转换的handle。

创建handle成功后,需调用acl.op.execute_with_handle接口执行算子。

函数原型

  • C函数原型
    1
    aclError aclopCreateHandleForCast(const aclTensorDesc *srcDesc, const aclTensorDesc *dstDesc, uint8_t truncate, aclopHandle **handle)
    
  • python函数
    1
    handle, ret = acl.op.create_handle_for_cast(src_desc, dst_desc, truncate)
    

参数说明

参数名

说明

src_desc

int,输入Tensor描述指针地址。

dst_desc

int,输出Tensor描述指针地址。

truncate

int,预留。

返回值说明

返回值

说明

handle

int,输出的handle的指针地址。

ret

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