pub enum TensorBuffer {
}Expand description
Owned, contiguous tensor elements stored on the CPU.
Variants§
F32(Vec<f32>)
Owned f32 elements.
F64(Vec<f64>)
Owned f64 elements.
F16(Vec<f16>)
Owned f16 elements.
BF16(Vec<bf16>)
Owned bf16 elements.
I64(Vec<i64>)
Owned i64 elements.
I32(Vec<i32>)
Owned i32 elements.
I16(Vec<i16>)
Owned i16 elements.
I8(Vec<i8>)
Owned i8 elements.
U64(Vec<u64>)
Owned u64 elements.
U32(Vec<u32>)
Owned u32 elements.
U16(Vec<u16>)
Owned u16 elements.
U8(Vec<u8>)
Owned u8 elements.
Bool(Vec<bool>)
Owned bool elements.
Implementations§
Source§impl TensorBuffer
impl TensorBuffer
Sourcepub fn view(&self) -> TensorData<'_>
pub fn view(&self) -> TensorData<'_>
Borrow the elements without copying.
Sourcepub fn view_mut(&mut self) -> TensorDataMut<'_>
pub fn view_mut(&mut self) -> TensorDataMut<'_>
Borrow the elements for mutation without copying.
Trait Implementations§
Source§impl Clone for TensorBuffer
impl Clone for TensorBuffer
Source§impl Debug for TensorBuffer
impl Debug for TensorBuffer
Source§impl PartialEq for TensorBuffer
impl PartialEq for TensorBuffer
impl StructuralPartialEq for TensorBuffer
Auto Trait Implementations§
impl Freeze for TensorBuffer
impl RefUnwindSafe for TensorBuffer
impl Send for TensorBuffer
impl Sync for TensorBuffer
impl Unpin for TensorBuffer
impl UnsafeUnpin for TensorBuffer
impl UnwindSafe for TensorBuffer
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