Skip to content

Commit

Permalink
fix clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
nkoppel committed Mar 23, 2023
1 parent 13ffc12 commit 6a15e92
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/nn/impl_module_for_tuples.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ tuple_impls!([M1, M2, M3] [0, 1, 2], M3, [M2, M1]);
tuple_impls!([M1, M2, M3, M4] [0, 1, 2, 3], M4, [M3, M2, M1]);
tuple_impls!([M1, M2, M3, M4, M5] [0, 1, 2, 3, 4], M5, [M4, M3, M2, M1]);
tuple_impls!([M1, M2, M3, M4, M5, M6] [0, 1, 2, 3, 4, 5], M6, [M5, M4, M3, M2, M1]);
tuple_impls!([M1, M2, M3, M4, M5, M6, M7] [0, 1, 2, 3, 4, 5, 6], M7, [M6, M5, M4, M3, M2, M1]);

#[cfg(test)]
mod tests {
Expand Down
1 change: 1 addition & 0 deletions src/nn/tensor_collection/visitor_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,3 +308,4 @@ tuple_impls!([M1, M2, M3] [0, 1, 2]);
tuple_impls!([M1, M2, M3, M4] [0, 1, 2, 3]);
tuple_impls!([M1, M2, M3, M4, M5] [0, 1, 2, 3, 4]);
tuple_impls!([M1, M2, M3, M4, M5, M6] [0, 1, 2, 3, 4, 5]);
tuple_impls!([M1, M2, M3, M4, M5, M6, M7] [0, 1, 2, 3, 4, 5, 6]);
4 changes: 2 additions & 2 deletions src/shapes/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ pub trait SliceDim<R: RangeBounds<usize>>: Dim {
let end_bound = get_end_bound(range.end_bound(), size);

(end_bound <= size && start_bound <= end_bound)
.then(|| end_bound - start_bound)
.and_then(|size| Self::Sliced::from_size(size))
.then_some(end_bound - start_bound)
.and_then(Self::Sliced::from_size)
}
}

Expand Down

0 comments on commit 6a15e92

Please sign in to comment.