class_docstr: Test cases for unary operators.
class_docstr_tok: ["Test","cases","for","unary","operators","."]
code: def testShape(self):
      shape_op = lambda x: array_ops.shape_internal(x, optimize=False)
      for dtype in self.numeric_types:
          self._assertOpOutputMatchesExpected(
              shape_op, dtype(7), expected=np.array([], dtype=np.int32)
          )
          self._assertOpOutputMatchesExpected(
              shape_op,
              np.array([[], []], dtype=dtype),
              expected=np.array([2, 0], dtype=np.int32),
          )
          self._assertOpOutputMatchesExpected(
              shape_op,
              np.array([-1, 1], dtype=dtype),
              expected=np.array([2], dtype=np.int32),
          )
          self._assertOpOutputMatchesExpected(
              shape_op,
              np.array([[-1, 1]], dtype=dtype),
              expected=np.array([1, 2], dtype=np.int32),
          )
          self._assertOpOutputMatchesExpected(
              shape_op,
              np.array([[-1], [1], [4]], dtype=dtype),
              expected=np.array([3, 1], dtype=np.int32),
          )
  
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 26 for calling the UnaryOpsTest obj's underlying member method code with example usage: obj.testShape() without return types