class opt_einsum.paths.PathOptimizer[source]

Base class for different path optimizers to inherit from.

Subclassed optimizers should define a call method with signature:

def __call__(self, inputs, output, size_dict, memory_limit=None):
    inputs : list[set[str]]
        The indices of each input array.
    outputs : set[str]
        The output indices
    size_dict : dict[str, int]
        The size of each index
    memory_limit : int, optional
        If given, the maximum allowed memory.
    # ... compute path here ...
    return path

where path is a list of int-tuples specifiying a contraction order.


Initialize self. See help(type(self)) for accurate signature.


__call__(inputs, output, size_dict[, …])

Call self as a function.


Implement delattr(self, name).


Default dir() implementation.


Return self==value.


Default object formatter.


Return self>=value.


Return getattr(self, name).


Return self>value.


Return hash(self).


Initialize self.


This method is called when a class is subclassed.


Return self<=value.


Return self<value.


Return self!=value.


Create and return a new object.


Helper for pickle.


Helper for pickle.


Return repr(self).


Implement setattr(self, name, value).


Size of object in memory, in bytes.


Return str(self).


Abstract classes can override this to customize issubclass().






list of weak references to the object (if defined)