Skip to content

Commit

Permalink
fix: normalize flag wasn't documented (#663)
Browse files Browse the repository at this point in the history
Co-authored-by: dante <[email protected]>
  • Loading branch information
field-worker and alexander-camuto authored Dec 17, 2023
1 parent 00b0e10 commit 5ddb1c6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/tensor/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2262,6 +2262,7 @@ pub fn deconv<
/// * `padding` - Tuple of padding values in x and y directions.
/// * `stride` - Tuple of stride values in x and y directions.
/// * `pool_dims` - Tuple of pooling window size in x and y directions.
/// * `normalize` - Flag to normalize the output by the number of elements in the pooling window.
/// # Examples
/// ```
/// use ezkl::tensor::Tensor;
Expand All @@ -2277,6 +2278,11 @@ pub fn deconv<
/// let pooled = sumpool(&x, [(0, 0); 2], (1, 1), (2, 2), false).unwrap().0;
/// let expected: Tensor<i128> = Tensor::<i128>::new(Some(&[11, 8, 8, 10]), &[1, 1, 2, 2]).unwrap();
/// assert_eq!(pooled, expected);
///
/// // This time with normalization
/// let pooled = sumpool(&x, [(0, 0); 2], (1, 1), (2, 2), true).unwrap().0;
/// let expected: Tensor<i128> = Tensor::<i128>::new(Some(&[3, 2, 2, 3]), &[1, 1, 2, 2]).unwrap();
/// assert_eq!(pooled, expected);
/// ```
pub fn sumpool(
image: &Tensor<i128>,
Expand Down

0 comments on commit 5ddb1c6

Please sign in to comment.