pub struct TensorInputs<Q: FloatLine, K: FloatLine, V: FloatLine, M: NumericLine> {
pub query: Tensor<Vector<Q::T, Q::N>>,
pub key: Tensor<Vector<K::T, K::N>>,
pub value: Tensor<Vector<V::T, V::N>>,
pub mask: ComptimeOption<Tensor<Vector<M::T, M::N>>>,
}Expand description
Input representation for TensorArgs implementing AttentionArgs.
Fields§
§query: Tensor<Vector<Q::T, Q::N>>§key: Tensor<Vector<K::T, K::N>>§value: Tensor<Vector<V::T, V::N>>§mask: ComptimeOption<Tensor<Vector<M::T, M::N>>>Trait Implementations§
Source§impl<Q: FloatLine, K: FloatLine, V: FloatLine, M: NumericLine> ConcreteInputsFactory for TensorInputs<Q, K, V, M>
impl<Q: FloatLine, K: FloatLine, V: FloatLine, M: NumericLine> ConcreteInputsFactory for TensorInputs<Q, K, V, M>
fn create<R: Runtime>( query: TensorBinding<R>, key: TensorBinding<R>, value: TensorBinding<R>, mask: Option<TensorBinding<R>>, _selection: &AttentionBlueprint, _problem: &AttentionProblem, ) -> Self::RuntimeArg<R>
Source§impl<Q: FloatLine, K: FloatLine, V: FloatLine, M: NumericLine> LaunchArg for TensorInputs<Q, K, V, M>
impl<Q: FloatLine, K: FloatLine, V: FloatLine, M: NumericLine> LaunchArg for TensorInputs<Q, K, V, M>
Source§type RuntimeArg<R: LaunchMarker> = TensorInputsLaunch<Q, K, V, M, R>
type RuntimeArg<R: LaunchMarker> = TensorInputsLaunch<Q, K, V, M, R>
The runtime argument for the kernel.
Source§type CompilationArg = TensorInputsCompilationArg<Q, K, V, M>
type CompilationArg = TensorInputsCompilationArg<Q, K, V, M>
Compilation argument.
fn register<R: LaunchMarker>( arg: Self::RuntimeArg<R>, launcher: &mut KernelLauncher<R>, ) -> Self::CompilationArg
Source§fn expand(
arg: &Self::CompilationArg,
builder: &mut KernelBuilder,
) -> <Self as RudaType>::ExpandType
fn expand( arg: &Self::CompilationArg, builder: &mut KernelBuilder, ) -> <Self as RudaType>::ExpandType
Register an input variable during compilation that fill the
KernelBuilder.Source§fn expand_output(
arg: &Self::CompilationArg,
builder: &mut KernelBuilder,
) -> <Self as RudaType>::ExpandType
fn expand_output( arg: &Self::CompilationArg, builder: &mut KernelBuilder, ) -> <Self as RudaType>::ExpandType
Register an output variable during compilation that fill the
KernelBuilder.Source§impl<Q: FloatLine, K: FloatLine, V: FloatLine, M: NumericLine> RudaType for TensorInputs<Q, K, V, M>
impl<Q: FloatLine, K: FloatLine, V: FloatLine, M: NumericLine> RudaType for TensorInputs<Q, K, V, M>
type ExpandType = TensorInputsExpand<Q, K, V, M>
fn __expand_inactive_value(scope: &mut Scope) -> Self::ExpandType
fn __expand_absent_reference( _scope: &mut Scope, _writable: bool, ) -> Self::ExpandType
Auto Trait Implementations§
impl<Q, K, V, M> Freeze for TensorInputs<Q, K, V, M>
impl<Q, K, V, M> RefUnwindSafe for TensorInputs<Q, K, V, M>where
Tensor<Vector<<Q as FloatLine>::T, <Q as FloatLine>::N>>: RefUnwindSafe,
Tensor<Vector<<K as FloatLine>::T, <K as FloatLine>::N>>: RefUnwindSafe,
Tensor<Vector<<V as FloatLine>::T, <V as FloatLine>::N>>: RefUnwindSafe,
ComptimeOption<Tensor<Vector<<M as NumericLine>::T, <M as NumericLine>::N>>>: RefUnwindSafe,
impl<Q, K, V, M> Send for TensorInputs<Q, K, V, M>
impl<Q, K, V, M> Sync for TensorInputs<Q, K, V, M>
impl<Q, K, V, M> Unpin for TensorInputs<Q, K, V, M>
impl<Q, K, V, M> UnsafeUnpin for TensorInputs<Q, K, V, M>where
Tensor<Vector<<Q as FloatLine>::T, <Q as FloatLine>::N>>: UnsafeUnpin,
Tensor<Vector<<K as FloatLine>::T, <K as FloatLine>::N>>: UnsafeUnpin,
Tensor<Vector<<V as FloatLine>::T, <V as FloatLine>::N>>: UnsafeUnpin,
ComptimeOption<Tensor<Vector<<M as NumericLine>::T, <M as NumericLine>::N>>>: UnsafeUnpin,
impl<Q, K, V, M> UnwindSafe for TensorInputs<Q, K, V, M>where
Tensor<Vector<<Q as FloatLine>::T, <Q as FloatLine>::N>>: UnwindSafe,
Tensor<Vector<<K as FloatLine>::T, <K as FloatLine>::N>>: UnwindSafe,
Tensor<Vector<<V as FloatLine>::T, <V as FloatLine>::N>>: UnwindSafe,
ComptimeOption<Tensor<Vector<<M as NumericLine>::T, <M as NumericLine>::N>>>: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ViewLayoutLaunchArg for Twhere
T: LaunchArg,
impl<T> ViewLayoutLaunchArg for Twhere
T: LaunchArg,
Source§type RuntimeArg<R: LaunchMarker> = <T as LaunchArg>::RuntimeArg<R>
type RuntimeArg<R: LaunchMarker> = <T as LaunchArg>::RuntimeArg<R>
The runtime argument for the kernel.
Source§type CompilationArg = <T as LaunchArg>::CompilationArg
type CompilationArg = <T as LaunchArg>::CompilationArg
Compilation argument.
fn register<R, B>(
arg: <T as ViewLayoutLaunchArg>::RuntimeArg<R>,
_buffer: &B,
_ty: Type,
launcher: &mut KernelLauncher<R>,
) -> <T as ViewLayoutLaunchArg>::CompilationArgwhere
R: LaunchMarker,
B: BufferArg,
Source§fn expand(
arg: &<T as ViewLayoutLaunchArg>::CompilationArg,
_ty: Type,
builder: &mut KernelBuilder,
) -> <T as RudaType>::ExpandType
fn expand( arg: &<T as ViewLayoutLaunchArg>::CompilationArg, _ty: Type, builder: &mut KernelBuilder, ) -> <T as RudaType>::ExpandType
Register an input variable during compilation that fill the
KernelBuilder.Source§fn expand_output(
arg: &<T as ViewLayoutLaunchArg>::CompilationArg,
_ty: Type,
builder: &mut KernelBuilder,
) -> <T as RudaType>::ExpandType
fn expand_output( arg: &<T as ViewLayoutLaunchArg>::CompilationArg, _ty: Type, builder: &mut KernelBuilder, ) -> <T as RudaType>::ExpandType
Register an output variable during compilation that fill the
KernelBuilder.