code: def test_xla_einsum(self):
      num_loop = 10
      x_series = random_ops.random_uniform([num_loop, 9, 9])
      y_series = random_ops.random_uniform([num_loop, 9, 1])
  
      def loop_fn(i):
          x = array_ops.gather(x_series, 0)  # invariant.
          y = array_ops.gather(y_series, 0)  # invariant.
          x_i = array_ops.gather(x_series, i)
          y_i = array_ops.gather(y_series, i)
          z1 = xla_ops.einsum(x_i, y, "ab,bc->ac")
          z2 = xla_ops.einsum(x, y_i, "ab,bc->ac")
          z3 = xla_ops.einsum(x, y, "ab,bc->ac")
          z4 = xla_ops.einsum(x_i, y_i, "ab,bc->ac")
          z5 = xla_ops.einsum(
              y_i, x_i, "cd,ce->de"
          )  # Includes transpose.
          outputs = [z1, z2, z3, z4, z5]
          return outputs
  
      self._test_loop_fn(loop_fn, num_loop)
  
imports: from tensorflow.compiler.tf2xla.python import xla
  from tensorflow.python.compiler.xla import jit
  from tensorflow.python.compiler.xla import xla
  from tensorflow.python.eager import context
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import control_flow_v2_toggles
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import random_ops
  from tensorflow.python.ops import resource_variable_ops
  from tensorflow.python.ops import while_loop
  from tensorflow.python.ops.parallel_for import control_flow_ops
  from tensorflow.python.ops.parallel_for.test_util import PForTestCase
  from tensorflow.python.platform import test
label_desc: Use image node_id 2 for calling the PForTest obj's underlying member method code with example usage: obj.test_xla_einsum() and returns: outputs