Function: register_compile_func

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product / Atlas A3 inference product

Atlas A2 training product / Atlas A2 inference product

Atlas training product

Atlas inference product

Atlas 200I/500 A2 inference product

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)
    

Parameters

Parameter

Description

op_type

Str, operator type.

func

Python function object, callback function of the operator selector.

Callback function format in Python:

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

Returns

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 Execution.