pub enum TensorTransformation {
Transpose {
dim0: usize,
dim1: usize,
},
Reshape {
shape: Vec<usize>,
},
Cast {
dtype: DataType,
},
Quantize {
config: QuantizationConfig,
},
Scale {
factor: f32,
},
Slice {
dim: usize,
start: Option<usize>,
end: Option<usize>,
},
}Expand description
Transformations that can be applied to loaded tensors
Variants§
Transpose
Transpose dimensions
Reshape
Reshape to new shape
Cast
Convert data type
Quantize
Quantize tensor
Fields
§
config: QuantizationConfigScale
Apply scaling
Slice
Slice tensor
Trait Implementations§
Source§impl Clone for TensorTransformation
impl Clone for TensorTransformation
Source§fn clone(&self) -> TensorTransformation
fn clone(&self) -> TensorTransformation
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 TensorTransformation
impl Debug for TensorTransformation
Source§impl<'de> Deserialize<'de> for TensorTransformation
impl<'de> Deserialize<'de> for TensorTransformation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TensorTransformation
impl RefUnwindSafe for TensorTransformation
impl Send for TensorTransformation
impl Sync for TensorTransformation
impl Unpin for TensorTransformation
impl UnsafeUnpin for TensorTransformation
impl UnwindSafe for TensorTransformation
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