@@ -399,7 +399,7 @@ def _from_keras_tf1(model, opset=None, custom_ops=None, custom_op_handlers=None,
399
399
400
400
def from_keras (model , input_signature = None , opset = None , custom_ops = None , custom_op_handlers = None ,
401
401
custom_rewriter = None , inputs_as_nchw = None , extra_opset = None , shape_override = None ,
402
- target = None , large_model = False , output_path = None ):
402
+ target = None , large_model = False , output_path = None , optimizers = None ):
403
403
"""Returns a ONNX model_proto for a tf.keras model.
404
404
405
405
Args:
@@ -417,6 +417,7 @@ def from_keras(model, input_signature=None, opset=None, custom_ops=None, custom_
417
417
inputs_as_nchw: transpose inputs in list from nchw to nhwc
418
418
large_model: use the ONNX external tensor storage format
419
419
output_path: save model to output_path
420
+ optimizers: list (subset) of tf2onnx optimizers if applying all optimizers is not desired.
420
421
421
422
Returns:
422
423
An ONNX model_proto and an external_tensor_storage dict.
@@ -489,6 +490,7 @@ def wrap_call(*args, training=False, **kwargs):
489
490
opset = opset ,
490
491
custom_ops = custom_ops ,
491
492
custom_op_handlers = custom_op_handlers ,
493
+ optimizers = optimizers ,
492
494
custom_rewriter = custom_rewriter ,
493
495
extra_opset = extra_opset ,
494
496
shape_override = shape_override ,
0 commit comments