comparison filetensor.py @ 72:2b6656b2ef52

Changed docs slightly
author Joseph Turian <turian@iro.umontreal.ca>
date Fri, 02 May 2008 18:36:47 -0400
parents 2508c373cf29
children 82ba488b2c24
comparison
equal deleted inserted replaced
71:5b699b31770a 72:2b6656b2ef52
1 """ 1 """
2 Read and write the matrix file format described at 2 Read and write the matrix file format described at
3 http://www.cs.nyu.edu/~ylclab/data/norb-v1.0/index.html 3 U{http://www.cs.nyu.edu/~ylclab/data/norb-v1.0/index.html}
4 4
5 The format is for dense tensors: 5 The format is for dense tensors:
6 6
7 magic number indicating type and endianness - 4bytes 7 - magic number indicating type and endianness - 4bytes
8 rank of tensor - int32 8 - rank of tensor - int32
9 dimensions - int32, int32, int32, ... 9 - dimensions - int32, int32, int32, ...
10 <data> 10 - <data>
11 11
12 The number of dimensions and rank is slightly tricky: 12 The number of dimensions and rank is slightly tricky:
13 for scalar: rank=0, dimensions = [1, 1, 1] 13 - for scalar: rank=0, dimensions = [1, 1, 1]
14 for vector: rank=1, dimensions = [?, 1, 1] 14 - for vector: rank=1, dimensions = [?, 1, 1]
15 for matrix: rank=2, dimensions = [?, ?, 1] 15 - for matrix: rank=2, dimensions = [?, ?, 1]
16 16
17 For rank >= 3, the number of dimensions matches the rank exactly. 17 For rank >= 3, the number of dimensions matches the rank exactly.
18 18
19 """ 19 """
20 import sys 20 import sys