Created
November 7, 2018 10:05
-
-
Save jzuern/5073f769a0cf263676b404bd1b7d85de to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import pprint | |
import tensorflow as tf | |
if 'COLAB_TPU_ADDR' not in os.environ: | |
print('ERROR: Not connected to a TPU runtime; please see the first cell in this notebook for instructions!') | |
else: | |
tpu_address = 'grpc://' + os.environ['COLAB_TPU_ADDR'] | |
print ('TPU address is', tpu_address) | |
with tf.Session(tpu_address) as session: | |
devices = session.list_devices() | |
print('TPU devices:') | |
pprint.pprint(devices) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment