class_docstr: Test cases for unary operators.
class_docstr_tok: ["Test","cases","for","unary","operators","."]
docstr: Verifies that 'op' produces 'expected' when fed input 'inp' .
  
  Args:
    op: operator to test
    inp: numpy input array to use as input to 'op'.
    expected: numpy array representing the expected output of 'op'.
    equality_test: either None, or a function that tests two numpy arrays for
      equality. If None, self.assertAllClose is used.
    rtol: relative tolerance for equality test.
    atol: absolute tolerance for equality test.
docstr_tok: ["Verifies","that","'op","'","produces","'expected","'","when","fed","input","'inp","'",".","Args",":","op",":","operator","to","test","inp",":","numpy","input","array","to","use","as","input","to","'op","'",".","expected",":","numpy","array","representing","the","expected","output","of","'op","'",".","equality_test",":","either","None",",","or","a","function","that","tests","two","numpy","arrays","for","equality",".","If","None",",","self.assertAllClose","is","used",".","rtol",":","relative","tolerance","for","equality","test",".","atol",":","absolute","tolerance","for","equality","test","."]
code: def _assertOpOutputMatchesExpected(
      self, op, inp, expected, equality_test=None, rtol=1e-3, atol=1e-5
  ):
      """Verifies that 'op' produces 'expected' when fed input 'inp' .
  
      Args:
        op: operator to test
        inp: numpy input array to use as input to 'op'.
        expected: numpy array representing the expected output of 'op'.
        equality_test: either None, or a function that tests two numpy arrays for
          equality. If None, self.assertAllClose is used.
        rtol: relative tolerance for equality test.
        atol: absolute tolerance for equality test.
      """
      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})
          if equality_test is None:
              self.assertEqual(output.dtype, expected.dtype)
              self.assertAllCloseAccordingToType(
                  expected,
                  result,
                  rtol=rtol,
                  atol=atol,
                  bfloat16_rtol=0.03,
              )
          else:
              equality_test(result, expected, rtol=rtol, atol=atol)
  
imports: import platform
  import unittest
  import numpy
  import six
  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 array_ops_stack
  from tensorflow.python.ops import bitwise_ops
  from tensorflow.python.ops import gen_functional_ops
  from tensorflow.python.ops import gen_nn_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import nn_ops
  from tensorflow.python.platform import googletest
label_desc: Use image node_id 1 for calling the UnaryOpsTest obj's underlying member method code with example usage: obj._assertOpOutputMatchesExpected(op, inp, expected, equality_test, rtol, atol) without return types