pub struct TensorMeta { /* private fields */ }Implementations§
Source§impl TensorMeta
impl TensorMeta
pub fn scalar(dtype: DType, device: Device) -> Self
pub fn from_shape(shape: Vec<usize>, dtype: DType, device: Device) -> Self
pub fn quantized_from_shape( shape: Vec<usize>, dtype: DType, device: Device, scale: f64, zero_point: i64, ) -> Result<Self, TensorMetaError>
pub fn quantized_per_channel_from_shape( shape: Vec<usize>, dtype: DType, device: Device, scales: Vec<f64>, zero_points: Vec<i64>, axis: usize, ) -> Result<Self, TensorMetaError>
pub fn from_shape_and_strides( shape: Vec<usize>, strides: Vec<usize>, storage_offset: usize, dtype: DType, device: Device, ) -> Result<Self, TensorMetaError>
pub fn quantized_from_shape_and_strides( shape: Vec<usize>, strides: Vec<usize>, storage_offset: usize, dtype: DType, device: Device, scale: f64, zero_point: i64, ) -> Result<Self, TensorMetaError>
pub fn quantized_per_channel_from_shape_and_strides( shape: Vec<usize>, strides: Vec<usize>, storage_offset: usize, dtype: DType, device: Device, scales: Vec<f64>, zero_points: Vec<i64>, axis: usize, ) -> Result<Self, TensorMetaError>
pub fn with_storage_offset(self, storage_offset: usize) -> Self
pub fn with_dtype(self, dtype: DType) -> Self
pub fn with_quantization(self, quantization: QuantizationParams) -> Self
pub fn validate(&self) -> Result<(), TensorMetaError>
pub fn shape(&self) -> &[usize]
pub fn strides(&self) -> &[usize]
pub fn storage_offset(&self) -> usize
pub fn dtype(&self) -> DType
pub fn device(&self) -> Device
pub fn quantization(&self) -> Option<&QuantizationParams>
pub fn numel(&self) -> usize
pub fn is_contiguous(&self) -> bool
pub fn storage_index_for( &self, index: &[usize], ) -> Result<usize, TensorMetaError>
pub fn fingerprint64(&self) -> u64
Trait Implementations§
Source§impl Clone for TensorMeta
impl Clone for TensorMeta
Source§fn clone(&self) -> TensorMeta
fn clone(&self) -> TensorMeta
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 TensorMeta
impl Debug for TensorMeta
impl Eq for TensorMeta
Source§impl PartialEq for TensorMeta
impl PartialEq for TensorMeta
impl StructuralPartialEq for TensorMeta
Auto Trait Implementations§
impl Freeze for TensorMeta
impl RefUnwindSafe for TensorMeta
impl Send for TensorMeta
impl Sync for TensorMeta
impl Unpin for TensorMeta
impl UnsafeUnpin for TensorMeta
impl UnwindSafe for TensorMeta
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