pub struct VaeAttnRef<'a> {
pub norm: VaeNormRef<'a>,
pub q: (&'a [f32], &'a [f32]),
pub k: (&'a [f32], &'a [f32]),
pub v: (&'a [f32], &'a [f32]),
pub out: (&'a [f32], &'a [f32]),
pub c: usize,
}Expand description
The mid-block single-head spatial attention: GroupNorm, then token-major
q/k/v Linear [c, c] (row-major out×in) + bias, softmax(q·kᵀ/√c)·v,
out Linear + bias, residual add onto the block input.
Fields§
§norm: VaeNormRef<'a>§q: (&'a [f32], &'a [f32])§k: (&'a [f32], &'a [f32])§v: (&'a [f32], &'a [f32])§out: (&'a [f32], &'a [f32])§c: usizeTrait Implementations§
Source§impl<'a> Clone for VaeAttnRef<'a>
impl<'a> Clone for VaeAttnRef<'a>
impl<'a> Copy for VaeAttnRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for VaeAttnRef<'a>
impl<'a> RefUnwindSafe for VaeAttnRef<'a>
impl<'a> Send for VaeAttnRef<'a>
impl<'a> Sync for VaeAttnRef<'a>
impl<'a> Unpin for VaeAttnRef<'a>
impl<'a> UnsafeUnpin for VaeAttnRef<'a>
impl<'a> UnwindSafe for VaeAttnRef<'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
Mutably borrows from an owned value. Read more