Skip to content

Instantly share code, notes, and snippets.

@random-forests
Created March 5, 2019 23:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save random-forests/65e3a140c824e4f4d7a11f01e7fbce47 to your computer and use it in GitHub Desktop.
Save random-forests/65e3a140c824e4f4d7a11f01e7fbce47 to your computer and use it in GitHub Desktop.
# See https://github.com/tensorflow/docs/blob/master/site/en/r2/guide/autograph.ipynb
@tf.function
def train(model, optimizer):
train_ds = mnist_dataset()
step = 0
loss = 0
accuracy = 0
for x, y in train_ds:
# as above, including the "if" and "print()"
return step
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment