Function: register_compile_func

C Prototype

aclError aclopRegisterCompileFunc(const char *opType, aclopCompileFunc func)

Python Function

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

Function Usage

Registers the operator selector in dynamic-shape scenarios, so that the corresponding tiling strategy can be selected based on the shape during operator execution.

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

Input 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

ret: int, error code.

Restrictions

None

Reference

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