pub struct StorageCastOperation<'c> { /* private fields */ }
Expand description
A scast
operation. Cast from or to a type based on the storage type and the corresponding quantized type.
A StorageCast scast
represents a cast from or to a type based on the
storage type and a type based on a corresponding quantized type.
This op exists to ensure type coherency for between parts of the computation which are operating directly on an underlying storage type and those which operate on quantized values.
Examples from storage to quantized type:
i8 -> !quant<"uniform[i8:f32]{1.0}">
tensor<4xi8> -> tensor<4x!quant<"uniform[i8:f32]{1.0}">>
vector<4xi8> -> vector<4x!quant<"uniform[i8:f32]{1.0}">>
Implementations§
source§impl<'c> StorageCastOperation<'c>
impl<'c> StorageCastOperation<'c>
sourcepub fn as_operation(&self) -> &Operation<'c>
pub fn as_operation(&self) -> &Operation<'c>
Returns a generic operation.
sourcepub fn builder(
context: &'c Context,
location: Location<'c>
) -> StorageCastOperationBuilder<'c, Unset, Unset>
pub fn builder( context: &'c Context, location: Location<'c> ) -> StorageCastOperationBuilder<'c, Unset, Unset>
Creates a builder.
pub fn res(&self) -> Result<OperationResult<'c, '_>, Error>
pub fn arg(&self) -> Result<Value<'c, '_>, Error>
Trait Implementations§
source§impl<'c> From<StorageCastOperation<'c>> for Operation<'c>
impl<'c> From<StorageCastOperation<'c>> for Operation<'c>
source§fn from(operation: StorageCastOperation<'c>) -> Self
fn from(operation: StorageCastOperation<'c>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'c> RefUnwindSafe for StorageCastOperation<'c>
impl<'c> !Send for StorageCastOperation<'c>
impl<'c> !Sync for StorageCastOperation<'c>
impl<'c> Unpin for StorageCastOperation<'c>
impl<'c> UnwindSafe for StorageCastOperation<'c>
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