class_docstr: Test cases for unary operators.
class_docstr_tok: ["Test","cases","for","unary","operators","."]
code: def testNumericOps(self):
      for dtype in self.numeric_types - {np.int8, np.uint8}:
          self._assertOpOutputMatchesExpected(
              math_ops.abs,
              np.array([[2, -1]], dtype=dtype),
              expected=np.array(
                  [[2, 1]], dtype=np.real(dtype(0)).dtype
              ),
          )
  
          self._assertOpOutputMatchesExpected(
              math_ops.negative,
              np.array([[-1, 1]], dtype=dtype),
              expected=np.array([[1, -1]], dtype=dtype),
          )
  
          self._assertOpOutputMatchesExpected(
              math_ops.square,
              np.array([[-2, 3]], dtype=dtype),
              expected=np.array([[4, 9]], dtype=dtype),
          )
  
          self._assertOpOutputMatchesExpected(
              array_ops.zeros_like,
              np.array([[4, 3], [2, 1]], dtype=dtype),
              expected=np.array([[0, 0], [0, 0]], dtype=dtype),
          )
  
          self._assertOpOutputMatchesExpected(
              array_ops.ones_like,
              np.array([[4, 3], [2, 1]], dtype=dtype),
              expected=np.array([[1, 1], [1, 1]], dtype=dtype),
          )
  
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 14 for calling the UnaryOpsTest obj's underlying member method code with example usage: obj.testNumericOps() without return types