diff --git a/Cargo.lock b/Cargo.lock index e2a177e3dd..687c2bcf2e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -739,7 +739,7 @@ dependencies = [ "thiserror 2.0.12", "tracing-core", "tracing-subscriber", - "zip 2.6.1", + "zip 3.0.0", ] [[package]] @@ -1248,7 +1248,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "117725a109d387c937a1533ce01b450cbde6b88abceea8473c4d7a85853cda3c" dependencies = [ "lazy_static", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -1257,7 +1257,7 @@ version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fde0e0ec90c9dfb3b4b1a0891a7dcd0e2bffde2f7efed5fe7c9bb00e5bfb915e" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -2246,7 +2246,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "976dd42dc7e85965fe702eb8164f21f450704bdde31faefd6471dba214cb594e" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -2365,6 +2365,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ced92e76e966ca2fd84c8f7aa01a4aea65b0eb6648d72f7c8f3e2764a67fece" dependencies = [ "crc32fast", + "libz-rs-sys", "miniz_oxide", ] @@ -3721,7 +3722,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" dependencies = [ "cfg-if", - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] @@ -3752,6 +3753,15 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "libz-rs-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6489ca9bd760fe9642d7644e827b0c9add07df89857b0416ee15c1cc1a3b8c5a" +dependencies = [ + "zlib-rs", +] + [[package]] name = "linux-raw-sys" version = "0.4.15" @@ -5514,7 +5524,7 @@ dependencies = [ "once_cell", "socket2", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -6085,7 +6095,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys 0.4.15", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -6098,7 +6108,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys 0.9.4", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -6657,7 +6667,7 @@ dependencies = [ "cfg-if", "libc", "psm", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -6897,7 +6907,7 @@ dependencies = [ "getrandom 0.3.3", "once_cell", "rustix 1.0.7", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -7988,7 +7998,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -8667,16 +8677,15 @@ dependencies = [ [[package]] name = "zip" -version = "2.6.1" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dcb24d0152526ae49b9b96c1dcf71850ca1e0b882e4e28ed898a93c41334744" +checksum = "12598812502ed0105f607f941c386f43d441e00148fce9dec3ca5ffb0bde9308" dependencies = [ "aes", "arbitrary", "bzip2 0.5.2", "constant_time_eq 0.3.1", "crc32fast", - "crossbeam-utils", "deflate64", "flate2", "getrandom 0.3.3", @@ -8693,6 +8702,12 @@ dependencies = [ "zstd 0.13.3", ] +[[package]] +name = "zlib-rs" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "868b928d7949e09af2f6086dfc1e01936064cc7a819253bce650d4e2a2d63ba8" + [[package]] name = "zopfli" version = "0.8.2" diff --git a/Cargo.toml b/Cargo.toml index 0d5bc84f54..271ca7a980 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -88,7 +88,7 @@ tokio = { version = "1.44.2", features = ["rt", "macros"] } tracing-appender = "0.2.3" tracing-core = "0.1.33" tracing-subscriber = "0.3.19" -zip = "2.6.1" +zip = "3.0.0" # Async handling async-channel = "2.3" diff --git a/crates/burn-cubecl-fusion/src/base.rs b/crates/burn-cubecl-fusion/src/base.rs index 0eb77419e5..1bac797e06 100644 --- a/crates/burn-cubecl-fusion/src/base.rs +++ b/crates/burn-cubecl-fusion/src/base.rs @@ -15,6 +15,7 @@ use serde::{Deserialize, Serialize}; /// Fusion optimization type for cubecl. /// /// More optimization variants should be added here. +#[allow(clippy::large_enum_variant)] pub enum CubeOptimization { /// Element wise optimization. ElementWise(ElemwiseOptimization), @@ -26,6 +27,7 @@ pub enum CubeOptimization { /// Fusion optimization state type for cubecl. /// /// More optimization variants should be added here. +#[allow(clippy::large_enum_variant)] #[derive(Serialize, Deserialize)] pub enum CubeOptimizationState { /// Element wise state. diff --git a/crates/burn-dataset/src/dataset/sqlite.rs b/crates/burn-dataset/src/dataset/sqlite.rs index bc39ef6f69..ad3230d619 100644 --- a/crates/burn-dataset/src/dataset/sqlite.rs +++ b/crates/burn-dataset/src/dataset/sqlite.rs @@ -339,14 +339,13 @@ impl SqliteDatasetStorage { /// /// * A `PathBuf` instance representing the file path. pub fn db_file(&self) -> PathBuf { - let db_file = match &self.db_file { + match &self.db_file { Some(db_file) => db_file.clone(), None => { let name = sanitize(self.name.as_ref().expect("Name is not set")); Self::base_dir(self.base_dir.to_owned()).join(format!("{name}.db")) } - }; - db_file + } } /// Determines the base directory for storing the dataset. diff --git a/crates/burn-dataset/src/vision/image_folder.rs b/crates/burn-dataset/src/vision/image_folder.rs index edf08d343a..f6a8201600 100644 --- a/crates/burn-dataset/src/vision/image_folder.rs +++ b/crates/burn-dataset/src/vision/image_folder.rs @@ -142,7 +142,8 @@ fn segmentation_mask_to_vec_usize(mask_path: &PathBuf) -> Vec { // Image as Vec // if rgb8 or rgb16, keep only the first channel assuming all channels are the same - let img_vec = match image.color() { + + match image.color() { ColorType::L8 => image.into_luma8().iter().map(|&x| x as usize).collect(), ColorType::L16 => image.into_luma16().iter().map(|&x| x as usize).collect(), ColorType::Rgb8 => image @@ -158,9 +159,7 @@ fn segmentation_mask_to_vec_usize(mask_path: &PathBuf) -> Vec { .map(|&x| x as usize) .collect(), _ => panic!("Unrecognized image color type"), - }; - - img_vec + } } /// Parse the image annotation to the corresponding type. diff --git a/crates/burn-fusion/src/stream/store/index.rs b/crates/burn-fusion/src/stream/store/index.rs index c383be300f..3dce4f9010 100644 --- a/crates/burn-fusion/src/stream/store/index.rs +++ b/crates/burn-fusion/src/stream/store/index.rs @@ -72,12 +72,10 @@ impl ExecutionPlanIndex { None => return Vec::new(), }; - let val = match self.starters.get(*index) { + match self.starters.get(*index) { Some(value) => value.clone(), None => Vec::new(), - }; - - val + } } /// Update the index for an execution plan starting with operation `ops` diff --git a/crates/burn-tch/src/tensor.rs b/crates/burn-tch/src/tensor.rs index f0e03debd0..7cfa359d1e 100644 --- a/crates/burn-tch/src/tensor.rs +++ b/crates/burn-tch/src/tensor.rs @@ -169,7 +169,7 @@ impl TchTensor { /// Returns `true` if the tensor's stride does not contain zero (no broadcasting) /// and the storage can be mutated. pub fn can_mut(&self) -> bool { - let stride_contains_zero = self.tensor.stride().iter().any(|&s| s == 0); + let stride_contains_zero = self.tensor.stride().contains(&0); !stride_contains_zero && self.storage.can_mut() } diff --git a/crates/burn-tensor/src/tensor/api/base.rs b/crates/burn-tensor/src/tensor/api/base.rs index a5abf3b9a1..117944731e 100644 --- a/crates/burn-tensor/src/tensor/api/base.rs +++ b/crates/burn-tensor/src/tensor/api/base.rs @@ -1651,8 +1651,8 @@ where /// If the tensor doesn't have one element. pub async fn into_scalar_async(self) -> K::Elem { check!(TensorCheck::into_scalar::(&self.shape())); - let x = self.into_data_async().await.iter().next().unwrap(); - x + + self.into_data_async().await.iter().next().unwrap() } /// Broadcast the tensor to the given shape. @@ -3076,7 +3076,7 @@ impl BroadcastArgs for [E; .rev() .collect(); - if new_shape.iter().any(|&x| x == 0) { + if new_shape.contains(&0) { panic!("Cannot substitute -1 for a non-existing dimension"); } diff --git a/crates/burn-train/src/renderer/tui/metric_numeric.rs b/crates/burn-train/src/renderer/tui/metric_numeric.rs index 70e3871b89..d0392c51e5 100644 --- a/crates/burn-train/src/renderer/tui/metric_numeric.rs +++ b/crates/burn-train/src/renderer/tui/metric_numeric.rs @@ -176,6 +176,7 @@ impl NumericMetricsState { } } +#[allow(clippy::large_enum_variant)] #[derive(new)] pub(crate) enum NumericMetricView<'a> { Plots(&'a [String], usize, Chart<'a>, PlotKind), diff --git a/crates/onnx-ir/src/node/unsqueeze.rs b/crates/onnx-ir/src/node/unsqueeze.rs index 38f58a5700..0d18d843b9 100644 --- a/crates/onnx-ir/src/node/unsqueeze.rs +++ b/crates/onnx-ir/src/node/unsqueeze.rs @@ -17,7 +17,7 @@ pub fn unsqueeze_update_output(node: &mut Node) { None => None, } } else { - let axes = node.attrs.get("axes").cloned().map(|v| { + node.attrs.get("axes").cloned().map(|v| { let axes = v.into_i64s(); log::debug!( "Unsqueeze axes from attribute for {}: {:?}", @@ -25,8 +25,7 @@ pub fn unsqueeze_update_output(node: &mut Node) { axes ); axes - }); - axes + }) }; let input_rank = match &node.inputs[0].ty {