Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow unexpected cfgs clippy #73

Merged
merged 2 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ jobs:
env:
CARGO_ALIAS_CLIPPYALL: clippy --workspace
run: |
cargo hack --feature-powerset --skip default,learn,dataset,iris,mnist clippyall --all-targets -v -- -D warnings
cargo clippy --no-default-features --features iris,mnist --all-targets -v -- -D warnings
cargo hack --feature-powerset --skip default,learn,dataset,iris,mnist clippyall --all-targets -v -- -D warnings -A unexpected_cfgs
cargo clippy --no-default-features --features iris,mnist --all-targets -v -- -D warnings -A unexpected_cfgs
- name: rustdoc
run: |
cargo rustdoc -p autograph_derive -- -D warnings
Expand Down
8 changes: 4 additions & 4 deletions src/learn/neural_network/layer/conv_direct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -971,8 +971,8 @@ impl Conv2DirectBackwardInputHostF32Kernel<8> for () {
dx: &mut [[f32; 8]],
iw: usize,
) {
let twy = if UNROLL { TWY } else { twy.max(1).min(TWY) };
let tcy = tcy.max(1).min(8);
let twy = if UNROLL { TWY } else { twy.clamp(1, TWY) };
let tcy = tcy.clamp(1, 8);
let mut dy_packed = [f32x8::default(); TWY];
let mut dx_packed = [f32x8::default(); TWY];
for (fi, w) in w.chunks_exact(fw).enumerate() {
Expand Down Expand Up @@ -1012,8 +1012,8 @@ impl Conv2DirectBackwardInputHostF32Kernel<1> for () {
dx: &mut [[f32; 1]],
iw: usize,
) {
let twy = if UNROLL { TWY } else { twy.max(1).min(TWY) };
let tcy = tcy.max(1).min(8);
let twy = if UNROLL { TWY } else { twy.clamp(1, TWY) };
let tcy = tcy.clamp(1, 8);
let mut dy_packed = f32x8::default();
let mut dx_packed = f32x8::default();
for (fi, w) in w.chunks_exact(fw).enumerate() {
Expand Down
2 changes: 1 addition & 1 deletion src/tensor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ fn size_of_shape_checked<D: Dimension>(dim: &D) -> Result<usize, ShapeError> {
.filter(|&&d| d != 0)
.try_fold(1usize, |acc, &d| acc.checked_mul(d))
.ok_or_else(|| ShapeError::from_kind(ErrorKind::Overflow))?;
if size_nonzero > ::std::isize::MAX as usize {
if size_nonzero > isize::MAX as usize {
Err(ShapeError::from_kind(ErrorKind::Overflow))
} else {
Ok(dim.size())
Expand Down
1 change: 1 addition & 0 deletions src/tensor/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ impl<T: Scalar, S: Data<Elem = T>, D: Dimension> TensorBase<S, D> {
/// - On device, supports up to 6 dimensional inputs.
/// - [`DeviceLost`]
/// - The kernel could not be dispatched.
///
/// See [`.into_owned()`](TensorBase::into_owned()).
pub fn into_standard_layout(self) -> Result<Tensor<T, D>> {
if self.is_standard_layout() {
Expand Down