code: def setUp(self):
      super(HardDevicePlacementTest, self).setUp()
      context._reset_context()
      config.set_soft_device_placement(enabled=False)
      context.context().log_device_placement = True
      cpus = context.context().list_physical_devices("CPU")
      # Set 2 virtual CPUs
      context.context().set_logical_device_configuration(
          cpus[0],
          [
              context.LogicalDeviceConfiguration(),
              context.LogicalDeviceConfiguration(),
          ],
      )
      self.assertEqual(config.get_soft_device_placement(), False)
      self.assertEqual(context.context().soft_device_placement, False)
  
imports: from absl.testing import parameterized
  from tensorflow.python.eager import context
  from tensorflow.python.eager import def_function
  from tensorflow.python.eager import remote
  from tensorflow.python.eager import test
  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_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import random_ops
label_desc: Use image node_id 1 for calling the HardDevicePlacementTest obj's underlying member method code with example usage: obj.setUp() without return types