1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//! Layout abstraction: tensor interpretation metadata.
//!
//! `TensorLayout` is the interpretation half of the tensor split. It
//! carries shape and storage-extent information sufficient to validate
//! a paired [`Storage`](crate::Storage) buffer. Element data lives on
//! the storage; metadata such as memory order, axis labels, and
//! symmetry sector lives here.
use crateStorage;
/// Interpretation metadata for a paired [`Storage`](crate::Storage) buffer.
///
/// A `TensorLayout` describes how to read the flat buffer: the logical
/// shape, and the number of element slots the buffer is expected to
/// hold (see [`storage_extent`](Self::storage_extent)). Concrete
/// implementors carry additional flavor-specific metadata (memory
/// order on `DenseLayout`; block structure, indices, and flux on
/// `BlockSparseLayout`).
/// Compatibility marker between a [`Storage`] and a [`TensorLayout`].
///
/// `St: StorageFor<L>` declares that `St` is a valid storage for
/// layout `L`. The marker has no methods; it serves as the type-level
/// gate enforcing that
/// [`TensorData<St, L>`](crate::TensorData) is only constructed from
/// flavor-matched pairs (`DenseStorage` ⇔ `DenseLayout`,
/// `BlockSparseStorage` ⇔ `BlockSparseLayout`).