code: def testGpuGrowth(self):
      gpus = config.list_physical_devices("GPU")
      self.assertNotEqual(len(gpus), 0)
  
      self.assertIsNone(config.get_memory_growth(gpus[-1]))
      for gpu in gpus:
          config.set_memory_growth(gpu, True)
  
      c = context.context().config
      self.assertTrue(c.gpu_options.allow_growth)
  
      logical_gpus = config.list_logical_devices("GPU")
      self.assertTrue(len(logical_gpus), len(gpus))
  
      # Modifying the GPU configuration is not supported
      with self.assertRaisesRegex(RuntimeError, "cannot be modified"):
          for gpu in gpus:
              config.set_memory_growth(gpu, False)
  
      # Setting the same GPU configuration is fine
      for gpu in gpus:
          config.set_memory_growth(gpu, True)
  
imports: from absl.testing import parameterized
  from tensorflow.core.protobuf import cluster_pb2
  from tensorflow.core.protobuf import config_pb2
  from tensorflow.core.protobuf import rewriter_config_pb2
  from tensorflow.core.protobuf import tensorflow_server_pb2
  from tensorflow.python.eager import context
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import config
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.platform import test
  from tensorflow.python.util import compat
label_desc: Use image node_id 8 for calling the DeviceTest obj's underlying member method code with example usage: obj.testGpuGrowth() without return types