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>
impl<Q: Float, K: Float, V: Float, M: Numeric> ConcreteInputsFactory for TensorInputs<Q, K, V, M>
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>
impl<Q: Float, K: Float, V: Float, M: Numeric> CubeType for TensorInputs<Q, K, V, M>
type ExpandType = TensorInputsExpand<Q, K, V, M>
Source§fn into_mut(scope: &mut Scope, expand: Self::ExpandType) -> Self::ExpandType
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>
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>
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>
type CompilationArg = TensorInputsCompilationArg<Q, K, V, M>
Compilation argument.
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
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
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>where
Tensor<Line<Q>>: RefUnwindSafe,
Tensor<Line<K>>: RefUnwindSafe,
Tensor<Line<V>>: RefUnwindSafe,
CubeOption<Tensor<Line<M>>>: 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<Line<Q>>: UnsafeUnpin,
Tensor<Line<K>>: UnsafeUnpin,
Tensor<Line<V>>: UnsafeUnpin,
CubeOption<Tensor<Line<M>>>: UnsafeUnpin,
impl<Q, K, V, M> UnwindSafe for TensorInputs<Q, K, V, M>where
Tensor<Line<Q>>: UnwindSafe,
Tensor<Line<K>>: UnwindSafe,
Tensor<Line<V>>: UnwindSafe,
CubeOption<Tensor<Line<M>>>: 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