code: def _execute_contract_path(contract_path, tensors):
      """Carry out sequence of contractions in order specified by opt_einsum."""
  
      for positions, _, formula, _, _ in contract_path:
          args = [tensors.pop(x) for x in positions]
  
          if len(args) == 1:
              new_tensor = _unary_logeinsumexp(formula, *args)
          elif len(args) == 2:
              new_tensor = _binary_einslogsumexp(formula, *args)
          else:
              raise ValueError(
                  "`_execute_contract_path` can't execute n-ary"
                  "contraction for n > 1"
              )
  
          tensors.append(new_tensor)
  
      return tensors[0]
  
file_path: probability/tensorflow_probability/python/experimental/marginalize/logeinsumexp.py
imports: import opt_einsum
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import prefer_static
label_desc: Use image node_id 1 for calling a global function with example usage: _execute_contract_path(contract_path, tensors) and returns: tensors