summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/devices.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/python/devices.py b/python/devices.py
new file mode 100644
index 0000000..a24be23
--- /dev/null
+++ b/python/devices.py
@@ -0,0 +1,8 @@
+#!python
+
+from tensorflow.python.client import device_lib
+import json
+
+device_ids = [device.name for device in device_lib.list_local_devices()]
+
+print json.dumps(device_ids)