pub struct TensorQuery<Q: FloatLine, K: FloatLine, V: FloatLine, M: NumericLine, O: FloatLine, GA: AttentionArgs> { /* private fields */ }Expand description
Tensor input representation.
You can use the tensor input as if it was a pointer to the actually tensor.
Implementations§
Source§impl<Q: FloatLine, K: FloatLine, V: FloatLine, M: NumericLine, O: FloatLine, MA: AttentionArgs> TensorQuery<Q, K, V, M, O, MA>
impl<Q: FloatLine, K: FloatLine, V: FloatLine, M: NumericLine, O: FloatLine, MA: AttentionArgs> TensorQuery<Q, K, V, M, O, MA>
Sourcepub fn new(state: &MA::State<Q, K, V, M, O>) -> TensorQuery<Q, K, V, M, O, MA>
pub fn new(state: &MA::State<Q, K, V, M, O>) -> TensorQuery<Q, K, V, M, O, MA>
Create a tensor input from the state and the ident.
pub fn read_window(&self, start: usize, end: usize) -> Slice<Vector<Q::T, Q::N>> ⓘ
Sourcepub fn read(&self, coordinate: usize) -> Vector<Q::T, Q::N>
pub fn read(&self, coordinate: usize) -> Vector<Q::T, Q::N>
Read the tensor at the given coordinate.
Sourcepub fn buffer_len(&self) -> usize
pub fn buffer_len(&self) -> usize
Get the buffer length of the tensor.
Sourcepub fn as_tensor_map(&self) -> ComptimeOption<TensorMap<Q::T, Tiled>>
pub fn as_tensor_map(&self) -> ComptimeOption<TensorMap<Q::T, Tiled>>
Get the buffer length of the tensor.
Sourcepub fn vector_size(&self) -> VectorSize
pub fn vector_size(&self) -> VectorSize
Get the vector size of the tensor.
pub fn __expand_new( scope: &mut Scope, state: <MA::State<Q, K, V, M, O> as RudaType>::ExpandType, ) -> <TensorQuery<Q, K, V, M, O, MA> as RudaType>::ExpandType
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<Q::T, Q::N>> as RudaType>::ExpandType ⓘ
pub fn __expand_read( scope: &mut Scope, this: <Self as RudaType>::ExpandType, coordinate: <usize as RudaType>::ExpandType, ) -> <Vector<Q::T, Q::N> as RudaType>::ExpandType
pub fn __expand_shape( scope: &mut Scope, this: <Self as RudaType>::ExpandType, axis: <usize as RudaType>::ExpandType, ) -> <usize as RudaType>::ExpandType
pub fn __expand_stride( scope: &mut Scope, this: <Self as RudaType>::ExpandType, axis: <usize as RudaType>::ExpandType, ) -> <usize as RudaType>::ExpandType
pub fn __expand_rank( scope: &mut Scope, this: <Self as RudaType>::ExpandType, ) -> <usize as RudaType>::ExpandType
pub fn __expand_len( scope: &mut Scope, this: <Self as RudaType>::ExpandType, ) -> <usize as RudaType>::ExpandType
pub fn __expand_buffer_len( scope: &mut Scope, this: <Self as RudaType>::ExpandType, ) -> <usize as RudaType>::ExpandType
pub fn __expand_as_tensor_map( scope: &mut Scope, this: <Self as RudaType>::ExpandType, ) -> <ComptimeOption<TensorMap<Q::T, Tiled>> as RudaType>::ExpandType
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 TensorQuery<Q, K, V, M, O, GA>
impl<Q: FloatLine, K: FloatLine, V: FloatLine, M: NumericLine, O: FloatLine, GA: AttentionArgs> Clone for TensorQuery<Q, K, V, M, O, GA>
impl<Q: FloatLine, K: FloatLine, V: FloatLine, M: NumericLine, O: FloatLine, GA: AttentionArgs> Copy for TensorQuery<Q, K, V, M, O, GA>
Source§impl<Q: FloatLine, K: FloatLine, V: FloatLine, M: NumericLine, O: FloatLine, GA: AttentionArgs> RudaType for TensorQuery<Q, K, V, M, O, GA>
impl<Q: FloatLine, K: FloatLine, V: FloatLine, M: NumericLine, O: FloatLine, GA: AttentionArgs> RudaType for TensorQuery<Q, K, V, M, O, GA>
type ExpandType = TensorQueryExpand<Q, K, V, M, O, GA>
fn __expand_inactive_value(scope: &mut Scope) -> Self::ExpandType
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 TensorQuery<Q, K, V, M, O, MA>
impl<Q: FloatLine, K: FloatLine, V: FloatLine, M: NumericLine, O: FloatLine, MA: AttentionArgs> Vectorized for TensorQuery<Q, K, V, M, O, MA>
fn vector_size(&self) -> usize
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<<Q as FloatLine>::T, <Q as FloatLine>::N> for TensorQuery<Q, K, V, M, O, MA>
impl<Q: FloatLine, K: FloatLine, V: FloatLine, M: NumericLine, O: FloatLine, MA: AttentionArgs> VirtualTensorOperations<<Q as FloatLine>::T, <Q as FloatLine>::N> for TensorQuery<Q, K, V, M, O, MA>
fn as_tensor_map(&self) -> ComptimeOption<TensorMap<E, Tiled>>
fn read_window(&self, _start: usize, _end: usize) -> Slice<Vector<E, N>> ⓘ
fn len(&self) -> usize
fn buffer_len(&self) -> usize
fn __expand_as_tensor_map( scope: &mut Scope, this: Self::ExpandType, ) -> <ComptimeOption<TensorMap<E, Tiled>> as RudaType>::ExpandType
fn __expand_read( scope: &mut Scope, this: Self::ExpandType, _index: <usize as RudaType>::ExpandType, ) -> <Vector<E, N> as RudaType>::ExpandType
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 ⓘ
fn __expand_write( scope: &mut Scope, this: Self::ExpandType, _index: <usize as RudaType>::ExpandType, _value: <Vector<E, N> as RudaType>::ExpandType, ) -> <() as RudaType>::ExpandType
fn __expand_shape( scope: &mut Scope, this: Self::ExpandType, _axis: <usize as RudaType>::ExpandType, ) -> <usize as RudaType>::ExpandType
fn __expand_stride( scope: &mut Scope, this: Self::ExpandType, _axis: <usize as RudaType>::ExpandType, ) -> <usize as RudaType>::ExpandType
fn __expand_rank( scope: &mut Scope, this: Self::ExpandType, ) -> <usize as RudaType>::ExpandType
fn __expand_len( scope: &mut Scope, this: Self::ExpandType, ) -> <usize as RudaType>::ExpandType
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 TensorQuery<Q, K, V, M, O, GA>
impl<Q, K, V, M, O, GA> !Sync for TensorQuery<Q, K, V, M, O, GA>
impl<Q, K, V, M, O, GA> Freeze for TensorQuery<Q, K, V, M, O, GA>
impl<Q, K, V, M, O, GA> RefUnwindSafe for TensorQuery<Q, K, V, M, O, GA>
impl<Q, K, V, M, O, GA> Unpin for TensorQuery<Q, K, V, M, O, GA>
impl<Q, K, V, M, O, GA> UnsafeUnpin for TensorQuery<Q, K, V, M, O, GA>
impl<Q, K, V, M, O, GA> UnwindSafe for TensorQuery<Q, K, V, M, O, GA>
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