函数:create_handle
产品支持情况
产品 |
是否支持 |
---|---|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
函数原型
- C函数原型
1
aclError aclopCreateHandle(const char *opType, int numInputs,int numInputs, const aclTensorDesc *const inputDesc[], int numOutputs, const aclTensorDesc *const outputDesc[], const aclopAttr *opAttr, aclopHandle **handle)
- python函数
1
handle, ret = acl.op.create_handle(op_type, input_desc, output_desc, op_attr)
参数说明
参数名 |
说明 |
---|---|
op_type |
str,指定算子类型名称字符串类型。 |
input_desc |
list,算子输入Tensor的描述,整形列表。 |
output_desc |
list,算子输出Tensor的描述,整形列表。 |
op_attr |
int,算子属性指针地址,此对象使用调用acl.op.create_attr创建。 |
返回值说明
返回值 |
说明 |
---|---|
handle |
int,算子handle地址对象。 |
ret |
int,错误码。
|
约束说明
对于算子有constant输入的场景,如果未调用acl.set_tensor_const接口设置constant输入,则需调用acl.set_tensor_place_ment设置TensorDesc的placement属性,将“mem_type”设置为Host内存。
父主题: aclopHandle