diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3779e44..3762d98 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/src/learn/neural_network/layer/conv_direct.rs b/src/learn/neural_network/layer/conv_direct.rs index f163324..d45d30a 100644 --- a/src/learn/neural_network/layer/conv_direct.rs +++ b/src/learn/neural_network/layer/conv_direct.rs @@ -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() { @@ -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() { diff --git a/src/tensor.rs b/src/tensor.rs index 3b36f24..3675ab1 100644 --- a/src/tensor.rs +++ b/src/tensor.rs @@ -220,7 +220,7 @@ fn size_of_shape_checked(dim: &D) -> Result { .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()) diff --git a/src/tensor/ops.rs b/src/tensor/ops.rs index 5ddf811..c124b56 100644 --- a/src/tensor/ops.rs +++ b/src/tensor/ops.rs @@ -161,6 +161,7 @@ impl, D: Dimension> TensorBase { /// - 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> { if self.is_standard_layout() {