Skip to main content

TensorInputs

Struct TensorInputs 

Source
pub struct TensorInputs<Q: Float, K: Float, V: Float, M: Numeric> {
    pub query: Tensor<Line<Q>>,
    pub key: Tensor<Line<K>>,
    pub value: Tensor<Line<V>>,
    pub mask: CubeOption<Tensor<Line<M>>>,
}
Expand description

Input representation for TensorArgs implementing AttentionArgs.

Fields§

§query: Tensor<Line<Q>>§key: Tensor<Line<K>>§value: Tensor<Line<V>>§mask: CubeOption<Tensor<Line<M>>>

Trait Implementations§

Source§

impl<Q: Float, K: Float, V: Float, M: Numeric> ConcreteInputsFactory for TensorInputs<Q, K, V, M>

Source§

fn create<'a, R: Runtime>( query: &'a TensorHandleRef<'a, R>, key: &'a TensorHandleRef<'a, R>, value: &'a TensorHandleRef<'a, R>, mask: &'a Option<TensorHandleRef<'a, R>>, _selection: &AttentionSelection, _problem: &AttentionProblem, line_sizes: &AttentionLineSizes, ) -> Self::RuntimeArg<'a, R>

Source§

impl<Q: Float, K: Float, V: Float, M: Numeric> CubeType for TensorInputs<Q, K, V, M>

Source§

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

Source§

fn into_mut(scope: &mut Scope, expand: Self::ExpandType) -> Self::ExpandType

Wrapper around the init method, necessary to type inference.
Source§

impl<Q: Float, K: Float, V: Float, M: Numeric> LaunchArg for TensorInputs<Q, K, V, M>

Source§

type RuntimeArg<'a, R: Runtime> = TensorInputsLaunch<'a, Q, K, V, M, R>

The runtime argument for the kernel.
Source§

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

Compilation argument.
Source§

fn compilation_arg<'a, R: Runtime>( runtime_arg: &Self::RuntimeArg<'a, R>, ) -> Self::CompilationArg

Source§

fn expand( arg: &Self::CompilationArg, builder: &mut KernelBuilder, ) -> <Self as CubeType>::ExpandType

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

fn expand_output( arg: &Self::CompilationArg, builder: &mut KernelBuilder, ) -> <Self as CubeType>::ExpandType

Register an output variable during compilation that fill the KernelBuilder.

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>

§

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>

§

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<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, 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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V