Skip to content

Instantly share code, notes, and snippets.

@Atcold
Created September 9, 2015 19:39
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 Atcold/4b8f320c3c4035984363 to your computer and use it in GitHub Desktop.
Save Atcold/4b8f320c3c4035984363 to your computer and use it in GitHub Desktop.
atcold@AlfMAC2 ~/Work/Tests/binary $ th
______ __ | Torch7
/_ __/__ ________/ / | Scientific computing for Lua.
/ / / _ \/ __/ __/ _ \ | Type ? for help
/_/ \___/_/ \__/_//_/ | https://github.com/torch
| http://torch.ch
th> torch.setdefaulttensortype('torch.FloatTensor')
[0.0012s]
th> a = torch.rand(2,3)
[0.0019s]
th> a
0.7478 0.5815 0.5786
0.6519 0.1937 0.6384
[torch.FloatTensor of size 2x3]
[0.0028s]
th> torch.save('tensor-a.t7', a)
[0.0014s]
th> Do you really want to exit ([y]/n)? y
atcold@AlfMAC2 ~/Work/Tests/binary $ ls
storage-a.t7 tensor-a.t7
atcold@AlfMAC2 ~/Work/Tests/binary $ hexdump -C tensor-a.t7
00000000 04 00 00 00 01 00 00 00 03 00 00 00 56 20 31 11 |............V 1.|
00000010 00 00 00 74 6f 72 63 68 2e 46 6c 6f 61 74 54 65 |...torch.FloatTe|
00000020 6e 73 6f 72 02 00 00 00 02 00 00 00 00 00 00 00 |nsor............|
00000030 03 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 |................|
00000040 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 |................|
00000050 04 00 00 00 02 00 00 00 03 00 00 00 56 20 31 12 |............V 1.|
00000060 00 00 00 74 6f 72 63 68 2e 46 6c 6f 61 74 53 74 |...torch.FloatSt|
00000070 6f 72 61 67 65 06 00 00 00 00 00 00 00 5f 71 3f |orage........_q?|
00000080 3f a9 df 14 3f c0 20 14 3f df e5 26 3f a8 5a 46 |?...?. .?..&?.ZF|
00000090 3e ee 6d 23 3f |>.m#?|
00000095
atcold@AlfMAC2 ~/Work/Tests/binary $ hexdump -C storage-a.t7
00000000 04 00 00 00 01 00 00 00 03 00 00 00 56 20 31 12 |............V 1.|
00000010 00 00 00 74 6f 72 63 68 2e 46 6c 6f 61 74 53 74 |...torch.FloatSt|
00000020 6f 72 61 67 65 06 00 00 00 00 00 00 00 5f 71 3f |orage........_q?|
00000030 3f a9 df 14 3f c0 20 14 3f df e5 26 3f a8 5a 46 |?...?. .?..&?.ZF|
00000040 3e ee 6d 23 3f |>.m#?|
00000045
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment