pub struct PadDescriptor<const N: usize> {
pub mode: PadMode,
pub input_shape: [i32; N],
pub pad_low: [i32; N],
pub pad_high: [i32; N],
pub value: f32,
pub element: ElementKind,
}Expand description
Descriptor for a constant-pad op.
input_shape is the shape of the input tensor. pad_low[d] and
pad_high[d] are the pad amounts on each side of axis d. Output
shape is input_shape[d] + pad_low[d] + pad_high[d] per axis.
value is the constant used in the pad region (for Constant
mode). element must match T::KIND at select time.
Fields§
§mode: PadModePadding mode — one of PadMode::Constant / PadMode::Reflect
/ PadMode::Replicate / PadMode::Circular. All four are
wired for every supported dtype.
input_shape: [i32; N]Input tensor shape.
pad_low: [i32; N]Pad amount on the low side of each axis. Non-negative.
pad_high: [i32; N]Pad amount on the high side of each axis. Non-negative.
value: f32Constant value used in the pad region for Constant mode.
element: ElementKindElement type of input and output.
Implementations§
Source§impl<const N: usize> PadDescriptor<N>
impl<const N: usize> PadDescriptor<N>
Sourcepub fn output_shape(&self) -> [i32; N]
pub fn output_shape(&self) -> [i32; N]
Compute the output shape from input shape + pad amounts.
Trait Implementations§
Source§impl<const N: usize> Clone for PadDescriptor<N>
impl<const N: usize> Clone for PadDescriptor<N>
Source§fn clone(&self) -> PadDescriptor<N>
fn clone(&self) -> PadDescriptor<N>
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 moreimpl<const N: usize> Copy for PadDescriptor<N>
Auto Trait Implementations§
impl<const N: usize> Freeze for PadDescriptor<N>
impl<const N: usize> RefUnwindSafe for PadDescriptor<N>
impl<const N: usize> Send for PadDescriptor<N>
impl<const N: usize> Sync for PadDescriptor<N>
impl<const N: usize> Unpin for PadDescriptor<N>
impl<const N: usize> UnsafeUnpin for PadDescriptor<N>
impl<const N: usize> UnwindSafe for PadDescriptor<N>
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