Function: create_handle

Applicable Products

  • Ascend 950PR&950DT products: Supported
  • Atlas A3 products: Supported
  • Atlas A2 products: Supported
  • Atlas 200I/500 A2 inference products: Supported
  • Atlas inference products: Supported
  • Atlas training products: Supported

Function

Creates a handle to an operator.

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

Prototype

  • C Prototype

    aclError aclopCreateHandle(const char *opType, int numInputs, const aclTensorDesc *const inputDesc[], int numOutputs, const aclTensorDesc *const outputDesc[], const aclopAttr *opAttr, aclopHandle **handle)
    
  • Python Function

    handle, ret = acl.op.create_handle(op_type, input_desc, output_desc, op_attr)
    

Parameters

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 Values

Return Value Description
handle Int, operator handle address object.
ret Int, error code.
0: success
Other values: failure

Constraints

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 memType to the host memory.