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