pub struct TensorViewWithDataBuffer { /* private fields */ }
Expand description
A data structure like TensorView
in safetensors, but it owns the data
Implementations§
Source§impl TensorViewWithDataBuffer
impl TensorViewWithDataBuffer
Sourcepub fn to_tensor_view(&self) -> TensorView<'_>
pub fn to_tensor_view(&self) -> TensorView<'_>
Create a standard TensorView from this buffer. No copy of data occurs.
Sourcepub fn new<A, S, D>(array: &ArrayBase<S, D>) -> TensorViewWithDataBuffer
pub fn new<A, S, D>(array: &ArrayBase<S, D>) -> TensorViewWithDataBuffer
Create a new TensorViewWithDataBuffer object from a ndarray.
Notes: Copy of the data occurs once. The original array won’t be consumed.
Sourcepub fn new_fp16<A, S, D>(array: &ArrayBase<S, D>) -> TensorViewWithDataBuffer
pub fn new_fp16<A, S, D>(array: &ArrayBase<S, D>) -> TensorViewWithDataBuffer
Create a new TensorViewWithDataBuffer object in FP16 from a ndarray.
Sourcepub fn new_bf16<A, S, D>(array: &ArrayBase<S, D>) -> TensorViewWithDataBuffer
pub fn new_bf16<A, S, D>(array: &ArrayBase<S, D>) -> TensorViewWithDataBuffer
Create a new TensorViewWithDataBuffer object in BF16 from a ndarray.
Trait Implementations§
Source§impl View for TensorViewWithDataBuffer
impl View for TensorViewWithDataBuffer
Auto Trait Implementations§
impl Freeze for TensorViewWithDataBuffer
impl RefUnwindSafe for TensorViewWithDataBuffer
impl Send for TensorViewWithDataBuffer
impl Sync for TensorViewWithDataBuffer
impl Unpin for TensorViewWithDataBuffer
impl UnwindSafe for TensorViewWithDataBuffer
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