pub enum Padding {
Valid,
Same,
SameLower,
Explicit(Vec<(i64, i64)>),
}Expand description
Padding of a convolution or a windowed reduction, as JAX’s padding
argument: a string or explicit (low, high) pairs.
Variants§
Valid
No padding ('VALID').
Same
Padding so that the output has ceil(in / stride) elements, split
evenly with the extra element at the end ('SAME').
SameLower
As Padding::Same, with the extra element at the start
('SAME_LOWER').
Explicit(Vec<(i64, i64)>)
(low, high) padding of each dimension; negative padding removes
elements.
Implementations§
Source§impl Padding
impl Padding
Sourcepub fn to_pads(
&self,
in_shape: &[usize],
window_shape: &[usize],
window_strides: &[usize],
) -> Vec<(i64, i64)>
pub fn to_pads( &self, in_shape: &[usize], window_shape: &[usize], window_strides: &[usize], ) -> Vec<(i64, i64)>
Resolves the padding for an input of spatial shape in_shape, a
(dilated) window of shape window_shape, and window_strides
(lax.padtype_to_pads for strings).
§Panics
Panics if explicit padding has the wrong number of pairs.
Trait Implementations§
impl Eq for Padding
impl StructuralPartialEq for Padding
Auto Trait Implementations§
impl Freeze for Padding
impl RefUnwindSafe for Padding
impl Send for Padding
impl Sync for Padding
impl Unpin for Padding
impl UnsafeUnpin for Padding
impl UnwindSafe for Padding
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