Skip to content

Commit c7e4629

Browse files
committed
documentation
Signed-off-by: xavier dupré <[email protected]>
1 parent 03705b6 commit c7e4629

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,9 @@ model_proto, external_tensor_storage = tf2onnx.convert.from_keras(model,
293293
model: the tf.keras model we want to convert
294294
input_signature: a tf.TensorSpec or a numpy array defining the shape/dtype of the input
295295
opset: the opset to be used for the ONNX model, default is the latest
296+
custom_ops: if a model contains ops not recognized by onnx runtime,
297+
you can tag these ops with a custom op domain so that the
298+
runtime can still open the model. Type is a dictionary `{op name: domain}`.
296299
target: list of workarounds applied to help certain platforms
297300
custom_op_handlers: dictionary of custom ops handlers
298301
custom_rewriter: list of custom graph rewriters
@@ -322,6 +325,9 @@ model_proto, external_tensor_storage = tf2onnx.convert.from_function(function,
322325
function: the tf.function we want to convert
323326
input_signature: a tf.TensorSpec or a numpy array defining the shape/dtype of the input
324327
opset: the opset to be used for the ONNX model, default is the latest
328+
custom_ops: if a model contains ops not recognized by onnx runtime,
329+
you can tag these ops with a custom op domain so that the
330+
runtime can still open the model. Type is a dictionary `{op name: domain}`.
325331
target: list of workarounds applied to help certain platforms
326332
custom_op_handlers: dictionary of custom ops handlers
327333
custom_rewriter: list of custom graph rewriters

tf2onnx/convert.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,9 @@ def from_keras(model, input_signature=None, opset=None, custom_ops=None, custom_
332332
model: the tf.keras model we want to convert
333333
input_signature: a tf.TensorSpec or a numpy array defining the shape/dtype of the input
334334
opset: the opset to be used for the ONNX model, default is the latest
335+
custom_ops: if a model contains ops not recognized by onnx runtime,
336+
you can tag these ops with a custom op domain so that the
337+
runtime can still open the model. Type is a dictionary `{op name: domain}`.
335338
target: list of workarounds applied to help certain platforms
336339
custom_op_handlers: dictionary of custom ops handlers
337340
custom_rewriter: list of custom graph rewriters
@@ -417,6 +420,9 @@ def from_function(function, input_signature=None, opset=None, custom_ops=None, c
417420
function: the tf.function we want to convert
418421
input_signature: a tf.TensorSpec or a numpy array defining the shape/dtype of the input
419422
opset: the opset to be used for the ONNX model, default is the latest
423+
custom_ops: if a model contains ops not recognized by onnx runtime,
424+
you can tag these ops with a custom op domain so that the
425+
runtime can still open the model. Type is a dictionary `{op name: domain}`.
420426
target: list of workarounds applied to help certain platforms
421427
custom_op_handlers: dictionary of custom ops handlers
422428
custom_rewriter: list of custom graph rewriters
@@ -478,6 +484,9 @@ def from_graph_def(graph_def, name=None, input_names=None, output_names=None, op
478484
output_names: list of output names
479485
name: A name for the graph
480486
opset: the opset to be used for the ONNX model, default is the latest
487+
custom_ops: if a model contains ops not recognized by onnx runtime,
488+
you can tag these ops with a custom op domain so that the
489+
runtime can still open the model. Type is a dictionary `{op name: domain}`.
481490
target: list of workarounds applied to help certain platforms
482491
custom_op_handlers: dictionary of custom ops handlers
483492
custom_rewriter: list of custom graph rewriters

0 commit comments

Comments
 (0)