Skip to content

Instantly share code, notes, and snippets.

@gcr
Created November 13, 2015 15:28
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 gcr/1dbe25941d54bf7801df to your computer and use it in GitHub Desktop.
Save gcr/1dbe25941d54bf7801df to your computer and use it in GitHub Desktop.
th> x = torch.randn(3,3)
[0.0001s]
th> x
-0.9764 1.3443 0.4054
1.7598 1.9367 -0.6121
-0.1593 -0.0788 -0.2321
[torch.DoubleTensor of size 3x3]
[0.0002s]
th> x:mean(1)
0.2080 1.0674 -0.1463
[torch.DoubleTensor of size 1x3]
[0.0002s]
th> x
-0.9764 1.3443 0.4054
1.7598 1.9367 -0.6121
-0.1593 -0.0788 -0.2321
[torch.DoubleTensor of size 3x3]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment