You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In some cases it might be desirable to use the converter from a python script.
105
-
106
103
# Testing
107
104
There are 2 types of tests.
108
105
@@ -173,10 +170,39 @@ with tf.Session() as sess:
173
170
with open("/tmp/model.onnx", "wb") as f:
174
171
f.write(model_proto.SerializeToString())
175
172
```
176
-
## Using custom ops from python
173
+
## Creating custom op mappings from python
177
174
For complex custom ops that require graph rewrites or input / attribute rewrites using the python interface to insert a custom op will be the eaiest way to accomplish the task.
178
175
A dictionary of name->custom_op_handler can be passed to tf2onnx.tfonnx.process_tf_graph. If the op name is found in the graph the handler will have access to all internal structures and can rewrite that is needed. For example [examples/custom_op_via_python.py]():
0 commit comments