Operator Call Flow
In static-shape scenarios, the single-operator call flow in AscendCL is as follows.
Figure 1 Single-operator call flowchart with static shape


The major steps are described as follows:
- Implement the operator and generate the following deliverables:
- Operator implementation file (.py)
- Operator prototype definition
- Operator information library definition
- Operator plugin
- Build a single-operator model file with a specified shape using Ascend Tensor Compiler (ATC).
- Call AscendCL APIs to load and execute the model file in the user application.
In dynamic-shape scenarios, the single-operator call flow is as follows.
Figure 2 Single-operator call flowchart with dynamic shape


The major steps are described as follows:
- Implement the operator.
Among the operator deliverables, only the operator implementation file (.py) is needed.
Different tiling policies can be developed for different shape ranges. Therefore, multiple operator implementation files (for example, op0.py, op1.py and op2.py) need to be generated.
- Build the operator implementation file into a binary file (.o).
- Define an operator selector to select from the tiling policies based on the actual shape used for operator execution.
- Call AscendCL APIs to execute the operator binary file based on the selected tiling policy in the user application.
Parent topic: Overview