pub struct LayaGraph {
pub tok_embeddings: W,
pub embed_norm: W,
pub layers: Vec<EncoderLayer>,
pub final_norm: W,
pub type_emb: W,
pub head: Vec<HeadLayer>,
pub scorer_norm: Affine,
pub scorer_in: Affine,
pub scorer_out: Affine,
pub act_in: Affine,
pub act_out: Affine,
pub temperature: W,
}Expand description
The whole compat graph with every weight bound.
Fields§
§tok_embeddings: W[vocab, d].
embed_norm: W[d].
layers: Vec<EncoderLayer>Encoder layers in order.
final_norm: W[d].
type_emb: W[3, d], one row per question type.
head: Vec<HeadLayer>Decision head layers in order.
scorer_norm: AffineLayerNorm, scorer.0.
scorer_in: Affinescorer.1, [d, d].
scorer_out: Affinescorer.3, [1, d].
act_in: Affineact_head.0, [256, d + 4].
act_out: Affineact_head.2, [2, 256].
temperature: W[3], the calibrated temperatures stored in the checkpoint.
Implementations§
Source§impl LayaGraph
impl LayaGraph
Sourcepub fn bind(spec: &LayaSpec, tensors: &Tensors) -> Result<Self, Error>
pub fn bind(spec: &LayaSpec, tensors: &Tensors) -> Result<Self, Error>
Binds every weight of the graph to tensors, checking names, shapes and dtypes.
§Errors
Error::Mismatch listing every missing tensor, extra tensor, wrong shape and non float
dtype, in that order.
§Panics
Never. Binding looks up only names the check above has found.
Trait Implementations§
impl StructuralPartialEq for LayaGraph
Auto Trait Implementations§
impl Freeze for LayaGraph
impl RefUnwindSafe for LayaGraph
impl Send for LayaGraph
impl Sync for LayaGraph
impl Unpin for LayaGraph
impl UnsafeUnpin for LayaGraph
impl UnwindSafe for LayaGraph
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more