Function: register_compile_func

Applicable Products

  • Ascend 950PR&950DT products: Not 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

Registers an operator selector for a dynamic-shape operator. The selection of the tiling policy depends on the operator's input shape.

An operator can register with only one operator selector. To change the operator selector, call acl.op.unregister_compile_func to unregister and then call acl.op.register_compile_func to register again.

Prototype

  • C Prototype

    aclError aclopRegisterCompileFunc(const char *opType, aclopCompileFunc func)
    
  • Python Function

    ret = acl.op.register_compile_func(op_type, func)
    

Parameters

Parameter Description
op_type Str, operator type.
func Python function object, callback function of the operator selector.
Function definition: def call_back_func(num_inputs, input_desc, num_outputs, output_desc, op_attr, aclop_kernel_desc): pass

Return Values

Return Value Description
ret Int, error code: 0 on success; else, failure.

Reference

For details about the API calling process and examples, see Single-Operator Calling.