pub struct PromptEncoderOutput {
pub sparse_embeddings: Vec<f32>,
pub num_sparse_tokens: usize,
pub dense_embeddings: Vec<f32>,
pub image_pe: Vec<f32>,
}Expand description
Output of [PromptEncoder::forward] — fed straight into the mask
decoder. All host-side Vec<f32>.
Fields§
§sparse_embeddings: Vec<f32>[num_tokens, embed_dim] — concatenation of point and box
embeddings. num_tokens = 0 for the “no prompt” case.
num_sparse_tokens: usize§dense_embeddings: Vec<f32>[embed_dim, hw, hw] — dense pixel-wise embedding. Either the
mask-downscaled signal or the broadcast no_mask_embed.
image_pe: Vec<f32>[embed_dim, hw, hw] — image positional encoding (the dense PE
fed into the mask decoder).
Auto Trait Implementations§
impl Freeze for PromptEncoderOutput
impl RefUnwindSafe for PromptEncoderOutput
impl Send for PromptEncoderOutput
impl Sync for PromptEncoderOutput
impl Unpin for PromptEncoderOutput
impl UnsafeUnpin for PromptEncoderOutput
impl UnwindSafe for PromptEncoderOutput
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
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