TensorFlow 2.0 Beta is available Learn more

tf.contrib.eager.num_gpus

Get the number of available GPU devices.

tf.contrib.eager.num_gpus()

Defined in python/eager/context.py.

Returns:

The number of available GPU devices.