class_docstr: Test cases for einsum op.
class_docstr_tok: ["Test","cases","for","einsum","op","."]
docstr: Verifies that unary 'op' produces 'expected' when fed input 'inp'.
docstr_tok: ["Verifies","that","unary","'op","'","produces","'expected","'","when","fed","input","'inp","'","."]
code: def _testUnary(self, op, inp, expected):
      """Verifies that unary 'op' produces 'expected' when fed input 'inp'."""
      with self.session() as session:
          with self.test_scope():
              pinp = array_ops.placeholder(
                  dtypes.as_dtype(inp.dtype), inp.shape, name="a"
              )
              output = op(pinp)
          result = session.run(output, {pinp: inp})
          self.assertEqual(output.dtype, expected.dtype)
          self.assertAllCloseAccordingToType(
              expected, result, rtol=1e-3, atol=1e-5, bfloat16_rtol=0.03
          )
  
file_path: tensorflow/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 1 for calling the EinsumOpTest obj's underlying member method code with example usage: obj._testUnary(op, inp, expected) without return types