class_docstr: Test cases for einsum op.
docstr: Verifies that binary 'op' produces 'expected' when fed 'a' and 'b'.
docstr_tok: ["Verifies","that","binary","'op","'","produces","'expected","'","when","fed","'","a","'","and","'","b","'","."]
code: def _testBinary(self, op, a, b, expected):
      """Verifies that binary 'op' produces 'expected' when fed 'a' and 'b'."""
      with self.session() as session:
          with self.test_scope():
              pa = array_ops.placeholder(
                  dtypes.as_dtype(a.dtype), a.shape, name="a"
              )
              pb = array_ops.placeholder(
                  dtypes.as_dtype(b.dtype), b.shape, name="b"
              )
              output = op(pa, pb)
          result = session.run(output, {pa: a, pb: b})
          self.assertAllCloseAccordingToType(
              result, expected, rtol=1e-3
          )
  
file_path: tensorflow-upstream/tensorflow/compiler/tests/einsum_op_test.py
imports: import numpy
  from tensorflow.compiler.tests import xla_test
  from tensorflow.python.framework import dtypes
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import special_math_ops
  from tensorflow.python.platform import googletest
label_desc: Use image node_id 2 for calling the EinsumOpTest obj's underlying member method code with example usage: obj._testBinary(op, a, b, expected) without return types