opt_einsum.contract.ContractExpression¶
-
class
opt_einsum.contract.ContractExpression(contraction, contraction_list, constants_dict, **einsum_kwargs)[source]¶ Helper class for storing an explicit
contraction_listwhich can then be repeatedly called solely with the array arguments.-
__init__(contraction, contraction_list, constants_dict, **einsum_kwargs)[source]¶ Initialize self. See help(type(self)) for accurate signature.
Methods
__init__(contraction, contraction_list, …)Initialize self. evaluate_constants([backend])Convert any constant operands to the correct backend form, and perform as many contractions as possible to create a new list of operands, stored in self._evaluated_constants[backend].-
evaluate_constants(backend='auto')[source]¶ Convert any constant operands to the correct backend form, and perform as many contractions as possible to create a new list of operands, stored in
self._evaluated_constants[backend]. This also makes sureself.contraction_listonly contains the remaining, non-const operations.
-