pub struct PadOperation<'c> { /* private fields */ }
Expand description
A pad
operation. Pads a tensor with value specified..
The tosa.pad
operation pads a tensor along borders of each dimension with
pad_const
(defaults to zero), given a padding configuration padding
specifying low and high values along the dimensions.
Example:
%0 = arith.constant dense<[[1, 2], [3, 4]]> : tensor<2x2xi32>
"tosa.pad"(%arg0, %0) : (tensor<1x2xf32>, tensor<2x2xi32>) -> (tensor<4x9xf32>)
Example 2:
%0 = arith.constant dense<[[-1, 2], [3, 4]]> : tensor<2x2xi32>
"tosa.pad"(%arg0, %0) : (tensor<1x2xf32>, tensor<2x2xi32>) -> (tensor<?x9xf32>)
Implementations§
source§impl<'c> PadOperation<'c>
impl<'c> PadOperation<'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>
) -> PadOperationBuilder<'c, Unset, Unset, Unset>
pub fn builder( context: &'c Context, location: Location<'c> ) -> PadOperationBuilder<'c, Unset, Unset, Unset>
Creates a builder.
pub fn output(&self) -> Result<OperationResult<'c, '_>, Error>
pub fn input_1(&self) -> Result<Value<'c, '_>, Error>
pub fn padding(&self) -> Result<Value<'c, '_>, Error>
pub fn pad_const(&self) -> Result<Value<'c, '_>, Error>
pub fn quantization_info(&self) -> Result<Attribute<'c>, Error>
pub fn set_quantization_info(&mut self, value: Attribute<'c>)
pub fn remove_quantization_info(&mut self) -> Result<(), Error>
Trait Implementations§
source§impl<'c> From<PadOperation<'c>> for Operation<'c>
impl<'c> From<PadOperation<'c>> for Operation<'c>
source§fn from(operation: PadOperation<'c>) -> Self
fn from(operation: PadOperation<'c>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'c> RefUnwindSafe for PadOperation<'c>
impl<'c> !Send for PadOperation<'c>
impl<'c> !Sync for PadOperation<'c>
impl<'c> Unpin for PadOperation<'c>
impl<'c> UnwindSafe for PadOperation<'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