flytekitplugins.onnxtensorflow.TensorFlow2ONNXConfig#
- class flytekitplugins.onnxtensorflow.TensorFlow2ONNXConfig(input_signature, custom_ops=None, target=None, custom_op_handlers=None, custom_rewriter=None, opset=None, extra_opset=None, shape_override=None, inputs_as_nchw=None, large_model=False)#
TensorFlow2ONNXConfig is the config used during the tensorflow to ONNX conversion.
- Parameters:
input_signature (TensorSpec | ndarray) – The shape/dtype of the inputs to the model.
custom_ops (Dict[str, Any] | None) – If a model contains ops not recognized by ONNX runtime, you can tag these ops with a custom op domain so that the runtime can still open the model.
target (List[Any] | None) – List of workarounds applied to help certain platforms.
custom_op_handlers (Dict[Any, Tuple] | None) – A dictionary of custom op handlers.
custom_rewriter (List[Any] | None) – A list of custom graph rewriters.
opset (int | None) – The ONNX opset number.
extra_opset (List[int] | None) – The extra ONNX opset numbers to be used by, say, custom ops.
shape_override (Dict[str, List[Any]] | None) – Dict with inputs that override the shapes given by tensorflow.
inputs_as_nchw (List[str] | None) – Transpose inputs in list from nhwc to nchw.
large_model (bool) – Whether to use the ONNX external tensor storage format.
Methods
- classmethod from_dict(kvs, *, infer_missing=False)#
- classmethod from_json(s, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw)#
- classmethod schema(*, infer_missing=False, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)#
- to_json(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, indent=None, separators=None, default=None, sort_keys=False, **kw)#
Attributes
- dataclass_json_config = None
- large_model: bool = False
- input_signature: TensorSpec | ndarray