code: def limit_gpu(gpu_id: int, memory_limit: int):
      """limit the selected gpu [gpu_id] by [memory_limit] MB."""
      os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
      os.environ["CUDA_VISIBLE_DEVICES"] = str(gpu_id)
      gpus = tf.config.list_physical_devices("GPU")
  
      if len(gpus) >= gpu_id + 1:
          raise AssertionError
      if gpus:
          # Restrict TensorFlow to only allocate [memory MB] of memory on the first GPU
          try:
              tf.config.experimental.set_virtual_device_configuration(
                  gpus[gpu_id],
                  [
                      tf.config.experimental.VirtualDeviceConfiguration(
                          memory_limit=memory_limit
                      )
                  ],
              )
              logical_gpus = tf.config.list_logical_devices("GPU")
              print(
                  len(gpus),
                  "Physical GPUs,",
                  len(logical_gpus),
                  "Logical GPUs",
              )
          except RuntimeError as e:
              # Virtual devices must be set before GPUs have been initialized
              print(e)
      else:
          print(f"No GPU:{gpu_id} found in your system!")
  
imports: import os
  import tensorflow
label_desc: Use image node_id 3 for calling a global function with example usage: limit_gpu(gpu_id, memory_limit) without return types