pub struct EmbedOverlay {
pub rows: CudaSlice<f32>,
pub spans: Vec<(usize, usize, usize)>,
}Expand description
Mixed-embedding prime overlay: image embeddings that replace <|image_pad|> token
embeddings at prompt-relative positions during prime_cache_overlaid. rows holds all
images’ merger outputs concatenated ([total_rows, n_embd]); each span is
(prompt_pos, row_off, n_rows) — rows [row_off, row_off+n_rows) land at prompt
positions [prompt_pos, prompt_pos+n_rows). Spans must not overlap.
Fields§
§rows: CudaSlice<f32>§spans: Vec<(usize, usize, usize)>Implementations§
Source§impl EmbedOverlay
impl EmbedOverlay
Sourcepub fn window(&self, off: usize, len: usize) -> Option<EmbedOverlay>
pub fn window(&self, off: usize, len: usize) -> Option<EmbedOverlay>
Sub-window for a prime call covering prompt-relative [off, off+len): spans clipped
and rebased so the callee sees call-relative positions (the serve prefill tick primes
a prompt across multiple prime_cache_overlaid calls). rows is an Arc clone, not a
copy. None = no image rows in this window (caller may prime plain).
Auto Trait Implementations§
impl Freeze for EmbedOverlay
impl RefUnwindSafe for EmbedOverlay
impl Send for EmbedOverlay
impl Sync for EmbedOverlay
impl Unpin for EmbedOverlay
impl UnsafeUnpin for EmbedOverlay
impl UnwindSafe for EmbedOverlay
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