Skip to main content

TensorKey

Struct TensorKey 

Source
pub struct TensorKey<Q: FloatLine, K: FloatLine, V: FloatLine, M: NumericLine, O: FloatLine, GA: AttentionArgs> { /* private fields */ }

Implementations§

Source§

impl<Q: FloatLine, K: FloatLine, V: FloatLine, M: NumericLine, O: FloatLine, MA: AttentionArgs> TensorKey<Q, K, V, M, O, MA>

Source

pub fn new(state: &MA::State<Q, K, V, M, O>) -> TensorKey<Q, K, V, M, O, MA>

Create a tensor input from the state and the ident.

Source

pub fn read_window(&self, start: usize, end: usize) -> Slice<Vector<K::T, K::N>> ⓘ

Source

pub fn read(&self, coordinate: usize) -> Vector<K::T, K::N>

Read the tensor at the given coordinate.

Source

pub fn shape(&self, axis: usize) -> usize

Get the shape of the tensor at the given axis.

Source

pub fn stride(&self, axis: usize) -> usize

Get the stride of the tensor at the given axis.

Source

pub fn rank(&self) -> usize

Get the rank of the tensor.

Source

pub fn len(&self) -> usize

Get the length of the tensor.

Source

pub fn buffer_len(&self) -> usize

Get the buffer length of the tensor.

Source

pub fn as_tensor_map(&self) -> ComptimeOption<TensorMap<K::T, Tiled>>

Get the buffer length of the tensor.

Source

pub fn vector_size(&self) -> VectorSize

Get the vector size of the tensor.

Source

pub fn __expand_new( scope: &mut Scope, state: <MA::State<Q, K, V, M, O> as RudaType>::ExpandType, ) -> <TensorKey<Q, K, V, M, O, MA> as RudaType>::ExpandType

Source

pub fn __expand_read_window( scope: &mut Scope, this: <Self as RudaType>::ExpandType, start: <usize as RudaType>::ExpandType, end: <usize as RudaType>::ExpandType, ) -> <Slice<Vector<K::T, K::N>> as RudaType>::ExpandType ⓘ

Source

pub fn __expand_read( scope: &mut Scope, this: <Self as RudaType>::ExpandType, coordinate: <usize as RudaType>::ExpandType, ) -> <Vector<K::T, K::N> as RudaType>::ExpandType

Source

pub fn __expand_shape( scope: &mut Scope, this: <Self as RudaType>::ExpandType, axis: <usize as RudaType>::ExpandType, ) -> <usize as RudaType>::ExpandType

Source

pub fn __expand_stride( scope: &mut Scope, this: <Self as RudaType>::ExpandType, axis: <usize as RudaType>::ExpandType, ) -> <usize as RudaType>::ExpandType

Source

pub fn __expand_rank( scope: &mut Scope, this: <Self as RudaType>::ExpandType, ) -> <usize as RudaType>::ExpandType

Source

pub fn __expand_len( scope: &mut Scope, this: <Self as RudaType>::ExpandType, ) -> <usize as RudaType>::ExpandType

Source

pub fn __expand_buffer_len( scope: &mut Scope, this: <Self as RudaType>::ExpandType, ) -> <usize as RudaType>::ExpandType

Source

pub fn __expand_as_tensor_map( scope: &mut Scope, this: <Self as RudaType>::ExpandType, ) -> <ComptimeOption<TensorMap<K::T, Tiled>> as RudaType>::ExpandType

Source

pub fn __expand_vector_size( scope: &mut Scope, this: <Self as RudaType>::ExpandType, ) -> VectorSize

Trait Implementations§

Source§

impl<Q: FloatLine, K: FloatLine, V: FloatLine, M: NumericLine, O: FloatLine, GA: AttentionArgs> Clone for TensorKey<Q, K, V, M, O, GA>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Q: FloatLine, K: FloatLine, V: FloatLine, M: NumericLine, O: FloatLine, GA: AttentionArgs> Copy for TensorKey<Q, K, V, M, O, GA>

Source§

impl<Q: FloatLine, K: FloatLine, V: FloatLine, M: NumericLine, O: FloatLine, GA: AttentionArgs> RudaType for TensorKey<Q, K, V, M, O, GA>

Source§

type ExpandType = TensorKeyExpand<Q, K, V, M, O, GA>

Source§

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

Source§

fn __expand_absent_reference( _scope: &mut Scope, _writable: bool, ) -> Self::ExpandType

Source§

impl<Q: FloatLine, K: FloatLine, V: FloatLine, M: NumericLine, O: FloatLine, MA: AttentionArgs> Vectorized for TensorKey<Q, K, V, M, O, MA>

Source§

fn vector_size(&self) -> usize

Source§

fn __expand_vector_size(_scope: &mut Scope, this: Self::ExpandType) -> usize

Source§

impl<Q: FloatLine, K: FloatLine, V: FloatLine, M: NumericLine, O: FloatLine, MA: AttentionArgs> VirtualTensorOperations<<K as FloatLine>::T, <K as FloatLine>::N> for TensorKey<Q, K, V, M, O, MA>

Source§

fn as_tensor_map(&self) -> ComptimeOption<TensorMap<E, Tiled>>

Source§

fn read(&self, _index: usize) -> Vector<E, N>

Read the tensor at the given index.
Source§

fn read_window(&self, _start: usize, _end: usize) -> Slice<Vector<E, N>> ⓘ

Source§

fn write(&self, _index: usize, _value: Vector<E, N>)

Write the tensor at the given index.
Source§

fn shape(&self, _axis: usize) -> usize

Get the shape of the tensor at the given axis.
Source§

fn stride(&self, _axis: usize) -> usize

Get the stride of the tensor at the given axis.
Source§

fn rank(&self) -> usize

Get the rank of the tensor.
Source§

fn len(&self) -> usize

Source§

fn buffer_len(&self) -> usize

Source§

fn __expand_as_tensor_map( scope: &mut Scope, this: Self::ExpandType, ) -> <ComptimeOption<TensorMap<E, Tiled>> as RudaType>::ExpandType

Source§

fn __expand_read( scope: &mut Scope, this: Self::ExpandType, _index: <usize as RudaType>::ExpandType, ) -> <Vector<E, N> as RudaType>::ExpandType

Source§

fn __expand_read_window( scope: &mut Scope, this: Self::ExpandType, _start: <usize as RudaType>::ExpandType, _end: <usize as RudaType>::ExpandType, ) -> <Slice<Vector<E, N>> as RudaType>::ExpandType ⓘ

Source§

fn __expand_write( scope: &mut Scope, this: Self::ExpandType, _index: <usize as RudaType>::ExpandType, _value: <Vector<E, N> as RudaType>::ExpandType, ) -> <() as RudaType>::ExpandType

Source§

fn __expand_shape( scope: &mut Scope, this: Self::ExpandType, _axis: <usize as RudaType>::ExpandType, ) -> <usize as RudaType>::ExpandType

Source§

fn __expand_stride( scope: &mut Scope, this: Self::ExpandType, _axis: <usize as RudaType>::ExpandType, ) -> <usize as RudaType>::ExpandType

Source§

fn __expand_rank( scope: &mut Scope, this: Self::ExpandType, ) -> <usize as RudaType>::ExpandType

Source§

fn __expand_len( scope: &mut Scope, this: Self::ExpandType, ) -> <usize as RudaType>::ExpandType

Source§

fn __expand_buffer_len( scope: &mut Scope, this: Self::ExpandType, ) -> <usize as RudaType>::ExpandType

Auto Trait Implementations§

§

impl<Q, K, V, M, O, GA> !Send for TensorKey<Q, K, V, M, O, GA>

§

impl<Q, K, V, M, O, GA> !Sync for TensorKey<Q, K, V, M, O, GA>

§

impl<Q, K, V, M, O, GA> Freeze for TensorKey<Q, K, V, M, O, GA>
where *const <GA as AttentionArgs>::State<Q, K, V, M, O>: Freeze,

§

impl<Q, K, V, M, O, GA> RefUnwindSafe for TensorKey<Q, K, V, M, O, GA>
where *const <GA as AttentionArgs>::State<Q, K, V, M, O>: RefUnwindSafe,

§

impl<Q, K, V, M, O, GA> Unpin for TensorKey<Q, K, V, M, O, GA>
where *const <GA as AttentionArgs>::State<Q, K, V, M, O>: Unpin,

§

impl<Q, K, V, M, O, GA> UnsafeUnpin for TensorKey<Q, K, V, M, O, GA>
where *const <GA as AttentionArgs>::State<Q, K, V, M, O>: UnsafeUnpin,

§

impl<Q, K, V, M, O, GA> UnwindSafe for TensorKey<Q, K, V, M, O, GA>
where *const <GA as AttentionArgs>::State<Q, K, V, M, O>: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> IntoComptime for T

Source§

fn comptime(self) -> Self

Source§

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.