import tensorflow as tf
assert tf.__version__.startswith('2')
print("Num GPUs Available: ", len(tf.config.list_physical_devices('GPU')))

print("************ TEST 7 **************************")
gpus = tf.config.list_physical_devices('GPU')
if gpus:
  # Create 2 virtual GPUs with 1GB memory each
  try:
    tf.config.set_logical_device_configuration(
        gpus[0],
        [tf.config.LogicalDeviceConfiguration(memory_limit=1024),
         tf.config.LogicalDeviceConfiguration(memory_limit=1024)])
    logical_gpus = tf.config.list_logical_devices('GPU')
    print(len(gpus), "Physical GPU,", len(logical_gpus), "Logical GPUs")
  except RuntimeError as e:
    # Virtual devices must be set before GPUs have been initialized
    print(e)

    
3c5fdf3d5a0624d55f0a84900d7243674773b064
<mask token>

<mask token>
assert tf.__version__.startswith('2')
print('Num GPUs Available: ', len(tf.config.list_physical_devices('GPU')))
print('************ TEST 7 **************************')
<mask token>
if gpus:
    try:
        tf.config.set_logical_device_configuration(gpus[0], [tf.config.
            LogicalDeviceConfiguration(memory_limit=1024), tf.config.
            LogicalDeviceConfiguration(memory_limit=1024)])
        logical_gpus = tf.config.list_logical_devices('GPU')
        print(len(gpus), 'Physical GPU,', len(logical_gpus), 'Logical GPUs')
    except RuntimeError as e:
        print(e)

<mask token>
assert tf.__version__.startswith('2')
print('Num GPUs Available: ', len(tf.config.list_physical_devices('GPU')))
print('************ TEST 7 **************************')
gpus = tf.config.list_physical_devices('GPU')
if gpus:
    try:
        tf.config.set_logical_device_configuration(gpus[0], [tf.config.
            LogicalDeviceConfiguration(memory_limit=1024), tf.config.
            LogicalDeviceConfiguration(memory_limit=1024)])
        logical_gpus = tf.config.list_logical_devices('GPU')
        print(len(gpus), 'Physical GPU,', len(logical_gpus), 'Logical GPUs')
    except RuntimeError as e:
        print(e)

import tensorflow as tf
assert tf.__version__.startswith('2')
print('Num GPUs Available: ', len(tf.config.list_physical_devices('GPU')))
print('************ TEST 7 **************************')
gpus = tf.config.list_physical_devices('GPU')
if gpus:
    try:
        tf.config.set_logical_device_configuration(gpus[0], [tf.config.
            LogicalDeviceConfiguration(memory_limit=1024), tf.config.
            LogicalDeviceConfiguration(memory_limit=1024)])
        logical_gpus = tf.config.list_logical_devices('GPU')
        print(len(gpus), 'Physical GPU,', len(logical_gpus), 'Logical GPUs')
    except RuntimeError as e:
        print(e)

import tensorflow as tf
assert tf.__version__.startswith('2')
print("Num GPUs Available: ", len(tf.config.list_physical_devices('GPU')))

print("************ TEST 7 **************************")
gpus = tf.config.list_physical_devices('GPU')
if gpus:
  # Create 2 virtual GPUs with 1GB memory each
  try:
    tf.config.set_logical_device_configuration(
        gpus[0],
        [tf.config.LogicalDeviceConfiguration(memory_limit=1024),
         tf.config.LogicalDeviceConfiguration(memory_limit=1024)])
    logical_gpus = tf.config.list_logical_devices('GPU')
    print(len(gpus), "Physical GPU,", len(logical_gpus), "Logical GPUs")
  except RuntimeError as e:
    # Virtual devices must be set before GPUs have been initialized
    print(e)

    