pub struct DecodeLayerInputs<'a> {
pub x: &'a Tensor,
pub k_cache: &'a Tensor,
pub v_cache: &'a Tensor,
pub cached_len_sym: SymId,
pub attended_len_sym: SymId,
pub offset: Option<&'a Tensor>,
pub rope_cos: &'a Tensor,
pub rope_sin: &'a Tensor,
pub mask: &'a Tensor,
pub attn_window: Option<usize>,
}Expand description
The per-layer arguments of DecodeBackbone::decode_apply_layer, bundled
so the signature stays readable as families are added.
Fields§
§x: &'a Tensor§k_cache: &'a Tensor§v_cache: &'a Tensor§cached_len_sym: SymId§attended_len_sym: SymId§offset: Option<&'a Tensor>Some on the device-offset (Op::WriteSliceDoff) path, None on the
backend-generic SymEnv path. The layer must honour both — see the
divergence note at the top of this module.
rope_cos: &'a Tensor§rope_sin: &'a Tensor§mask: &'a TensorThis layer’s mask variant, already sliced out of the stacked Const.
attn_window: Option<usize>This layer’s window width, or None if it attends densely — the
same plan entry mask was built from (MaskPlan::window_for_layer).
Carried so a layer offering the CUDA flash-decode arm can state the
truth about its own key range instead of asserting None. The arm’s
flash_decoding kernel does not implement local attention, so a
windowed layer’s offer is declined — which is correct and is the
point. Asserting None there would make the arm attend the whole
prefix and silently drop the window (GAP-194).
Auto Trait Implementations§
impl<'a> Freeze for DecodeLayerInputs<'a>
impl<'a> RefUnwindSafe for DecodeLayerInputs<'a>
impl<'a> Send for DecodeLayerInputs<'a>
impl<'a> Sync for DecodeLayerInputs<'a>
impl<'a> Unpin for DecodeLayerInputs<'a>
impl<'a> UnsafeUnpin for DecodeLayerInputs<'a>
impl<'a> UnwindSafe for DecodeLayerInputs<'a>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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