Importing Python Modules
Import the Python modules provided by the Ascend AI software stack. The sample code is provided as follows.
import te.lang.cce from te import tvm from topi import generic
In the preceding information:
- te.lang.cce: introduces the SDL APIs supported by TE, including common ones such as vmuls, vadds, and matmul.
For details about the interface definition, see the Python functions in the /site-packages/te-0.4.0.egg/te/lang/cce/ directory in the DDK installation path. For details about how to use the Python functions, see the TE API Reference.
- te.tvm: introduces the code generation mechanism of the TVM.
For details about the interface definition, see the Python functions in the /site-packages/te-0.4.0.egg/te/tvm directory in the DDK installation path. For details about how to use the Python functions, visit https://docs.tvm.ai/.
- topi.generic: provides the API for automatic operator scheduling.
For details about the interface definition, see the Python functions in the /site-packages/topi-0.4.0.egg/topi/generic directory in the DDK installation path. For details about how to use the Python functions, see the TE API Reference.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot