Skip to content

Instantly share code, notes, and snippets.

@rish-16
Created May 29, 2021 05:54
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 rish-16/6999153722072adb7f7577842762f8ef to your computer and use it in GitHub Desktop.
Save rish-16/6999153722072adb7f7577842762f8ef to your computer and use it in GitHub Desktop.
A guide on Colab TPU training using PyTorch XLA (Part 3)
class MyCustomNet(nn.Module):
def __init__(self, myparams):
super().__init__()
# define layers
...
def forward(self, x):
'''
Pass your inputs through your layers as you normally would.
No change here.
'''
return layers(x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment