code: def testDtypes(self):
      bfloat16 = dtypes.bfloat16.as_numpy_dtype
  
      def check(dtype):
          r = np.random.RandomState(0)
          equation = "ij,jk->ik"
          input_shapes = [(2, 2), (2, 2)]
          inputs = []
          for shape in input_shapes:
              with self.subTest(dtype=dtype, shape=shape):
                  arr = np.array(r.randn(*shape)).astype(dtype)
                  if dtype == np.complex64 or dtype == np.complex128:
                      arr += 1j * np.array(r.randn(*shape)).astype(
                          dtype
                      )
                  inputs.append(arr)
          input_tensors = [constant_op.constant(x) for x in inputs]
          if dtype == bfloat16:
              # np.einsum doesn't support bfloat16.
              a = np.einsum(
                  equation, *[x.astype(np.float32) for x in inputs]
              ).astype(dtype)
          else:
              a = np.einsum(equation, *inputs)
  
          b = self.evaluate(
              gen_linalg_ops.einsum(input_tensors, equation)
          )
          tol = 1e-2 if dtype == bfloat16 else 1e-4
          self.assertAllClose(a, b, atol=tol, rtol=tol)
  
      for dtype in [
          bfloat16,
          np.float32,
          np.float64,
          np.complex64,
          np.complex128,
          np.int32,
          np.int64,
      ]:
          check(dtype)
  
imports: import numpy
  from tensorflow.python.client import session
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gen_linalg_ops
  from tensorflow.python.ops import gradient_checker_v2
  from tensorflow.python.ops import special_math_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import benchmark
  from tensorflow.python.platform import test
label_desc: Use image node_id 11 for calling the EinsumOpTest obj's underlying member method code with example usage: obj.testDtypes() without return types