-
-
Save hristian-carabulea/6c8cd4047113f1805d01af6de6f5c984 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