Repository Analysis

tracel-ai/burn

Burn is a next generation tensor library and Deep Learning Framework that doesn't compromise on flexibility, efficiency and portability.

4.5 Likely human-written View on GitHub
4.5
Adjusted Score
4.5
Raw Score
100%
Time Factor
2026-05-29
Last Push
15,286
Stars
Rust
Language
361,710
Lines of Code
1835
Files
1485
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 6HIGH 0MEDIUM 81LOW 1398

Pattern Findings

1485 matches across 11 categories. Click a row to expand file-level details.

Over-Commented Block1355 hits · 1198 pts
SeverityFileLineSnippet
LOWCargo.toml221### For the main burn branch. ###
LOWdeny.toml21# output a note when they are encountered.
LOWdeny.toml41# The default lint level for `default` features for external crates that are not
LOWcrates/burn-rl/src/transition_buffer/base.rs21/// A batch of transitions.
LOWcrates/burn-rl/src/transition_buffer/slice_access.rs1use burn_core::prelude::*;
LOWcrates/burn-tensor/src/device.rs21 doc = "Wrap a device with [`.autodiff()`](Device::autodiff) to enable automatic differentiation with the device."
LOWcrates/burn-tensor/src/device.rs41/// let device = Device::wgpu(DeviceKind::DiscreteGpu(0));
LOWcrates/burn-tensor/src/device.rs121 /// Wrap a backend-specific device in a unified [`Device`].
LOWcrates/burn-tensor/src/device.rs161/// shorthand is to pass a plain integer literal:
LOWcrates/burn-tensor/src/device.rs221 Self::Specified(usize::try_from(i).expect("device index must be non-negative"))
LOWcrates/burn-tensor/src/device.rs241 /// Virtual GPU with the given index. The index is the index of the virtual GPU in the list of
LOWcrates/burn-tensor/src/device.rs341 Self::new(device)
LOWcrates/burn-tensor/src/device.rs361 /// Vulkan-backed WGPU device, selected via [`DeviceKind`].
LOWcrates/burn-tensor/src/device.rs381 #[cfg(feature = "webgpu")]
LOWcrates/burn-tensor/src/device.rs401 ///
LOWcrates/burn-tensor/src/device.rs441 }
LOWcrates/burn-tensor/src/device.rs461 }
LOWcrates/burn-tensor/src/device.rs481 /// to this specific device. It is guaranteed that at least this device will be seeded.
LOWcrates/burn-tensor/src/device.rs521
LOWcrates/burn-tensor/src/device.rs541 ///
LOWcrates/burn-tensor/src/device.rs641/// `DeviceType` is used to filter the available device types for [`Device::enumerate`].
LOWcrates/burn-tensor/src/device.rs661 #[cfg(feature = "ndarray")]
LOWcrates/burn-tensor/src/lib.rs1#![cfg_attr(not(feature = "std"), no_std)]
LOWcrates/burn-tensor/src/lib.rs21//! ```
LOWcrates/burn-tensor/src/server.rs1//! Remote-execution server entry points.
LOWcrates/burn-tensor/src/server.rs21/// Transport used to serve remote clients.
LOWcrates/burn-tensor/src/bridge/kind.rs21mod sealed {
LOWcrates/burn-tensor/src/bridge/kind.rs81}
LOWcrates/burn-tensor/src/bridge/kind.rs141 /// A floating-point tensor.
LOWcrates/burn-tensor/src/bridge/ops/base.rs21 /// This is a low-level function used internally by the library to call different backend functions
LOWcrates/burn-tensor/src/bridge/ops/base.rs41 /// # Returns
LOWcrates/burn-tensor/src/bridge/ops/base.rs61 /// * `dtype` - The target data type.
LOWcrates/burn-tensor/src/bridge/ops/base.rs81 /// * `shape` - The shape of the tensor.
LOWcrates/burn-tensor/src/bridge/ops/base.rs101 /// # Arguments
LOWcrates/burn-tensor/src/bridge/ops/base.rs121
LOWcrates/burn-tensor/src/bridge/ops/base.rs141 fn reshape(tensor: BridgeTensor, shape: Shape) -> BridgeTensor;
LOWcrates/burn-tensor/src/bridge/ops/base.rs161 ///
LOWcrates/burn-tensor/src/bridge/ops/base.rs181 /// # Arguments
LOWcrates/burn-tensor/src/bridge/ops/base.rs201 ///
LOWcrates/burn-tensor/src/bridge/ops/base.rs221 ///
LOWcrates/burn-tensor/src/bridge/ops/base.rs241 ///
LOWcrates/burn-tensor/src/bridge/ops/base.rs261 /// * `tensor` - The tensor to assign elements to.
LOWcrates/burn-tensor/src/bridge/ops/base.rs281 /// function, which is more high-level and designed for public use.
LOWcrates/burn-tensor/src/bridge/ops/base.rs301 /// corresponding element of the left hand side tensor if the corresponding element of the mask
LOWcrates/burn-tensor/src/bridge/ops/base.rs321 /// * `value` - The value to fill elements with when the corresponding element of the mask is true.
LOWcrates/burn-tensor/src/bridge/ops/base.rs341 /// # Arguments
LOWcrates/burn-tensor/src/bridge/ops/base.rs361
LOWcrates/burn-tensor/src/bridge/ops/base.rs401 ) -> BridgeTensor;
LOWcrates/burn-tensor/src/bridge/ops/base.rs421 ///
LOWcrates/burn-tensor/src/bridge/ops/base.rs441 /// or use this function directly.
LOWcrates/burn-tensor/src/bridge/ops/base.rs461 /// with static dispatch. It is not designed for direct usage by users, and not recommended to import
LOWcrates/burn-tensor/src/bridge/ops/base.rs481 /// This is a low-level function used internally by the library to call different backend functions
LOWcrates/burn-tensor/src/bridge/ops/base.rs501 /// # Remarks
LOWcrates/burn-tensor/src/bridge/ops/base.rs521 ///
LOWcrates/burn-tensor/src/bridge/ops/base.rs541 /// The tensor of booleans indicating whether the corresponding elements are equal.
LOWcrates/burn-tensor/src/bridge/ops/base.rs561 ///
LOWcrates/burn-tensor/src/bridge/ops/base.rs581 ///
LOWcrates/burn-tensor/src/bridge/ops/base.rs601 /// * `rhs` - The right hand side scalar.
LOWcrates/burn-tensor/src/bridge/ops/base.rs621 ///
LOWcrates/burn-tensor/src/bridge/ops/base.rs641 /// * dim - The axis along which to test.
1295 more matches not shown…
Decorative Section Separators61 hits · 256 pts
SeverityFileLineSnippet
MEDIUMcrates/burn-store/src/burnpack/mod.rs18//! ┌──────────────────────────────────┐
MEDIUMcrates/burn-store/src/burnpack/mod.rs20//! ├──────────────────────────────────┤
MEDIUMcrates/burn-store/src/burnpack/mod.rs24//! ├──────────────────────────────────┤
MEDIUMcrates/burn-store/src/burnpack/mod.rs26//! ├──────────────────────────────────┤
MEDIUMcrates/burn-store/src/burnpack/mod.rs35//! ├──────────────────────────────────┤
MEDIUMcrates/burn-store/src/burnpack/mod.rs37//! ├──────────────────────────────────┤
MEDIUMcrates/burn-store/src/burnpack/mod.rs40//! └──────────────────────────────────┘
MEDIUMexamples/custom-image-dataset/src/model.rs13// ┌────────────────────┐
MEDIUMexamples/custom-image-dataset/src/model.rs23// └────────────────────┘
MEDIUM.github/workflows/stale-pr.yml19 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/dependencies.yml29 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/dependencies.yml34 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/dependencies.yml39 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/dependencies.yml45 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/dependencies.yml52 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/test.yml72 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/test.yml78 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/test.yml81 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/test.yml89 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/test.yml92 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/test.yml108 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/test.yml114 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/test.yml117 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/test.yml140 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/test.yml148 # # --------------------------------------------------------------------------------
MEDIUM.github/workflows/test.yml156 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/test.yml159 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/test.yml164 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/test.yml186 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/test.yml192 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/test.yml195 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/test.yml236 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/test.yml242 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/test.yml245 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/test.yml212 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/test.yml218 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/vulnerabilities.yml23 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/vulnerabilities.yml29 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/vulnerabilities.yml32 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/vulnerabilities.yml40 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/vulnerabilities.yml50 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/vulnerabilities.yml56 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/vulnerabilities.yml59 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/vulnerabilities.yml72 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/vulnerabilities.yml78 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/vulnerabilities.yml81 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/vulnerabilities.yml94 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/vulnerabilities.yml100 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/vulnerabilities.yml103 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/vulnerabilities.yml116 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/vulnerabilities.yml122 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/vulnerabilities.yml125 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/test-gpu.yml78 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/test-gpu.yml84 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/test-gpu.yml116 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/test-gpu.yml122 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/test-gpu.yml154 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/test-gpu.yml160 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/valgrind.yml26 # --------------------------------------------------------------------------------
MEDIUM.github/workflows/valgrind.yml29 # --------------------------------------------------------------------------------
1 more matches not shown…
Hallucination Indicators6 hits · 60 pts
SeverityFileLineSnippet
CRITICAL…es/burn-cubecl-fusion/src/optim/reduce/optimization.rs282 self.info.trace_read_fallback.resources.outputs.len()
CRITICAL…ecl-fusion/src/optim/reduce_broadcasted/fuser/block.rs101 self.fuser.fuser.fuser.fuser.num_multi_block_local_inputs() > 0;
CRITICALcrates/burn-nn/src/modules/rnn/gru.rs337 let bias = self.forward.update_gate.input_transform.bias.is_some();
CRITICALcrates/burn-nn/src/modules/rnn/lstm.rs358 let bias = self.forward.input_gate.input_transform.bias.is_some();
CRITICALcrates/burn-nn/src/modules/rnn/basic.rs274 let [d_input, _] = self.forward.gate.input_transform.weight.shape().dims();
CRITICALcrates/burn-nn/src/modules/rnn/basic.rs275 let bias = self.forward.gate.input_transform.bias.is_some();
Self-Referential Comments10 hits · 30 pts
SeverityFileLineSnippet
MEDIUM…h-tests/tests/non_contiguous_indexes/export_weights.py12 # Create a list to store the layers
MEDIUMcrates/burn-store/benches/download_resnet18.py26 # Create a temporary directory for the model
MEDIUMcrates/burn-store/benches/generate_unified_models.py39 # Create a model with 20 layers matching the Rust LargeModel
MEDIUMcrates/burn-store/benches/generate_unified_models.py130 # Create the large model
MEDIUM…src/pytorch/tests/reader/create_legacy_with_offsets.py12# Create a state dict with tensors that share storage
MEDIUM…src/pytorch/tests/reader/create_legacy_with_offsets.py16# Create a base tensor with known pattern
MEDIUM…s/burn-store/src/pytorch/tests/reader/simple_legacy.py9# Create a simple state dict
MEDIUM…rn-store/src/pytorch/tests/reader/create_tar_format.py265 # Create the three main entries
MEDIUMcrates/burn-dataset/src/source/huggingface/importer.py48 # Create the database connection descriptor (sqlite)
MEDIUMcrates/burn-backend-tests/tests/autodiff/sign.rs6// >>> # Create a tensor with requires_grad=True
Verbosity Indicators17 hits · 29 pts
SeverityFileLineSnippet
LOWcrates/burn-store/src/keyremapper.rs232 // Step 1: Collect all paths and find all index positions
LOWcrates/burn-train/src/metric/vision/lpips/weights.rs86 // Step 1: Load backbone ImageNet weights
LOWcrates/burn-train/src/metric/vision/lpips/weights.rs96 // Step 2: Load LPIPS linear layer weights
LOWcrates/burn-train/src/metric/vision/dists/weights.rs60 // Step 1: Download and load VGG16 ImageNet backbone weights
LOWcrates/burn-train/src/metric/vision/dists/weights.rs68 // Step 2: Download DISTS alpha/beta weights
LOWcrates/burn-flex/src/ops/attention.rs509 // Step 1: Score matmul via gemm
LOWcrates/burn-flex/src/ops/attention.rs536 // Step 2: Apply scale/softcap/mask/bias, online softmax, rescale output
LOWcrates/burn-flex/src/ops/attention.rs609 // Step 3: Value matmul via gemm
LOWcrates/burn-optim/src/optim/muon.rs305 // Step 1: Transpose if tall matrix (more rows than columns)
LOWcrates/burn-optim/src/optim/muon.rs312 // Step 2: Normalize by Frobenius norm
LOWcrates/burn-optim/src/optim/muon.rs324 // Step 3: Newton-Schulz iteration
LOWcrates/burn-optim/src/optim/muon.rs341 // Step 4: Restore transpose if it was a tall matrix
LOWcrates/burn-optim/src/optim/muon.rs392 // Step 1: Apply momentum
LOWcrates/burn-optim/src/optim/muon.rs396 // Step 2: Orthogonalize via Newton-Schulz
LOWcrates/burn-optim/src/optim/muon.rs399 // Step 3: Adjust learning rate based on parameter shape
LOWcrates/burn-optim/src/optim/muon.rs402 // Step 4: Apply weight decay (using ORIGINAL lr, not adjusted)
LOWcrates/burn-optim/src/optim/muon.rs411 // Step 5: Update parameter (using ADJUSTED lr)
AI Slop Vocabulary9 hits · 27 pts
SeverityFileLineSnippet
MEDIUMcrates/burn-dispatch/src/backend.rs34/// Essentially, [`Dispatch`] is the single entry point for executing tensor operations
MEDIUMcrates/burn/src/lib.rs34//! Burn strives to be as fast as possible on as many hardwares as possible, with robust implementations.
MEDIUMcrates/burn/src/lib.rs68//! the model to learn representations that are more robust to reduced precision.
MEDIUMcrates/burn-backend/src/backend/ops/modules/unfold.rs11/// The idea behind using convolution for unfolding is to leverage the sliding window mechanism of
MEDIUMcrates/burn-fusion/src/stream/execution/tests.rs3//! The primary focus is on validating the seamless interaction between these three components to
MEDIUMcrates/burn-nn/src/loss/lp_loss.rs28 /// - `p = 1.0`: L1 loss (MAE with mean reduction) - robust to outliers
MEDIUMcrates/burn-nn/src/loss/lp_loss.rs31 /// - `0 < p < 1`: More robust to outliers than L1 (quasi-norm)
MEDIUMcrates/burn-nn/src/loss/lp_loss.rs309 // L0.5 quasi-norm: more robust to outliers than L1
MEDIUMcrates/burn-nn/src/modules/rope_encoding.rs110 // Essentially a cache of pre-computed RoPE values.
Unused Imports21 hits · 21 pts
SeverityFileLineSnippet
LOW…urn-store/pytorch-tests/tests/conv1d/export_weights.py5
LOW…rch-tests/tests/missing_module_field/export_weights.py5
LOW…urn-store/pytorch-tests/tests/conv2d/export_weights.py5
LOW…-store/pytorch-tests/tests/embedding/export_weights.py5
LOW…store/pytorch-tests/tests/layer_norm/export_weights.py5
LOW…re/pytorch-tests/tests/top_level_key/export_weights.py5
LOW…-store/pytorch-tests/tests/key_remap/export_weights.py5
LOW…pytorch-tests/tests/conv_transpose2d/export_weights.py5
LOW…pytorch-tests/tests/conv_transpose1d/export_weights.py5
LOW…store/pytorch-tests/tests/group_norm/export_weights.py5
LOW…rn-store/pytorch-tests/tests/boolean/export_weights.py5
LOW…rn-store/pytorch-tests/tests/integer/export_weights.py5
LOW…h-tests/tests/non_contiguous_indexes/export_weights.py5
LOW…store/pytorch-tests/tests/batch_norm/export_weights.py5
LOW…urn-store/pytorch-tests/tests/buffer/export_weights.py5
LOWcrates/burn-store/benches/download_resnet18.py15
LOWcrates/burn-store/benches/generate_unified_models.py22
LOW…rn-store/src/pytorch/tests/reader/create_tar_format.py19
LOWcrates/burn-store/src/pytorch/tests/reader/test_data.py11
LOWcrates/burn-store/src/pytorch/tests/reader/test_data.py12
LOW…les/import-model-weights/weights/mnist_train_export.py6
Hyper-Verbose Identifiers3 hits · 3 pts
SeverityFileLineSnippet
LOW…rn-store/src/pytorch/tests/reader/create_tar_format.py80def create_storages_blob_manual(tensors: list) -> bytes:
LOW…rn-store/src/pytorch/tests/reader/create_tar_format.py130def create_main_pickle_manual(tensors_info: list) -> bytes:
LOW…rc/pytorch/tests/store/test_data/generate_enum_test.py50def generate_enum_variant_mismatch_test():
Slop Phrases1 hit · 3 pts
SeverityFileLineSnippet
MEDIUMexamples/custom-image-dataset/src/training.rs99 // NOTE: we use the CIFAR-10 test set as validation for demonstration purposes
Redundant / Tautological Comments1 hit · 2 pts
SeverityFileLineSnippet
LOWcrates/burn-store/benches/download_resnet18.py32 # Check if already downloaded
Excessive Try-Catch Wrapping1 hit · 1 pts
SeverityFileLineSnippet
LOWcrates/burn-store/benches/download_resnet18.py66 except Exception as e: