@@ -72,26 +72,22 @@ Overall Architecture
7272
7373::
7474
75- ============ +-----------------+ ===================
76- || model file || --> | frontend Parser | --> || uTensorGraph (IR) ||
77- ============ +-----------------+ ===================
78- |
79- +-------------------------------+ |
80- | graph transformer | |
81- | (legalization & optimization) | <------/
82- +-------------------------------+
83- |
84- v
85- ===========================
86- || uTensorGraph ||
87- || (legalized and optimized) ||
88- ===========================
89- |
90- +--------------------------+ |
91- | backend (code generator) | <----/
75+ ============ +-----------------+ ============================
76+ || model file || --> | frontend Parser | --> || uTensorGraph (IR, generic) ||
77+ ============ +-----------------+ ============================
78+ |
79+ v
80+ +---------------------+
81+ ======================= | graph transformer |
82+ || uTensorGraph || <-- | (optimization) |
83+ || (generic, optimized) || +---------------------+
84+ =======================
85+ |
86+ +--------------------------+ |
87+ | backend (code generator) | <--/
9288 +--------------------------+
9389 |
94- `---> (target files, ex: model.cpp, model.hpp, weights.idx)
90+ `---> (target files, ex: model.cpp, model.hpp, weights.idx, ...etc )
9591
9692Basic Usage
9793===========
@@ -114,7 +110,8 @@ Convert Model File to C/C++ Code
114110.. code-block :: console
115111
116112 $ utensor-cli convert <model.pb> \
117- --output-nodes=<node_name>[,<node_name>,...]
113+ --output-nodes=<node name>[,<node name>,...] \
114+ [--config=config.toml]
118115
119116 Convert given pb file into cpp/hpp files.
120117
@@ -123,6 +120,8 @@ nodes you want to output, seperated by comma for multiple values.
123120
124121In graph theory terminology, they are ``leaf `` nodes of your graph.
125122
123+ Use ``--config `` to pass a configuration file to the cli, you can use ``generate-config `` command to generate one (see below).
124+
126125example
127126~~~~~~~
128127
@@ -132,8 +131,34 @@ example
132131
133132 Run ``utensor-cli convert --help `` for detailed information.
134133
135- :mod: `utensor_cgen ` as Library
136- ==============================
134+ Configuration
135+ -------------
136+
137+ ``utensor-cli `` use ``toml `` as configuration format.
138+
139+ You can generate configuration file of given target as following:
140+
141+ .. code-block :: console
142+
143+ $ utensor-cli generate-config --target <target name> [-o filename.toml]
144+
145+ This command will generate a ``toml `` file listing all configurable values with its defaults.
146+
147+ You can modify the value and pass the file to cli with ``--config `` flag.
148+
149+ example
150+ ~~~~~~~
151+
152+ .. code-block :: console
153+
154+ # generate config file
155+ $ utensor-cli generate-config --target utensor -o myconfig.toml
156+
157+ # after editting myconfig.toml
158+ $ utensor-cli convert mymodel.pb --config=myconfig.toml --output-nodes=output,...
159+
160+ Use :mod: `utensor_cgen ` as Library
161+ ==================================
137162
138163.. subgraph-match-begine
139164
@@ -223,8 +248,8 @@ TensorFlow_
223248
2242491. Freeze your `tensorflow.Graph `
225250
226- - please refer to the ` official doc <https://www. tensorflow.org/guide/extend/model_files >`_
227- and read the ` Freezing <https://www. tensorflow.org/guide/extend/model_files#freezing >`_ section
251+ - please refer to this ` issue track <https://github.com/ tensorflow/tensorflow/issues/27614 >`_ for detail
252+ - especially this ` comment <https://github.com/ tensorflow/tensorflow/issues/27614#issuecomment-571889676 >`_ by Robin2091
228253
2292542. Follow instructions in :ref: `install ` section to install :mod: `utensor_cgen `
230255
0 commit comments