pub struct ApplyScaleOperation<'c> { /* private fields */ }
Expand description
An apply_scale
operation. Rescale scalar operator for Tosa tensor operators.
Applies rescaling for fixed point values. This behavior is replicated in multiple quantized operations (mul, convolution, rescale, matmul, pooling).
The commonplace implementation is to use i64 operations to avoid integer overflow with target specific implementations can use native operations to avoid wider than necessary types.
Implementations§
source§impl<'c> ApplyScaleOperation<'c>
impl<'c> ApplyScaleOperation<'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>
) -> ApplyScaleOperationBuilder<'c, Unset, Unset, Unset, Unset, Unset>
pub fn builder( context: &'c Context, location: Location<'c> ) -> ApplyScaleOperationBuilder<'c, Unset, Unset, Unset, Unset, Unset>
Creates a builder.
pub fn output(&self) -> Result<OperationResult<'c, '_>, Error>
pub fn value(&self) -> Result<Value<'c, '_>, Error>
pub fn multiplier(&self) -> Result<Value<'c, '_>, Error>
pub fn shift(&self) -> Result<Value<'c, '_>, Error>
pub fn double_round(&self) -> Result<Attribute<'c>, Error>
pub fn set_double_round(&mut self, value: Attribute<'c>)
Trait Implementations§
source§impl<'c> From<ApplyScaleOperation<'c>> for Operation<'c>
impl<'c> From<ApplyScaleOperation<'c>> for Operation<'c>
source§fn from(operation: ApplyScaleOperation<'c>) -> Self
fn from(operation: ApplyScaleOperation<'c>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'c> RefUnwindSafe for ApplyScaleOperation<'c>
impl<'c> !Send for ApplyScaleOperation<'c>
impl<'c> !Sync for ApplyScaleOperation<'c>
impl<'c> Unpin for ApplyScaleOperation<'c>
impl<'c> UnwindSafe for ApplyScaleOperation<'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