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)[source]#
TensorFlow2ONNXConfig is the config used during the tensorflow to ONNX conversion.
- Parameters
input_signature (Union[tensorflow.python.framework.tensor_spec.TensorSpec, numpy.ndarray]) – The shape/dtype of the inputs to the model.
custom_ops (Optional[Dict[str, Any]]) – 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 (Optional[List[Any]]) – List of workarounds applied to help certain platforms.
custom_op_handlers (Optional[Dict[Any, Tuple]]) – A dictionary of custom op handlers.
custom_rewriter (Optional[List[Any]]) – A list of custom graph rewriters.
extra_opset (Optional[List[int]]) – The extra ONNX opset numbers to be used by, say, custom ops.
shape_override (Optional[Dict[str, List[Any]]]) – Dict with inputs that override the shapes given by tensorflow.
inputs_as_nchw (Optional[List[str]]) – Transpose inputs in list from nhwc to nchw.
large_model (bool) – Whether to use the ONNX external tensor storage format.
- Return type
None
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_dict(encode_json=False)#
- to_json(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, indent=None, separators=None, default=None, sort_keys=False, **kw)#
Attributes
- custom_op_handlers: Optional[Dict[Any, Tuple]] = None#
- custom_rewriter: Optional[List[Any]] = None#
- target: Optional[List[Any]] = None#
- input_signature: Union[tensorflow.python.framework.tensor_spec.TensorSpec, numpy.ndarray]#