pub struct VirtualTensor<E: Numeric, IO = Read> { /* private fields */ }
Expand description
Tensor representation that is decoupled from how the tensor is stored.
Implementations§
Source§impl<E: Numeric, IO: Clone> VirtualTensor<E, IO>
impl<E: Numeric, IO: Clone> VirtualTensor<E, IO>
pub fn as_tensor_map(&self) -> TensorMap<E>
pub fn as_slice(&self, start: u32, end: u32) -> Slice<Line<E>>
pub fn len(&self) -> u32
pub fn buffer_len(&self) -> u32
pub fn __expand_as_tensor_map( context: &mut Scope, this: <Self as CubeType>::ExpandType, ) -> <TensorMap<E> as CubeType>::ExpandType
pub fn __expand_as_slice( context: &mut Scope, this: <Self as CubeType>::ExpandType, start: <u32 as CubeType>::ExpandType, end: <u32 as CubeType>::ExpandType, ) -> <Slice<Line<E>> as CubeType>::ExpandType
pub fn __expand_shape( scope: &mut Scope, this: <Self as CubeType>::ExpandType, axis: <u32 as CubeType>::ExpandType, ) -> <u32 as CubeType>::ExpandType
pub fn __expand_stride( scope: &mut Scope, this: <Self as CubeType>::ExpandType, axis: <u32 as CubeType>::ExpandType, ) -> <u32 as CubeType>::ExpandType
pub fn __expand_rank( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ) -> <u32 as CubeType>::ExpandType
pub fn __expand_len( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ) -> <u32 as CubeType>::ExpandType
pub fn __expand_buffer_len( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ) -> <u32 as CubeType>::ExpandType
Source§impl<E: Numeric, IO: Clone> VirtualTensor<E, IO>
impl<E: Numeric, IO: Clone> VirtualTensor<E, IO>
pub fn coordinate(&self, index: u32, dim: u32) -> u32
pub fn __expand_coordinate( scope: &mut Scope, this: <Self as CubeType>::ExpandType, index: <u32 as CubeType>::ExpandType, dim: <u32 as CubeType>::ExpandType, ) -> <u32 as CubeType>::ExpandType
Source§impl<E: Numeric> VirtualTensor<E, Read>
impl<E: Numeric> VirtualTensor<E, Read>
Sourcepub fn new<V: VirtualTensorOperations<E> + 'static>(_v: &V) -> Self
pub fn new<V: VirtualTensorOperations<E> + 'static>(_v: &V) -> Self
Create a new read only virtual tensor.
Sourcepub fn __expand_new<V>(
_scope: &mut Scope,
v: V::ExpandType,
) -> VirtualTensorExpand<E, Read>where
V::ExpandType: VirtualTensorOperationsExpand<E>,
V: VirtualTensorOperations<E> + CubeType + 'static,
pub fn __expand_new<V>(
_scope: &mut Scope,
v: V::ExpandType,
) -> VirtualTensorExpand<E, Read>where
V::ExpandType: VirtualTensorOperationsExpand<E>,
V: VirtualTensorOperations<E> + CubeType + 'static,
Expand function of Self::new.
Source§impl<E: Numeric> VirtualTensor<E, ReadWrite>
impl<E: Numeric> VirtualTensor<E, ReadWrite>
Sourcepub fn new<V: VirtualTensorOperations<E> + 'static>(_v: &mut V) -> Self
pub fn new<V: VirtualTensorOperations<E> + 'static>(_v: &mut V) -> Self
Create a new read write virtual tensor.
Sourcepub fn __expand_new<V>(
_scope: &mut Scope,
v: V::ExpandType,
) -> VirtualTensorExpand<E, ReadWrite>where
V::ExpandType: VirtualTensorOperationsExpand<E>,
V: VirtualTensorOperations<E> + CubeType + 'static,
pub fn __expand_new<V>(
_scope: &mut Scope,
v: V::ExpandType,
) -> VirtualTensorExpand<E, ReadWrite>where
V::ExpandType: VirtualTensorOperationsExpand<E>,
V: VirtualTensorOperations<E> + CubeType + 'static,
Expand function of Self::new.
Trait Implementations§
Source§impl<E: Clone + Numeric, IO: Clone> Clone for VirtualTensor<E, IO>
impl<E: Clone + Numeric, IO: Clone> Clone for VirtualTensor<E, IO>
Source§fn clone(&self) -> VirtualTensor<E, IO>
fn clone(&self) -> VirtualTensor<E, IO>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<E: Numeric, IO: Clone> CubeType for VirtualTensor<E, IO>
impl<E: Numeric, IO: Clone> CubeType for VirtualTensor<E, IO>
type ExpandType = VirtualTensorExpand<E, IO>
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<E: Numeric, IO: Clone> List<Line<E>> for VirtualTensor<E, IO>
impl<E: Numeric, IO: Clone> List<Line<E>> for VirtualTensor<E, IO>
fn __expand_read( scope: &mut Scope, this: VirtualTensorExpand<E, IO>, index: <u32 as CubeType>::ExpandType, ) -> <Line<E> as CubeType>::ExpandType
fn read(&self, index: u32) -> T
fn read_unchecked(&self, index: u32) -> T
fn __expand_read_unchecked( scope: &mut Scope, this: Self::ExpandType, index: ExpandElementTyped<u32>, ) -> <T as CubeType>::ExpandType
Source§impl<E: Numeric> ListMut<Line<E>> for VirtualTensor<E, ReadWrite>
impl<E: Numeric> ListMut<Line<E>> for VirtualTensor<E, ReadWrite>
fn __expand_write( scope: &mut Scope, this: VirtualTensorExpand<E, ReadWrite>, index: <u32 as CubeType>::ExpandType, value: <Line<E> as CubeType>::ExpandType, ) -> <() as CubeType>::ExpandType
fn write(&self, index: u32, value: T)
impl<E: Numeric, IO: Clone> Copy for VirtualTensor<E, IO>
Auto Trait Implementations§
impl<E, IO> Freeze for VirtualTensor<E, IO>
impl<E, IO> RefUnwindSafe for VirtualTensor<E, IO>where
E: RefUnwindSafe,
IO: RefUnwindSafe,
impl<E, IO> Send for VirtualTensor<E, IO>where
IO: Send,
impl<E, IO> Sync for VirtualTensor<E, IO>where
IO: Sync,
impl<E, IO> Unpin for VirtualTensor<E, IO>
impl<E, IO> UnwindSafe for VirtualTensor<E, IO>where
E: UnwindSafe,
IO: 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