pub enum TensorStorage {
F32(Arc<Vec<f32>>),
F64(Arc<Vec<f64>>),
F64Inline4([f64; 4]),
F16(Arc<Vec<Float16>>),
BF16(Arc<Vec<BFloat16>>),
QInt8(Arc<Vec<i8>>),
QUInt8(Arc<Vec<u8>>),
Complex64(Arc<Vec<Complex64>>),
Complex128(Arc<Vec<Complex128>>),
}Variants§
F32(Arc<Vec<f32>>)
F64(Arc<Vec<f64>>)
F64Inline4([f64; 4])
F16(Arc<Vec<Float16>>)
BF16(Arc<Vec<BFloat16>>)
QInt8(Arc<Vec<i8>>)
QUInt8(Arc<Vec<u8>>)
Complex64(Arc<Vec<Complex64>>)
Complex128(Arc<Vec<Complex128>>)
Implementations§
Source§impl TensorStorage
impl TensorStorage
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn dtype(&self) -> DType
pub fn as_f64(&self) -> Option<&[f64]>
pub fn as_f32(&self) -> Option<&[f32]>
pub fn as_f16(&self) -> Option<&[Float16]>
pub fn as_bf16(&self) -> Option<&[BFloat16]>
pub fn as_qint8(&self) -> Option<&[i8]>
pub fn as_quint8(&self) -> Option<&[u8]>
pub fn as_complex64(&self) -> Option<&[Complex64]>
pub fn as_complex128(&self) -> Option<&[Complex128]>
Sourcepub fn to_f64_vec(&self) -> Vec<f64>
pub fn to_f64_vec(&self) -> Vec<f64>
Convert storage to f64 values, promoting from any float type. Complex types extract the real part.
Sourcepub fn to_f32_vec(&self) -> Vec<f32>
pub fn to_f32_vec(&self) -> Vec<f32>
Convert storage to f32 values, promoting from half or demoting from f64. Complex types extract the real part.
Trait Implementations§
Source§impl Clone for TensorStorage
impl Clone for TensorStorage
Source§fn clone(&self) -> TensorStorage
fn clone(&self) -> TensorStorage
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 TensorStorage
impl Debug for TensorStorage
Source§impl PartialEq for TensorStorage
impl PartialEq for TensorStorage
impl StructuralPartialEq for TensorStorage
Auto Trait Implementations§
impl Freeze for TensorStorage
impl RefUnwindSafe for TensorStorage
impl Send for TensorStorage
impl Sync for TensorStorage
impl Unpin for TensorStorage
impl UnsafeUnpin for TensorStorage
impl UnwindSafe for TensorStorage
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