Skip to content

Instantly share code, notes, and snippets.

View gridcellcoder's full-sized avatar

GridCell gridcellcoder

View GitHub Profile
@gridcellcoder
gridcellcoder / tpu.py
Last active March 12, 2019 12:11
TPU Cross Shard Optimizer
import tensorflow as tf
import numpy as np
from tensorflow.contrib.tpu.python.tpu import tpu_function
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: