About

We are going to check if a GPU device is made available to TensorFlow.

Code

import tensorflow as tf

if tf.test.gpu_device_name():
    print('Default GPU Device: {}'.format(tf.test.gpu_device_name()))
    
else:
    print('Please install GPU version of TF')
Default GPU Device: /device:GPU:0