Enum TensorPrimitive
pub enum TensorPrimitive<B>where
B: Backend,{
Float(<B as BackendTypes>::FloatTensorPrimitive),
QFloat(<B as BackendTypes>::QuantizedTensorPrimitive),
}Expand description
A primitive tensor representation.
Variants§
Float(<B as BackendTypes>::FloatTensorPrimitive)
Float tensor primitive.
QFloat(<B as BackendTypes>::QuantizedTensorPrimitive)
Quantized float tensor primitive.
Implementations§
§impl<B> TensorPrimitive<B>where
B: Backend,
impl<B> TensorPrimitive<B>where
B: Backend,
pub fn tensor(self) -> <B as BackendTypes>::FloatTensorPrimitive
pub fn tensor(self) -> <B as BackendTypes>::FloatTensorPrimitive
Returns the full tensor representation.
pub fn get_mut_ref(&mut self) -> &mut <B as BackendTypes>::FloatTensorPrimitive
pub fn get_mut_ref(&mut self) -> &mut <B as BackendTypes>::FloatTensorPrimitive
Returns a mutable reference to the full tensor representation.
Trait Implementations§
§impl<B> Clone for TensorPrimitive<B>where
B: Clone + Backend,
<B as BackendTypes>::FloatTensorPrimitive: Clone,
<B as BackendTypes>::QuantizedTensorPrimitive: Clone,
impl<B> Clone for TensorPrimitive<B>where
B: Clone + Backend,
<B as BackendTypes>::FloatTensorPrimitive: Clone,
<B as BackendTypes>::QuantizedTensorPrimitive: Clone,
§fn clone(&self) -> TensorPrimitive<B>
fn clone(&self) -> TensorPrimitive<B>
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 more§impl<B> Debug for TensorPrimitive<B>where
B: Debug + Backend,
<B as BackendTypes>::FloatTensorPrimitive: Debug,
<B as BackendTypes>::QuantizedTensorPrimitive: Debug,
impl<B> Debug for TensorPrimitive<B>where
B: Debug + Backend,
<B as BackendTypes>::FloatTensorPrimitive: Debug,
<B as BackendTypes>::QuantizedTensorPrimitive: Debug,
Auto Trait Implementations§
impl<B> Freeze for TensorPrimitive<B>where
<B as BackendTypes>::FloatTensorPrimitive: Freeze,
<B as BackendTypes>::QuantizedTensorPrimitive: Freeze,
impl<B> RefUnwindSafe for TensorPrimitive<B>where
<B as BackendTypes>::FloatTensorPrimitive: RefUnwindSafe,
<B as BackendTypes>::QuantizedTensorPrimitive: RefUnwindSafe,
impl<B> Send for TensorPrimitive<B>
impl<B> Sync for TensorPrimitive<B>
impl<B> Unpin for TensorPrimitive<B>where
<B as BackendTypes>::FloatTensorPrimitive: Unpin,
<B as BackendTypes>::QuantizedTensorPrimitive: Unpin,
impl<B> UnwindSafe for TensorPrimitive<B>where
<B as BackendTypes>::FloatTensorPrimitive: UnwindSafe,
<B as BackendTypes>::QuantizedTensorPrimitive: 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
§impl<C> CloneExpand for Cwhere
C: Clone,
impl<C> CloneExpand for Cwhere
C: Clone,
fn __expand_clone_method(&self, _scope: &mut Scope) -> C
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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