@@ -9,9 +9,31 @@ table TensorMetadata {
99 // The unique id used to connect the data and program.
1010 fully_qualified_name:string;
1111 scalar_type:ScalarType;
12+
13+ // Size of each dimension.
1214 dim_sizes:[int];
15+
16+ // Specifies in what order the dimensions are laid out in memory (from outer
17+ // to inner).
18+ //
19+ // For example, given a rank 3 Tensor of size (3, 5, 2). If we name
20+ // dimensions: [row, column, batch], then a dim_order of:
21+ // - (2, 0, 1) represents a [batch, row, column] ordering where "column" is
22+ // the innermost dimension, then comes "row", and the outermost dimension is
23+ // "batch".
24+ // - (0, 2, 1) represents a [row, batch, column] ordering where "column" is
25+ // the innermost dimension, then comes "batch", and the outermost dimension
26+ // is "row".
1327 dim_order:[ubyte];
1428
29+ // Offset in scalar_type elements (e.g., multiples of 4 bytes for an int
30+ // scalar type) from the beginning of the tensor buffer to the beginning of
31+ // the actual data. Currently, the runtime only supports a value of zero.
32+ storage_offset:int;
33+
34+ // May not be needed.
35+ layout:byte;
36+
1537 // Tensor offsets are relative to each TensorSegment.
1638 // To retrieve a given tensor:
1739 // 1. segment_base_offset: from the file header.
@@ -56,7 +78,6 @@ table Data {
5678
5779 // Data segments.
5880 segments:[DataSegment];
59-
6081}
6182
6283root_type Data;
0 commit comments