code: def testGpuNone(self):
      config.set_soft_device_placement(False)
      gpus = config.list_physical_devices("GPU")
      self.assertGreater(len(gpus), 0)
  
      cpus = config.list_physical_devices("CPU")
      self.assertEqual(len(cpus), 1)
  
      self.assertEqual(len(config.get_visible_devices("CPU")), 1)
      self.assertGreater(len(config.get_visible_devices("GPU")), 0)
  
      self.assertEqual(len(config.get_visible_devices("XLA_GPU")), 0)
  
      config.set_visible_devices(cpus[0])
      self.assertEqual(len(config.get_visible_devices("CPU")), 1)
      self.assertEqual(len(config.get_visible_devices("GPU")), 0)
      self.assertEqual(len(config.list_logical_devices("XLA_GPU")), 0)
  
      with self.assertRaisesRegex(
          errors.InvalidArgumentError, "Could not satisfy"
      ):
          with ops.device("/device:GPU:0"):
              a = array_ops.identity(1.0)
              self.evaluate(a)
  
      # Modifying the visible devices is not supported
      with self.assertRaisesRegex(RuntimeError, "cannot be modified"):
          config.set_visible_devices(gpus)
  
      # Setting the same visible devices is fine
      config.set_visible_devices(cpus[0])
  
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 3 for calling the DeviceTest obj's underlying member method code with example usage: obj.testGpuNone() without return types