Skip to content

Instantly share code, notes, and snippets.

Danijar Hafner danijar

Block or report user

Report or block danijar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jovianlin
jovianlin / get_available_gpus.py
Created Oct 3, 2016
Get List of Devices in TensorFlow
View get_available_gpus.py
from tensorflow.python.client import device_lib
def get_available_gpus():
local_device_protos = device_lib.list_local_devices()
return [x.name for x in local_device_protos if x.device_type == 'GPU']
get_available_gpus()
You can’t perform that action at this time.