parameters: (equation, shaped_inputs_tuple, optimize)
return_statement: return indices_and_equations
docstring: Returns the (memoized) result of opt_einsum.contract_path.
docstring_summary: Returns the (memoized) result of opt_einsum.contract_path.
docstring_tokens: Returns the ( memoized ) result of opt_einsum . contract_path .
function: def _get_opt_einsum_contract_path(equation, shaped_inputs_tuple, optimize):
    """Returns the (memoized) result of opt_einsum.contract_path."""
    # Note: We use einsum_call=True, which is an internal api for opt_einsum,
    # to get the contraction path without having opt_einsum perform the actual
    # contractions.
    _, contractions = opt_einsum.contract_path(
        equation,
        *shaped_inputs_tuple,
        optimize=optimize,
        einsum_call=True,
        use_blas=True)
    # Return a tuple so that the cached value is not mutable.
    indices_and_equations = tuple([(expr[0], expr[2]) for expr in contractions])
    return indices_and_equations
function_tokens: def _get_opt_einsum_contract_path ( equation , shaped_inputs_tuple , optimize ) : # Note: We use einsum_call=True, which is an internal api for opt_einsum, # to get the contraction path without having opt_einsum perform the actual # contractions. _ , contractions = opt_einsum . contract_path ( equation , * shaped_inputs_tuple , optimize = optimize , einsum_call = True , use_blas = True ) # Return a tuple so that the cached value is not mutable. indices_and_equations = tuple ( [ ( expr [ 0 ] , expr [ 2 ] ) for expr in contractions ] ) return indices_and_equations