Struct neuronika::nn::Zero [−][src]
pub struct Zero;
Expand description
Zero padding.
See .pad()
for more informations.
Trait Implementations
Pads the input array with zeros.
Arguments
-
input
- the array to be padded. -
padding
- the amount of padding for each dimension.
Examples
use neuronika::nn::{PaddingMode, Zero};
let padding = Zero;
let arr = ndarray::array![
[1., 2., 3.],
[4., 5., 6.],
[7., 8., 9.]
];
let padded = padding.pad(&arr, (1, 1));
let result = ndarray::array![
[0., 0., 0., 0., 0.],
[0., 1., 2., 3., 0.],
[0., 4., 5., 6., 0.],
[0., 7., 8., 9., 0.],
[0., 0., 0., 0., 0.]
];
assert_eq!(padded, result);
Auto Trait Implementations
impl RefUnwindSafe for Zero
impl UnwindSafe for Zero
Blanket Implementations
Mutably borrows from an owned value. Read more