pub struct GTensorMetadata<const DIMS: usize> {
pub typ: GType,
pub op: ggml_op,
pub shape: [usize; DIMS],
pub len_bytes: usize,
pub len_elements: usize,
pub element_size: usize,
pub ggml_ne: [u32; 4],
pub ggml_nb: [u32; 4],
}
Expand description
Metadata associated with a GTensor.
Fields§
§typ: GType
The type of tensor.
op: ggml_op
The associated GGML operation if available.
shape: [usize; DIMS]
The shape of the tensor.
len_bytes: usize
The length in bytes.
len_elements: usize
The number of elements.
element_size: usize
The size of an individual element.
Note: This may not be accurate for quantized types.
ggml_ne: [u32; 4]
§ggml_nb: [u32; 4]
Implementations§
Source§impl<const DIMS: usize> GTensorMetadata<DIMS>
impl<const DIMS: usize> GTensorMetadata<DIMS>
pub fn is_scalar(&self) -> bool
pub fn is_vector(&self) -> bool
pub fn is_matrix(&self) -> bool
pub fn is_quantized(&self) -> bool
pub fn can_mul_mat_with<const RDIMS: usize>( &self, other: >ensorMetadata<RDIMS>, ) -> bool
pub fn can_repeat_with<const RDIMS: usize>( &self, other: >ensorMetadata<RDIMS>, ) -> bool
pub fn is_permuted(&self) -> bool
pub fn is_transposed(&self) -> bool
pub fn is_contiguous(&self) -> bool
pub fn is_padded_1d(&self) -> bool
pub fn is_same_shape(&self, other: &Self) -> bool
Trait Implementations§
Source§impl<const DIMS: usize> Clone for GTensorMetadata<DIMS>
impl<const DIMS: usize> Clone for GTensorMetadata<DIMS>
Source§fn clone(&self) -> GTensorMetadata<DIMS>
fn clone(&self) -> GTensorMetadata<DIMS>
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<const DIMS: usize> Debug for GTensorMetadata<DIMS>
impl<const DIMS: usize> Debug for GTensorMetadata<DIMS>
Source§impl<const DIMS: usize> PartialEq for GTensorMetadata<DIMS>
impl<const DIMS: usize> PartialEq for GTensorMetadata<DIMS>
impl<const DIMS: usize> StructuralPartialEq for GTensorMetadata<DIMS>
Auto Trait Implementations§
impl<const DIMS: usize> Freeze for GTensorMetadata<DIMS>
impl<const DIMS: usize> RefUnwindSafe for GTensorMetadata<DIMS>
impl<const DIMS: usize> Send for GTensorMetadata<DIMS>
impl<const DIMS: usize> Sync for GTensorMetadata<DIMS>
impl<const DIMS: usize> Unpin for GTensorMetadata<DIMS>
impl<const DIMS: usize> UnwindSafe for GTensorMetadata<DIMS>
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