Skip to content

Instantly share code, notes, and snippets.

@VoVAllen
Created July 16, 2017 15:44
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 VoVAllen/5531c78a2d3f1ff3df772038bca37a83 to your computer and use it in GitHub Desktop.
Save VoVAllen/5531c78a2d3f1ff3df772038bca37a83 to your computer and use it in GitHub Desktop.
nn.Flatten implementation
class Flatten(nn.Module):
def __init__(self):
super(Flatten, self).__init__()
def forward(self, x):
return x.view(x.size(0), -1)
@Redoblue
Copy link

I had the same idea, but to make sure that my code could by used by everyone and everywhere, I changed the official way back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment