Function: create_handle

Applicability

Product

Supported (√/x)

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas training products

Atlas inference products

Atlas 200I/500 A2 inference products

Function Usage

Creates a handle to an operator.

To destroy a handle, call acl.op.destroy_handle.

Prototype

  • C Prototype
    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 Function
    1
    handle, ret = acl.op.create_handle(op_type, input_desc, output_desc, op_attr)
    

Parameter Description

Parameter

Description

op_type

Str, operator type name.

input_desc

Int list, description of the operator input tensor.

output_desc

Int list, description of the operator output tensor.

op_attr

Int, pointer address of an operator attribute. This object is created by calling acl.op.create_attr.

Return Value Description

Return Value

Description

handle

Int, operator handle address object.

ret

Int, error code.

Restrictions

If an operator has a constant input but acl.set_tensor_const has not been called to set the constant input, call acl.set_tensor_place_ment to set the placement attribute of TensorDesc and set mem_type to the host memory.