The Architecture of utensor_cgen
utensor_cgenconsists of multiple components, such as frontend component and backend component- Each component consists of multiple parts. For example, a backend may be composed of a graph lower part and a code generator part
- Most of the compoents found in the graph above is customizable. The user can register their own component to
utensor_cgen
Examples
backend_registration.ipynb: example notebook for backend registration, this allows you to inject customized backend to theutensor-clifrontend_registration.ipynb: example notebook for frontend parser registration, this allows you to inject customized frontend parser to theutensor-clitransformer_registration.ipynb: example notebook for transformer registration, this allows you to inject customized transformer into the transformation pipeline inutensor-cli
Load Plugin
- with
utensor-cli- You can use
--pluginflag to load the plugins - It's a multiple flag. So you can pass multiple values to the cli
- ex:
utensor-cli --plugin plugin1 --plugin plugin2 [convert|generate-config|...] - both
plugin1andplugin2will be loaded - Note that
--pluginmust be passed before any subcommand such asconvert
- ex:
- You can use
- with script
- simply import your plugins and it should work
import plugin1, plugin2 import utensor_cgen # do stuffs with utensor_cgen and your plugins