pub struct LazyBuffer<D>(/* private fields */)
where
D: Device;Implementations§
Source§impl<D> LazyBuffer<D>where
D: Device,
impl<D> LazyBuffer<D>where
D: Device,
pub unsafe fn maybe_allocate_uninit(&self) -> Result<(), Error>
pub fn op(&self) -> &Op<D>
pub fn in_place_op(&self) -> bool
pub fn realized(&self) -> Result<bool, Error>
pub fn realize(&self) -> Result<(), Error>
pub fn data(&self) -> &RefCell<Option<<D as Device>::Slice>>
pub fn data_vec<DT>(&self) -> Result<Vec<DT>, Error>where
DT: WithDType,
pub fn device(&self) -> &D
pub fn dtype(&self) -> DType
pub fn shape(&self) -> &Shape
pub fn elem_count(&self) -> usize
pub fn dims(&self) -> &[usize]
pub fn dims0(&self) -> Result<(), Error>
pub fn dims1(&self) -> Result<usize, Error>
pub fn dims2(&self) -> Result<(usize, usize), Error>
pub fn dims3(&self) -> Result<(usize, usize, usize), Error>
pub fn dims4(&self) -> Result<(usize, usize, usize, usize), Error>
pub fn rank(&self) -> usize
pub fn unary(&self, op: UnaryOp) -> Result<LazyBuffer<D>, Error>
pub fn cast(&self, dtype: DType) -> Result<LazyBuffer<D>, Error>
pub fn binary( &self, op: BinaryOp, rhs: LazyBuffer<D>, ) -> Result<LazyBuffer<D>, Error>
pub fn alloc_uninit<S>( dtype: DType, s: S, device: &D, ) -> Result<LazyBuffer<D>, Error>
pub fn custom<F, S>( f: F, args: Vec<LazyBuffer<D>>, s: S, dtype: DType, device: &D, ) -> Result<LazyBuffer<D>, Error>
Sourcepub fn custom_ip<F>(
&self,
f: F,
args: Vec<LazyBuffer<D>>,
) -> Result<LazyBuffer<D>, Error>
pub fn custom_ip<F>( &self, f: F, args: Vec<LazyBuffer<D>>, ) -> Result<LazyBuffer<D>, Error>
Applies a custom in-place operation.
Sourcepub fn set(&self, values: LazyBuffer<D>) -> Result<LazyBuffer<D>, Error>
pub fn set(&self, values: LazyBuffer<D>) -> Result<LazyBuffer<D>, Error>
Sets self using data from values.
pub fn set_l( &self, values: LazyBuffer<D>, dst_layout: Layout, ) -> Result<LazyBuffer<D>, Error>
pub fn ssa<S>( ssa: Kernel, args: Vec<LazyBuffer<D>>, s: S, dtype: DType, device: &D, ) -> Result<LazyBuffer<D>, Error>
pub fn matmul(&self, rhs: LazyBuffer<D>) -> Result<LazyBuffer<D>, Error>
pub fn matmul_t(&self, rhs: LazyBuffer<D>) -> Result<LazyBuffer<D>, Error>
pub fn matmul_( &self, rhs: LazyBuffer<D>, transpose: bool, ) -> Result<LazyBuffer<D>, Error>
pub fn reduce<I>(&self, op: ReduceOp, dim: I) -> Result<LazyBuffer<D>, Error>where
I: Dim,
pub fn id(&self) -> Id
pub fn split_dim<I>(
&self,
dim: I,
size1: usize,
size2: usize,
) -> Result<LazyBuffer<D>, Error>where
I: Dim,
Sourcepub fn merge_dims<I>(&self, dim: I) -> Result<LazyBuffer<D>, Error>where
I: Dim,
pub fn merge_dims<I>(&self, dim: I) -> Result<LazyBuffer<D>, Error>where
I: Dim,
Merge the dims dim and dim + 1 together.
pub fn squeeze<D1>(&self, dim: D1) -> Result<LazyBuffer<D>, Error>where
D1: Dim,
pub fn get_on_dim<D1>(
&self,
dim: D1,
index: usize,
) -> Result<LazyBuffer<D>, Error>where
D1: Dim,
pub fn get(&self, index: usize) -> Result<LazyBuffer<D>, Error>
pub fn unsqueeze<D1>(&self, dim: D1) -> Result<LazyBuffer<D>, Error>where
D1: Dim,
pub fn reshape<S>(&self, s: S) -> Result<LazyBuffer<D>, Error>
pub fn narrow<D1>(
&self,
dim: D1,
offset: usize,
length: usize,
) -> Result<LazyBuffer<D>, Error>where
D1: Dim,
pub fn broadcast<S>(&self, s: S) -> Result<LazyBuffer<D>, Error>
pub fn transpose<D1, D2>( &self, dim1: D1, dim2: D2, ) -> Result<LazyBuffer<D>, Error>
pub fn cst<C, S>(c: C, s: S, device: &D) -> Result<LazyBuffer<D>, Error>
pub fn from_slice<S>( data: <D as Device>::Slice, s: S, ) -> Result<LazyBuffer<D>, Error>
pub fn copy<'a, R, S>(data: R, s: S, device: &D) -> Result<LazyBuffer<D>, Error>
pub fn cat<D1>(args: &[&LazyBuffer<D>], dim: D1) -> Result<LazyBuffer<D>, Error>where
D1: Dim,
Trait Implementations§
Source§impl<D> Clone for LazyBuffer<D>where
D: Device,
impl<D> Clone for LazyBuffer<D>where
D: Device,
Source§fn clone(&self) -> LazyBuffer<D>
fn clone(&self) -> LazyBuffer<D>
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<D> Debug for LazyBuffer<D>where
D: Device,
impl<D> Debug for LazyBuffer<D>where
D: Device,
Source§impl<D> Deref for LazyBuffer<D>where
D: Device,
impl<D> Deref for LazyBuffer<D>where
D: Device,
Source§type Target = LazyBufferInner<D>
type Target = LazyBufferInner<D>
The resulting type after dereferencing.
Auto Trait Implementations§
impl<D> Freeze for LazyBuffer<D>
impl<D> !RefUnwindSafe for LazyBuffer<D>
impl<D> !Send for LazyBuffer<D>
impl<D> !Sync for LazyBuffer<D>
impl<D> Unpin for LazyBuffer<D>
impl<D> !UnwindSafe for LazyBuffer<D>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more