code: def optimize_compare(self, subscripts, operands=None):
      # Tests all paths of the optimization function against
      # conventional einsum
      if operands is None:
          args = [subscripts]
          terms = subscripts.split("->")[0].split(",")
          for term in terms:
              dims = [global_size_dict[x] for x in term]
              args.append(np.random.rand(*dims))
      else:
          args = [subscripts] + operands
  
      noopt = np.einsum(*args, optimize=False)
      opt = np.einsum(*args, optimize="greedy")
      assert_almost_equal(opt, noopt)
      opt = np.einsum(*args, optimize="optimal")
      assert_almost_equal(opt, noopt)
  
imports: import itertools
  import sys
  import platform
  import pytest
  import numpy
  from numpy.testing import assert_, assert_equal, assert_array_equal, assert_almost_equal, assert_raises, suppress_warnings, assert_raises_regex, assert_allclose
label_desc: Use image node_id 33 for calling the TestEinsum obj's underlying member method code with example usage: obj.optimize_compare(subscripts, operands) without return types