code: def testEmpty(self):
      for dtype in [
          dtypes.float32,
          dtypes.float64,
          dtypes.int32,
          dtypes.int64,
          dtypes.bool,
          dtypes.uint8,
          dtypes.bfloat16,
      ]:
          with test_util.use_gpu():
              test_shapes = [
                  (),
                  (1,),
                  (2, 3),
                  (0, 2),
                  (2, 3, 5),
                  (2, 0, 5),
              ]
              for shape in test_shapes:
                  val = self.evaluate(inplace_ops.empty(shape, dtype))
                  self.assertEqual(val.shape, shape)
                  self.assertEqual(val.dtype, dtype.as_numpy_dtype)
                  val = self.evaluate(
                      inplace_ops.empty(shape, dtype, init=True)
                  )
                  self.assertEqual(val.shape, shape)
                  self.assertEqual(val.dtype, dtype.as_numpy_dtype)
                  self.assertAllEqual(
                      val, np.zeros(shape, dtype.as_numpy_dtype)
                  )
                  val = self.evaluate(
                      inplace_ops.empty_like(
                          array_ops.zeros(shape, dtype)
                      )
                  )
                  self.assertEqual(val.shape, shape)
                  self.assertEqual(val.dtype, dtype.as_numpy_dtype)
                  val = self.evaluate(
                      inplace_ops.empty_like(
                          array_ops.zeros(shape, dtype), init=True
                      )
                  )
                  self.assertEqual(val.shape, shape)
                  self.assertEqual(val.dtype, dtype.as_numpy_dtype)
                  self.assertAllEqual(
                      val, np.zeros(shape, dtype.as_numpy_dtype)
                  )
  
      with test_util.use_gpu():
          val = self.evaluate(
              inplace_ops.empty((1, 2), dtypes.string, init=True)
          )
          self.assertEqual(val.tolist(), [[b"", b""]])
  
          val = self.evaluate(
              inplace_ops.empty((1, 2), dtypes.string, init=False)
          )
          self.assertEqual(val.tolist(), [[b"", b""]])
  
file_path: tensorflow/tensorflow/python/kernel_tests/array_ops/inplace_ops_test.py
imports: import numpy
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import inplace_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 9 for calling the InplaceOpsTest obj's underlying member method code with example usage: obj.testEmpty() without return types