.. _f-xopvariable: module ``npy.xop_variable`` =========================== .. inheritance-diagram:: mlprodict.npy.xop_variable Short summary +++++++++++++ module ``mlprodict.npy.xop_variable`` Xop API to build onnx graphs. Inspired from :epkg:`sklearn-onnx`. Classes +++++++ +-------------------------------------------------------------------------------------+-----------------------------------------------------------------------------+ | class | truncated documentation | +=====================================================================================+=============================================================================+ | :class:`DetectedVariable ` | Wrapper around a :class:`Variable` to detect inputs and outputs of a graph. | +-------------------------------------------------------------------------------------+-----------------------------------------------------------------------------+ | :class:`ExistingVariable ` | Temporary name. | +-------------------------------------------------------------------------------------+-----------------------------------------------------------------------------+ | :class:`InputDetectedVariable ` | Instance of :class:`DetectedVariable`. Only for inputs. | +-------------------------------------------------------------------------------------+-----------------------------------------------------------------------------+ | :class:`NodeResultName ` | Defines a result name for a node. | +-------------------------------------------------------------------------------------+-----------------------------------------------------------------------------+ | :class:`OutputDetectedVariable ` | Instance of :class:`DetectedVariable`. Only for outputs. | +-------------------------------------------------------------------------------------+-----------------------------------------------------------------------------+ | :class:`Variable ` | An input or output to an ONNX graph. | +-------------------------------------------------------------------------------------+-----------------------------------------------------------------------------+ Functions +++++++++ +--------------------------------------------------------------------------------+----------------------------------------------------------+ | function | truncated documentation | +================================================================================+==========================================================+ | :func:`guess_numpy_type ` | Guesses the corresponding numpy type based on data_type. | +--------------------------------------------------------------------------------+----------------------------------------------------------+ | :func:`is_numpy_dtype ` | Tells if a dtype is a numpy dtype. | +--------------------------------------------------------------------------------+----------------------------------------------------------+ | :func:`max_supported_opset ` | Returns the latest supported opset for the main domain. | +--------------------------------------------------------------------------------+----------------------------------------------------------+ | :func:`numpy_type_prototype ` | Converts a numpy dtyp into a TensorProto dtype. | +--------------------------------------------------------------------------------+----------------------------------------------------------+ Properties ++++++++++ +-----------------------------------------------------------------------------------+------------------------------------------------------------------+ | property | truncated documentation | +===================================================================================+==================================================================+ | :meth:`added_dtype ` | Unknown type, returns None. | +-----------------------------------------------------------------------------------+------------------------------------------------------------------+ | :meth:`added_dtype ` | Returns `self.added_dtype_`. | +-----------------------------------------------------------------------------------+------------------------------------------------------------------+ | :meth:`dtype ` | Unknown type, returns None. | +-----------------------------------------------------------------------------------+------------------------------------------------------------------+ | :meth:`dtype ` | Returns `self.dtype_`. | +-----------------------------------------------------------------------------------+------------------------------------------------------------------+ | :meth:`name ` | Returns variable name. | +-----------------------------------------------------------------------------------+------------------------------------------------------------------+ | :meth:`name ` | Returns variable name. | +-----------------------------------------------------------------------------------+------------------------------------------------------------------+ | :meth:`name ` | Returns variable name. | +-----------------------------------------------------------------------------------+------------------------------------------------------------------+ | :meth:`name ` | Returns the variable name (`self.name_`). | +-----------------------------------------------------------------------------------+------------------------------------------------------------------+ | :meth:`proto_added_shape ` | Returns the shape for `self.added_shape_` or `self.shape`. | +-----------------------------------------------------------------------------------+------------------------------------------------------------------+ | :meth:`proto_added_type ` | Returns the proto type for `self.added_dtype_` or `self.dtype_`. | +-----------------------------------------------------------------------------------+------------------------------------------------------------------+ | :meth:`proto_type ` | Returns the proto type for `self.dtype_`. | +-----------------------------------------------------------------------------------+------------------------------------------------------------------+ | :meth:`shape ` | Returns `self.shape_`. | +-----------------------------------------------------------------------------------+------------------------------------------------------------------+ Static Methods ++++++++++++++ +---------------------------------------------------------------------------------------+---------------------------------------------------------------------------------+ | staticmethod | truncated documentation | +=======================================================================================+=================================================================================+ | :meth:`from_pb ` | Creates a Variable from a protobuf object. | +---------------------------------------------------------------------------------------+---------------------------------------------------------------------------------+ | :meth:`from_skl2onnx ` | Converts variable from :epkg:`sklearn-onnx` into this class. | +---------------------------------------------------------------------------------------+---------------------------------------------------------------------------------+ | :meth:`from_skl2onnx_tuple ` | Converts variable from :epkg:`sklearn-onnx` into this class defined as a tuple. | +---------------------------------------------------------------------------------------+---------------------------------------------------------------------------------+ Methods +++++++ +----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+ | method | truncated documentation | +==================================================================================+==================================================================================+ | :py:meth:`__eq__ ` | Compares every attributes. | +----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+ | :py:meth:`__init__ ` | | +----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+ | :py:meth:`__init__ ` | | +----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+ | :py:meth:`__init__ ` | | +----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+ | :py:meth:`__init__ ` | | +----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+ | :py:meth:`__init__ ` | | +----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+ | :py:meth:`__init__ ` | | +----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+ | :py:meth:`__repr__ ` | usual | +----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+ | :py:meth:`__repr__ ` | usual | +----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+ | :py:meth:`__repr__ ` | usual | +----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+ | :py:meth:`__repr__ ` | Usual | +----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+ | :py:meth:`__repr__ ` | usual | +----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+ | :py:meth:`__repr__ ` | usual | +----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+ | :meth:`copy_add ` | Returns a copy of this variable with a new dtype. | +----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+ | :meth:`copy_merge ` | Merges information from both Variable. | +----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+ | :meth:`copy_name ` | Returns a copy with a new name. | +----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+ | :meth:`get_name ` | Returns a name from output_names or a suggestion for a name. | +----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+ | :meth:`is_named ` | Tells the variable is named like that. | +----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+ | :meth:`make_value_info ` | Converts the variable into `onnx.ValueInfoProto`. | +----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+ | :meth:`to_skl2onnx ` | Converts this instance into an instance of *Variable* from :epkg:`sklearn-onnx`. | +----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+ Documentation +++++++++++++ .. automodule:: mlprodict.npy.xop_variable :members: :special-members: __init__ :show-inheritance: