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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// SPDX-License-Identifier: MIT OR Apache-2.0
//! Per-expert raw weight bundle.
//!
//! Each expert has up to three projections (`gate`, `up`, `down`),
//! stored as opaque byte buffers plus shape/dtype metadata. The parser
//! never assembles a functional neural layer — callers receive raw
//! bytes and are responsible for any downstream compute.
use crateDType;
/// Owned raw tensor buffer: bytes + shape + dtype, no references into
/// the source [`GgufLayout`](crate::gguf::GgufLayout).
///
/// This is an *analysis result type*, not a tensor abstraction:
/// expert extraction may slice a stacked GGUF tensor, so the result
/// holds expert-local `dims` plus owned `bytes`. It does not replace
/// [`TensorInfo`](crate::checkpoint::TensorInfo) /
/// [`Checkpoint::tensor_bytes`](crate::checkpoint::Checkpoint::tensor_bytes),
/// which remain the core checkpoint contract. Its `dtype`/`ggml_type`
/// fields make this extraction path GGUF-specific; any normalized
/// cross-format expert tensor type is planned v0.4 work.
/// Raw weights for a single MoE expert.
///
/// Fields are `Option<_>` because GGUF checkpoints differ on which
/// expert projections they store. OLMoE exposes `gate / up / down`;
/// other MoE families may omit or rename a subset.