TensorFlow 2.0 RC is available Learn more

tf.contrib.eager.num_gpus

View source on GitHub

Get the number of available GPU devices.

tf.contrib.eager.num_gpus()

Returns:

The number of available GPU devices.