text_plain_output_1.png
import tensorflow as tf

gpus = tf.config.list_physical_devices('GPU')
print(gpus)
if len(gpus) == 1:
    strategy = tf.distribute.OneDeviceStrategy(device='/gpu:0')
else:
    strategy = tf.distribute.MirroredStrategy()