pub struct CandleTensorWrapper { /* private fields */ }Expand description
Wrapper for Candle Tensor to implement TensorLike
Implementations§
Trait Implementations§
Source§impl Clone for CandleTensorWrapper
impl Clone for CandleTensorWrapper
Source§fn clone(&self) -> CandleTensorWrapper
fn clone(&self) -> CandleTensorWrapper
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 Debug for CandleTensorWrapper
impl Debug for CandleTensorWrapper
Source§impl TensorLike for CandleTensorWrapper
impl TensorLike for CandleTensorWrapper
Source§fn is_contiguous(&self) -> bool
fn is_contiguous(&self) -> bool
Check if tensor is contiguous in memory
Source§fn view(&self, start: &[usize], end: &[usize]) -> Result<TensorRef>
fn view(&self, start: &[usize], end: &[usize]) -> Result<TensorRef>
Create a view/slice of this tensor
Source§fn reshape(&self, shape: &[usize]) -> Result<TensorRef>
fn reshape(&self, shape: &[usize]) -> Result<TensorRef>
Reshape tensor to new shape (must have same number of elements)
Source§fn to_vec_u32(&self) -> Result<Vec<u32>>
fn to_vec_u32(&self) -> Result<Vec<u32>>
Extract tensor data as Vec (for token IDs)
This is a convenience method for backends that need to extract token data
Source§fn argmax_last_dim_u32(&self) -> Result<u32>
fn argmax_last_dim_u32(&self) -> Result<u32>
Fast path: argmax over the last dimension, returning the selected token id. Read more
Source§fn size_bytes(&self) -> usize
fn size_bytes(&self) -> usize
Get size in bytes for this tensor
Auto Trait Implementations§
impl Freeze for CandleTensorWrapper
impl !RefUnwindSafe for CandleTensorWrapper
impl Send for CandleTensorWrapper
impl Sync for CandleTensorWrapper
impl Unpin for CandleTensorWrapper
impl UnsafeUnpin for CandleTensorWrapper
impl !UnwindSafe for CandleTensorWrapper
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