Skip to main content

TensorInputs

Struct TensorInputs 

Source
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>

Source§

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>
where Tensor<Vector<Q::T, Q::N>>: LaunchArg, Tensor<Vector<K::T, K::N>>: LaunchArg, Tensor<Vector<V::T, V::N>>: LaunchArg, ComptimeOption<Tensor<Vector<M::T, M::N>>>: LaunchArg,

Source§

type RuntimeArg<R: LaunchMarker> = TensorInputsLaunch<Q, K, V, M, R>

The runtime argument for the kernel.
Source§

type CompilationArg = TensorInputsCompilationArg<Q, K, V, M>

Compilation argument.
Source§

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

Register an input variable during compilation that fill the KernelBuilder.
Source§

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>

Source§

type ExpandType = TensorInputsExpand<Q, K, V, M>

Source§

fn __expand_inactive_value(scope: &mut Scope) -> Self::ExpandType

Source§

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>
where Tensor<Vector<<Q as FloatLine>::T, <Q as FloatLine>::N>>: Freeze, Tensor<Vector<<K as FloatLine>::T, <K as FloatLine>::N>>: Freeze, Tensor<Vector<<V as FloatLine>::T, <V as FloatLine>::N>>: Freeze, ComptimeOption<Tensor<Vector<<M as NumericLine>::T, <M as NumericLine>::N>>>: Freeze,

§

impl<Q, K, V, M> RefUnwindSafe for TensorInputs<Q, K, V, M>

§

impl<Q, K, V, M> Send for TensorInputs<Q, K, V, M>
where Tensor<Vector<<Q as FloatLine>::T, <Q as FloatLine>::N>>: Send, Tensor<Vector<<K as FloatLine>::T, <K as FloatLine>::N>>: Send, Tensor<Vector<<V as FloatLine>::T, <V as FloatLine>::N>>: Send, ComptimeOption<Tensor<Vector<<M as NumericLine>::T, <M as NumericLine>::N>>>: Send,

§

impl<Q, K, V, M> Sync for TensorInputs<Q, K, V, M>
where Tensor<Vector<<Q as FloatLine>::T, <Q as FloatLine>::N>>: Sync, Tensor<Vector<<K as FloatLine>::T, <K as FloatLine>::N>>: Sync, Tensor<Vector<<V as FloatLine>::T, <V as FloatLine>::N>>: Sync, ComptimeOption<Tensor<Vector<<M as NumericLine>::T, <M as NumericLine>::N>>>: Sync,

§

impl<Q, K, V, M> Unpin for TensorInputs<Q, K, V, M>
where Tensor<Vector<<Q as FloatLine>::T, <Q as FloatLine>::N>>: Unpin, Tensor<Vector<<K as FloatLine>::T, <K as FloatLine>::N>>: Unpin, Tensor<Vector<<V as FloatLine>::T, <V as FloatLine>::N>>: Unpin, ComptimeOption<Tensor<Vector<<M as NumericLine>::T, <M as NumericLine>::N>>>: Unpin,

§

impl<Q, K, V, M> UnsafeUnpin for TensorInputs<Q, K, V, M>

§

impl<Q, K, V, M> UnwindSafe for TensorInputs<Q, K, V, M>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoComptime for T

Source§

fn comptime(self) -> Self

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ViewLayoutLaunchArg for T
where T: LaunchArg,

Source§

type RuntimeArg<R: LaunchMarker> = <T as LaunchArg>::RuntimeArg<R>

The runtime argument for the kernel.
Source§

type CompilationArg = <T as LaunchArg>::CompilationArg

Compilation argument.
Source§

fn register<R, B>( arg: <T as ViewLayoutLaunchArg>::RuntimeArg<R>, _buffer: &B, _ty: Type, launcher: &mut KernelLauncher<R>, ) -> <T as ViewLayoutLaunchArg>::CompilationArg
where R: LaunchMarker, B: BufferArg,

Source§

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

Register an output variable during compilation that fill the KernelBuilder.