pub struct Embedding {
pub wte_chunks: Vec<Tensor>,
pub chunk_rows: usize,
pub wpe: Tensor,
}Expand description
Token + positional embedding table. The token table is stored row-chunked so no single GPU binding exceeds the device limit (see roadmap pitfalls); on CPU it is a single chunk.
Fields§
§wte_chunks: Vec<Tensor>Row chunks of the [vocab, n_embd] token table.
chunk_rows: usizeRows per chunk (the last chunk may be smaller).
wpe: Tensor[n_ctx, n_embd]
Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Embedding
impl !UnwindSafe for Embedding
impl Freeze for Embedding
impl Send for Embedding
impl Sync for Embedding
impl Unpin for Embedding
impl UnsafeUnpin for Embedding
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more