Skip to content

Instantly share code, notes, and snippets.

@rish-16
Last active August 27, 2019 03:33
Show Gist options
  • Select an option

  • Save rish-16/d95834876246145169367644b2ec799c to your computer and use it in GitHub Desktop.

Select an option

Save rish-16/d95834876246145169367644b2ec799c to your computer and use it in GitHub Desktop.
# Detect hardware
try:
tpu = tf.distribute.cluster_resolver.TPUClusterResolver() # TPU detection
except ValueError: # If TPU not found
tpu = None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment