Advertisement
Guest User

Untitled

a guest
Jul 25th, 2016
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. from tensorflow.python.client import device_lib
  2.  
  3. def get_available_gpus():
  4. local_device_protos = device_lib.list_local_devices()
  5. return [x.name for x in local_device_protos if x.device_type == 'GPU']
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement