pub struct GlmVit {
pub out_hidden_size: usize,
/* private fields */
}Fields§
Implementations§
Source§impl GlmVit
impl GlmVit
Sourcepub fn forward_batched(
&self,
images: &[(&[f32], usize, usize)],
gpu: &dyn GpuBackend,
stream: u64,
) -> Result<Vec<(usize, usize, usize)>>
pub fn forward_batched( &self, images: &[(&[f32], usize, usize)], gpu: &dyn GpuBackend, stream: u64, ) -> Result<Vec<(usize, usize, usize)>>
Encode N images. Returns per-image (post_h, post_w, merged_p) in image
order, matching the Qwen encoder’s contract so the prefill splice is
shared.
Images are encoded in greedy chunks whose Σpatches fits p_max; the
merged rows of every chunk land contiguously in buf_out at the global
image order, so a batch that overflows the scratch degrades to more
launches rather than to a wrong answer or an out-of-bounds write.
Source§impl GlmVit
impl GlmVit
pub fn new( patch_embed_w: DevicePtr, patch_embed_b: DevicePtr, blocks: Vec<GlmVitBlock>, merger: GlmVitMerger, geo: &GlmVitGeometry, gpu: &dyn GpuBackend, ) -> Result<Self>
Auto Trait Implementations§
impl !Freeze for GlmVit
impl RefUnwindSafe for GlmVit
impl Send for GlmVit
impl Sync for GlmVit
impl Unpin for GlmVit
impl UnwindSafe for GlmVit
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