.. _f-einsumimplclasses: module ``testing.einsum.einsum_impl_classes`` ============================================= .. inheritance-diagram:: mlprodict.testing.einsum.einsum_impl_classes Short summary +++++++++++++ module ``mlprodict.testing.einsum.einsum_impl_classes`` Classes representing the sequence of matrix operations to implement einsum computation. :githublink:`%|py|7` Classes +++++++ +-------------------------------------------------------------------------------------------+------------------------------------------------------------------+ | class | truncated documentation | +===========================================================================================+==================================================================+ | :class:`EinsumSubOp ` | Defines a sub operation used in Einsum decomposition. | +-------------------------------------------------------------------------------------------+------------------------------------------------------------------+ | :class:`GraphEinsumSubOp ` | Class gathering all nodes produced to explicit einsum operators. | +-------------------------------------------------------------------------------------------+------------------------------------------------------------------+ Functions +++++++++ +--------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+ | function | truncated documentation | +================================================================================+======================================================================================================================+ | :func:`single_axes ` | *axes* contains positive values, then it is the position of this axis in the original matrix, otherwise it is -1 ... | +--------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+ Methods +++++++ +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | method | truncated documentation | +===========================================================================================================================================+==============================================================================================================+ | :py:meth:`__init__ ` | | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :py:meth:`__init__ ` | | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :py:meth:`__iter__ ` | Iterates on nodes. | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :py:meth:`__repr__ ` | | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :py:meth:`_apply_batch_dot ` | | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :py:meth:`_apply_diagonal ` | | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :py:meth:`_apply_expand_dims ` | | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :py:meth:`_apply_id ` | | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :py:meth:`_apply_matmul ` | | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :py:meth:`_apply_mul ` | | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :py:meth:`_apply_reduce_sum ` | | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :py:meth:`_apply_reduce_sum_mm ` | | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :py:meth:`_apply_squeeze ` | | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :py:meth:`_apply_transpose ` | | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :py:meth:`_apply_transpose_mm ` | | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :py:meth:`_check_ ` | | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :py:meth:`_check_arg_ ` | | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :py:meth:`_check_inputs_ ` | | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :py:meth:`_check_onnx_opset_ ` | | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :py:meth:`_check_row_ ` | Checks input or output is valid. | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :py:meth:`_check_shape_ ` | | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :py:meth:`_compute_output_row_batch_dot ` | | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :py:meth:`_compute_output_row_diagonal ` | | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :py:meth:`_compute_output_row_expand_dims ` | | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :py:meth:`_compute_output_row_id ` | | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :py:meth:`_compute_output_row_matmul ` | | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :py:meth:`_compute_output_row_mul ` | | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :py:meth:`_compute_output_row_reduce_sum ` | | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :py:meth:`_compute_output_row_reduce_sum_mm ` | | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :py:meth:`_compute_output_row_squeeze ` | | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :py:meth:`_compute_output_row_transpose ` | | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :py:meth:`_compute_output_row_transpose_mm ` | | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :py:meth:`_get_data ` | | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :py:meth:`_get_forward_nodes ` | Returns the forward nodes. | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :py:meth:`_onnx_name ` | | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :py:meth:`_pprint_forward ` | | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :py:meth:`_replace_node_sequence ` | Removes a sequence of nodes. The method does not check that the graph remains consistent. | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :py:meth:`_to_onnx_batch_dot ` | | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :py:meth:`_to_onnx_expand_dims ` | | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :py:meth:`_to_onnx_id ` | | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :py:meth:`_to_onnx_mul ` | | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :py:meth:`_to_onnx_reduce_sum ` | | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :py:meth:`_to_onnx_squeeze ` | | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :py:meth:`_to_onnx_transpose ` | | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :meth:`add_info ` | Adds information to the node. | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :meth:`append ` | Adds one input or result. | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :meth:`apply ` | Applies one operator on the data. | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :meth:`apply_sequence ` | Applies a sequence of operations on a list of inputs. | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :meth:`clean_unused_nodes ` | Cleans nodes with unused outputs. | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :meth:`compute_output_row ` | Updates *row* based on the operator. | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :meth:`dot_label ` | Displays some informations useful to understand the operator. | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :meth:`get_dot_kind ` | Every matrix multiplication can be either: | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :meth:`mark ` | Marks one input or result as an intermediate result after a full einsum step. | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :meth:`mark_last_node ` | Marks the last node as the final output. | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :meth:`remove_duplicate_transpose ` | Removes consecutive transpose by merging them. | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :meth:`simplify_mm_nodes ` | Node name suffixed by `mm` are an artifact to keep the graph consistent while building it. They can now ... | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :meth:`to_dot ` | Produces a graph in :epkg:`dot`. | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :meth:`to_onnx ` | Converts this node into ONNX. Enumerates all ONNX node which participate to the conversion. The last one ... | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ | :meth:`to_onnx ` | Converts the graph into ONNX. | +-------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ Documentation +++++++++++++ .. automodule:: mlprodict.testing.einsum.einsum_impl_classes :members: :special-members: __init__ :show-inheritance: