pub struct GgmlTensor(/* private fields */);Expand description
A wrapper around a ggml_tensor pointer.
Tensors are owned by their GgmlContext and must not outlive it.
This wrapper does NOT free the tensor on drop.
Implementations§
Source§impl GgmlTensor
impl GgmlTensor
Sourcepub fn as_ptr(&self) -> *mut ggml_tensor
pub fn as_ptr(&self) -> *mut ggml_tensor
Get the raw tensor pointer.
Sourcepub fn element_size(&self) -> usize
pub fn element_size(&self) -> usize
Get the element size in bytes.
Trait Implementations§
Source§impl Clone for GgmlTensor
impl Clone for GgmlTensor
Source§fn clone(&self) -> GgmlTensor
fn clone(&self) -> GgmlTensor
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 GgmlTensor
impl Debug for GgmlTensor
impl Copy for GgmlTensor
Auto Trait Implementations§
impl Freeze for GgmlTensor
impl RefUnwindSafe for GgmlTensor
impl !Send for GgmlTensor
impl !Sync for GgmlTensor
impl Unpin for GgmlTensor
impl UnsafeUnpin for GgmlTensor
impl UnwindSafe for GgmlTensor
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