Function: register_compile_func

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

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
    1
    aclError aclopRegisterCompileFunc(const char *opType, aclopCompileFunc func)
    
  • Python Function
    1
    ret = acl.op.register_compile_func(op_type, func)
    

Parameter Description

Parameter

Description

op_type

Str, operator type.

func

Python function object, callback function of the operator selector. The function definition is as follows:

Callback function format in Python:

def call_back_func(num_inputs, input_desc, num_outputs, output_desc, op_attr, aclop_kernel_desc):
pass

Return Value Description

Return Value

Description

ret

Int, error code: 0 on success; else, failure.

Reference

For details about the API call sequence and example, see Single-Operator Calling.