code: def solve_sum_einsum(parsed_vectors, vars):
      """
      Apply reduce_sum for axes before binary einsum calculation if enable.
  
      e.g.:
      input : "abce,acd->ae"
      returns : "ace,ac->ae"
  
      In this example, since each of those axes is only used by one var and does not appear in the output,
      axes `b` and `d` can be reduced before binary einsum.
      """
  
      def solve_sum_einsum_one_step(src_axes, used_by_other_axes, x):
          dst_axes = []
          for axis in src_axes:
              if axis not in used_by_other_axes:
                  continue
              dst_axes.append(axis)
          summed_axis_indices = [
              i
              for i in range(len(src_axes))
              if src_axes[i] not in dst_axes
          ]
          if summed_axis_indices:
              x = mb.reduce_sum(x=x, axes=summed_axis_indices)
          return dst_axes, x
  
      ret_parsed_vectors = []
      parsed_vectors = list(parsed_vectors)
      for i, var in enumerate(vars):
          used_by_other_axes = []
          for j, parsed_vector in enumerate(parsed_vectors):
              if i != j:
                  used_by_other_axes += parsed_vector
          dst_axes, var = solve_sum_einsum_one_step(
              parsed_vectors[i], used_by_other_axes, vars[i]
          )
          ret_parsed_vectors.append(dst_axes)
          vars[i] = var
      ret_parsed_vectors.append(parsed_vectors[-1])
      return ret_parsed_vectors, vars
  
file_path: coremltools/coremltools/converters/mil/frontend/_utils.py
imports: import itertools
  from typing import List, Optional
  from coremltools.converters.mil.input_types import InputType
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil import Var, types
  from coremltools.converters.mil.mil.ops.defs._utils import parse_einsum_equation
  from coremltools.converters.mil.mil.types.symbolic import any_symbolic, is_symbolic
label_desc: Use image node_id 7 for calling a global function with example usage: solve_sum_einsum(parsed_vectors, vars) and returns: ret_parsed_vectors,  vars, dst_axes,  x