Repository Analysis

huggingface/candle

Minimalist ML framework for Rust

2.7 Likely human-written View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of huggingface/candle, a Rust project with 20,662 GitHub stars. SynthScan v2.0 examined 248,237 lines of code across 928 source files, recording 499 pattern matches distributed across 15 syntactic categories. The overall adjusted score of 2.7 places this repository in the Likely human-written band.

The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).

2.7
Adjusted Score
2.7
Raw Score
100%
Time Factor
2026-07-06
Last Push
20.7K
Stars
Rust
Language
248.2K
Lines of Code
928
Files
499
Pattern Hits
2026-07-14
Scan Date
0.00
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.

Severity Breakdown

Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.

CRITICAL 0HIGH 1MEDIUM 63LOW 435

Directory Score Breakdown

This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.

Pattern Findings

The scanner identified 499 distinct pattern matches across 15 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.

Over-Commented Block315 hits · 306 pts
SeverityFileLineSnippetContext
LOWcandle-transformers/src/utils.rs1//! Shared utilities: repeat_kv, repeat_penalty, causal mask.COMMENT
LOWcandle-transformers/src/models/starcoder2.rs1//! StarCoder model implementation with quantization support.COMMENT
LOWcandle-transformers/src/models/quantized_mixformer.rs1//! Module containing quantized MixFormer model implementation.COMMENT
LOWcandle-transformers/src/models/parler_tts.rs1//! Parler Model implementation for parler_tts text-to-speech synthesisCOMMENT
LOWcandle-transformers/src/models/eva2.rs1//! EVA-2 inference implementation.COMMENT
LOWcandle-transformers/src/models/quantized_moondream.rs1//! Implementation of a quantized Moondream vision language model.COMMENT
LOWcandle-transformers/src/models/dinov2.rs1//! Implementation of the DINOv2 models from Meta Research.COMMENT
LOWcandle-transformers/src/models/dinov2.rs21//!COMMENT
LOWcandle-transformers/src/models/csm.rs1//! Implementation of the Conversational Speech Model (CSM) from SesameCOMMENT
LOW…e-transformers/src/models/quantized_recurrent_gemma.rs1//! Recurrent Gemma model implementation with quantization support.COMMENT
LOWcandle-transformers/src/models/quantized_phi.rs1//! Phi2 model implementation with quantization support.COMMENT
LOWcandle-transformers/src/models/mobilenetv4.rs1//! # MobileNet-v4COMMENT
LOWcandle-transformers/src/models/rwkv_v7.rs1//! RWKV v7 "Goose" (x070) model implementation.COMMENT
LOWcandle-transformers/src/models/paligemma.rs1//! Multimodal multi-purpose model combining Gemma-based language model with SigLIP image understandingCOMMENT
LOWcandle-transformers/src/models/t5.rs1//! T5 model implementation.COMMENT
LOWcandle-transformers/src/models/t5.rs21//! ```bashCOMMENT
LOWcandle-transformers/src/models/t5.rs41//! --prompt "<2de> How are you, my friend?" \COMMENT
LOWcandle-transformers/src/models/phi3.rs1//! Microsoft Phi-3 model implementationCOMMENT
LOWcandle-transformers/src/models/bigcode.rs1//! BigCode implementation in Rust based on the GPT-BigCode model.COMMENT
LOWcandle-transformers/src/models/rwkv_v6.rs1//! RWKV v6 model implementation.COMMENT
LOWcandle-transformers/src/models/quantized_blip.rs1//! BLIP model implementation with quantization support.COMMENT
LOWcandle-transformers/src/models/quantized_rwkv_v5.rs1//! RWKV v5 model implementation with quantization support.COMMENT
LOWcandle-transformers/src/models/vgg.rs1//! VGG-16 model implementation.COMMENT
LOWcandle-transformers/src/models/recurrent_gemma.rs1//! Recurrent Gemma model implementationCOMMENT
LOWcandle-transformers/src/models/quantized_mpt.rs1//! Quantized MPT model implementation.COMMENT
LOWcandle-transformers/src/models/stable_lm.rs1//! StableLM model implementation.COMMENT
LOWcandle-transformers/src/models/quantized_stable_lm.rs1//! Module for quantized StableLM implementation.COMMENT
LOWcandle-transformers/src/models/mixtral.rs1//! Mixtral Model, a sparse mixture of expert model based on the Mistral architectureCOMMENT
LOWcandle-transformers/src/models/rwkv_v5.rs1//! RWKV v5 model implementation.COMMENT
LOWcandle-transformers/src/models/rwkv_v5.rs21//! ```bashCOMMENT
LOWcandle-transformers/src/models/olmo.rs1//! OLMo (Open Language Model) implementationCOMMENT
LOWcandle-transformers/src/models/qwen2.rs1//! Qwen2 model implementation with quantization support.COMMENT
LOWcandle-transformers/src/models/mod.rs1//! Candle implementations for various deep learning modelsCOMMENT
LOWcandle-transformers/src/models/dinov2reg4.rs1//! Implementation of the DINOv2 revision (4 regularization)COMMENT
LOWcandle-transformers/src/models/dinov2reg4.rs21//!COMMENT
LOWcandle-transformers/src/models/quantized_rwkv_v6.rs1//! RWKV v6 model implementation with quantization support.COMMENT
LOWcandle-transformers/src/models/phi.rs1//! Microsoft Phi model implementationCOMMENT
LOWcandle-transformers/src/models/convnext.rs1//! ConvNeXt implementation.COMMENT
LOWcandle-transformers/src/models/segformer.rs1//! Segformer model implementation for semantic segmentation and image classification.COMMENT
LOWcandle-transformers/src/models/quantized_gemma3.rs1//! Gemma 3 model implementation with quantization support.COMMENT
LOWcandle-transformers/src/models/qwen2_moe.rs1//! Qwen2 model implementation with Mixture of Experts support.COMMENT
LOWcandle-transformers/src/models/quantized_qwen2.rs1//! Qwen2 model implementation with quantization support.COMMENT
LOWcandle-transformers/src/models/quantized_t5.rs1//! T5 model implementation with quantization support.COMMENT
LOWcandle-transformers/src/models/quantized_blip_text.rs1//! Quantized BLIP text module implementation.COMMENT
LOWcandle-transformers/src/models/quantized_mistral.rs1//! Mistral model implementation with quantization support.COMMENT
LOWcandle-transformers/src/models/bert.rs1//! BERT (Bidirectional Encoder Representations from Transformers)COMMENT
LOWcandle-transformers/src/models/efficientvit.rs1//! EfficientViT (MSRA) inference implementation based on timm.COMMENT
LOWcandle-transformers/src/models/efficientvit.rs21//! --example efficientvit \COMMENT
LOWcandle-transformers/src/models/quantized_llama2_c.rs1//! Quantized Llama2 model implementation.COMMENT
LOWcandle-transformers/src/models/mobileclip.rs1//! Mobile CLIP model, combining a lightweight vision encoder with a text encoderCOMMENT
LOWcandle-transformers/src/models/quantized_llama.rs1//! Quantized llama model implementation.COMMENT
LOWcandle-transformers/src/models/quantized_llama.rs521 span,COMMENT
LOWcandle-transformers/src/models/quantized_llama.rs621COMMENT
LOWcandle-transformers/src/models/trocr.rs1//! TrOCR model implementation.COMMENT
LOWcandle-transformers/src/models/nomic_bert.rs1//! # NomicBERTCOMMENT
LOWcandle-transformers/src/models/mpt.rs1//! Module implementing the MPT (Multi-Purpose Transformer) modelCOMMENT
LOWcandle-transformers/src/models/yi.rs1//! Yi model implementation.COMMENT
LOWcandle-transformers/src/models/quantized_metavoice.rs1//! Quantized MetaVoice model implementation.COMMENT
LOWcandle-transformers/src/models/stella_en_v5.rs1//! Stella v5 model implementation.COMMENT
LOWcandle-transformers/src/models/stella_en_v5.rs501 // state = other_layernorm(xs)COMMENT
255 more matches not shown…
Decorative Section Separators51 hits · 153 pts
SeverityFileLineSnippetContext
MEDIUMcandle-transformers/src/models/rwkv_v7.rs23// ─── Config ──────────────────────────────────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/rwkv_v7.rs77// ─── State ───────────────────────────────────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/rwkv_v7.rs155// ─── Tokenizer ───────────────────────────────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/rwkv_v7.rs159// ─── Helpers ─────────────────────────────────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/rwkv_v7.rs191// ─── TimeMix (Attention) ─────────────────────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/rwkv_v7.rs458// ─── ChannelMix (FFN) ────────────────────────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/rwkv_v7.rs549// ─── DeaAttention (v7b only) ─────────────────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/rwkv_v7.rs724// ─── Block ───────────────────────────────────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/rwkv_v7.rs831// ─── Model ───────────────────────────────────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/quantized_llama.rs604 // ── Mask shape tests ──────────────────────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/quantized_llama.rs622 // ── Mask value tests ──────────────────────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/quantized_llama.rs672 // ── Mask broadcast compatibility test ─────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/gemma4/config.rs5// ── Text config defaults ────────────────────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/gemma4/config.rs50// ── Rope parameters ─────────────────────────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/gemma4/config.rs68// ── Gemma4TextConfig ────────────────────────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/gemma4/config.rs147// ── Vision config defaults ──────────────────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/gemma4/config.rs189// ── Gemma4VisionConfig ──────────────────────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/gemma4/config.rs236// ── Audio config defaults ───────────────────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/gemma4/config.rs302// ── Gemma4AudioConfig ───────────────────────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/gemma4/config.rs374// ── Top-level config defaults ───────────────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/gemma4/config.rs386// ── Gemma4Config ────────────────────────────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/gemma4/vision.rs11// ── RmsNorm (Gemma-style) ───────────────────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/gemma4/vision.rs52// ── 2D Vision Rotary Embedding ──────────────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/gemma4/vision.rs114// ── PatchEmbedder ───────────────────────────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/gemma4/vision.rs185// ── VisionAttention ─────────────────────────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/gemma4/vision.rs275// ── VisionMlp ───────────────────────────────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/gemma4/vision.rs310// ── VisionEncoderLayer ──────────────────────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/gemma4/vision.rs368// ── VisionPooler ────────────────────────────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/gemma4/vision.rs437// ── VisionTower (public) ────────────────────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/gemma4/mod.rs95 // ── Vision embedding injection ──────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/gemma4/mod.rs118 // ── Audio embedding injection ───────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/gemma4/audio.rs11// ── RmsNorm (standard, no +1 offset for audio) ─────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/gemma4/audio.rs41// ── LayerNorm (for SSCP conv blocks) ────────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/gemma4/audio.rs67// ── SSCP Conv Blocks ────────────────────────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/gemma4/audio.rs170// ── SubSampleConvProjection ─────────────────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/gemma4/audio.rs225// ── Relative Position Embedding ─────────────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/gemma4/audio.rs367// ── Conformer Attention ─────────────────────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/gemma4/audio.rs645// ── Conformer FeedForward ───────────────────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/gemma4/audio.rs699// ── Conformer LightConv1d ───────────────────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/gemma4/audio.rs772// ── ConformerBlock ──────────────────────────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/gemma4/audio.rs808// ── AudioModel (public) ─────────────────────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/gemma4/text.rs12// ── RmsNorm (Gemma-style with +1 offset) ────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/gemma4/text.rs53// ── RotaryEmbedding (standard, for sliding layers) ──────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/gemma4/text.rs100// ── ProportionalRotaryEmbedding (for global/full layers) ────────────────────COMMENT
MEDIUMcandle-transformers/src/models/gemma4/text.rs153// ── MLP ─────────────────────────────────────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/gemma4/text.rs192// ── Flash attention ─────────────────────────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/gemma4/text.rs210// ── KvCache ─────────────────────────────────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/gemma4/text.rs218// ── Attention ───────────────────────────────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/gemma4/text.rs386// ── DecoderLayer ────────────────────────────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/gemma4/text.rs477// ── Causal mask ─────────────────────────────────────────────────────────────COMMENT
MEDIUMcandle-transformers/src/models/gemma4/text.rs515// ── TextModel ───────────────────────────────────────────────────────────────COMMENT
Hyper-Verbose Identifiers42 hits · 46 pts
SeverityFileLineSnippetContext
LOWcandle-wasm-examples/quant-qwen3/serve.py85def find_or_download_tokenizer():CODE
LOWcandle-pyo3/stub.py127 def process_additional_function(fn):CODE
LOWcandle-pyo3/tests/native/test_tensor.py8def test_tensor_can_be_constructed():CODE
LOWcandle-pyo3/tests/native/test_tensor.py13def test_tensor_can_be_constructed_from_list():CODE
LOWcandle-pyo3/tests/native/test_tensor.py18def test_tensor_can_be_constructed_from_list_of_lists():CODE
LOWcandle-pyo3/tests/native/test_tensor.py23def test_tensor_can_be_quantized():CODE
LOWcandle-pyo3/tests/native/test_tensor.py43def test_tensor_can_be_indexed():CODE
LOWcandle-pyo3/tests/native/test_tensor.py51def test_tensor_can_be_sliced():CODE
LOWcandle-pyo3/tests/native/test_tensor.py87def test_tensor_supports_equality_operations_with_scalars():CODE
LOWcandle-pyo3/tests/native/test_tensor.py109def test_tensor_supports_equality_operations_with_tensors():CODE
LOWcandle-pyo3/tests/native/test_tensor.py133def test_tensor_equality_operations_can_broadcast():CODE
LOWcandle-pyo3/tests/native/test_tensor.py145def test_tensor_can_be_hashed():CODE
LOWcandle-pyo3/tests/native/test_tensor.py153def test_tensor_can_be_expanded_with_none():CODE
LOWcandle-pyo3/tests/native/test_tensor.py168def test_tensor_can_be_index_via_tensor():CODE
LOWcandle-pyo3/tests/native/test_tensor.py179def test_tensor_can_be_index_via_list():CODE
LOWcandle-pyo3/tests/native/test_tensor.py190def test_tensor_can_be_cast_via_to():CODE
LOWcandle-pyo3/tests/native/test_tensor.py212def test_tensor_can_be_moved_via_to():CODE
LOWcandle-pyo3/tests/native/test_tensor.py234def test_tensor_can_be_moved_and_cast_via_to():CODE
LOWcandle-pyo3/tests/native/test_tensor.py272def test_tensor_can_be_subtracted():CODE
LOWcandle-pyo3/tests/native/test_tensor.py290def test_tensor_can_be_multiplied():CODE
LOWcandle-pyo3/tests/native/test_tensor.py308def test_tensor_can_be_divided():CODE
LOWcandle-pyo3/tests/native/test_utils.py10def test_can_roundtrip_safetensors():CODE
LOWcandle-pyo3/tests/native/test_shape.py6def test_absolute_shapes_are_valid():CODE
LOWcandle-pyo3/tests/native/test_shape.py17def test_relative_shapes_are_valid():CODE
LOWcandle-pyo3/tests/bindings/test_module.py9def test_module_can_be_constructed():CODE
LOWcandle-pyo3/tests/bindings/test_module.py18def test_module_registers_tensors():CODE
LOWcandle-pyo3/tests/bindings/test_module.py30def test_module_registers_submodules():CODE
LOWcandle-pyo3/tests/bindings/test_module.py45def test_module_can_dump_statedict():CODE
LOWcandle-pyo3/tests/bindings/test_module.py61def test_module_can_load_statedict():CODE
LOWcandle-pyo3/tests/bindings/test_module.py77def test_module_throws_on_shape_mismatch():CODE
LOWcandle-pyo3/tests/bindings/test_module.py92def test_module_throws_on_missing_key():CODE
LOWcandle-pyo3/tests/bindings/test_module.py108def test_module_can_load_quantized_tensors():CODE
LOWcandle-pyo3/tests/bindings/test_module.py124def test_module_dequantizes_tensors_automatically():CODE
LOWcandle-pyo3/tests/bindings/test_module.py139def test_module_can_be_moved_to_cuda():CODE
LOWcandle-pyo3/tests/bindings/test_module.py151def test_module_can_be_moved_from_cuda_to_cpu():CODE
LOWcandle-pyo3/tests/bindings/test_linear.py6def test_linear_layer_can_be_constructed():CODE
LOWcandle-pyo3/tests/bindings/test_linear.py11def test_linear_layer_can_forward_a_singular_input():CODE
LOWcandle-pyo3/tests/bindings/test_linear.py18def test_linear_layer_can_forward_a_batched_input():CODE
LOWcandle-pyo3/tests/bindings/test_linear.py25def test_quantized_linear_layer_can_forward_a_singular_input():CODE
LOWcandle-pyo3/tests/bindings/test_linear.py33def test_quantized_linear_layer_can_forward_a_batched_input():CODE
LOWcandle-pyo3/tests/bindings/test_testing.py8def test_assert_equal_asserts_correctly(dtype: candle.DType):CODE
LOWcandle-pyo3/tests/bindings/test_testing.py18def test_assert_almost_equal_asserts_correctly(dtype: candle.DType):CODE
Verbosity Indicators18 hits · 38 pts
SeverityFileLineSnippetContext
LOWcandle-transformers/src/models/z_image/transformer.rs766 // Step 1: Squeeze F dimension: (B, C, 1, H, W) -> (B, C, H, W)COMMENT
LOWcandle-transformers/src/models/z_image/transformer.rs769 // Step 2: Reshape H into (H_tokens, pH): (B, C, H, W) -> (B, C, H_t, pH, W)COMMENT
LOWcandle-transformers/src/models/z_image/transformer.rs772 // Step 3: Reshape W into (W_tokens, pW): (B, C, H_t, pH, W) -> (B, C, H_t, pH, W_t, pW)COMMENT
LOWcandle-transformers/src/models/z_image/transformer.rs775 // Step 4: Permute to match Python: (C, H_t, pH, W_t, pW) -> (H_t, W_t, pH, pW, C)COMMENT
LOWcandle-transformers/src/models/z_image/transformer.rs780 // Step 5: Reshape to patches: (B, H_t, W_t, pH, pW, C) -> (B, H_t*W_t, pH*pW*C)COMMENT
LOWcandle-transformers/src/models/z_image/transformer.rs823 // Step 1: Reshape to (B, H_t, W_t, pH, pW, C)COMMENT
LOWcandle-transformers/src/models/z_image/transformer.rs826 // Step 2: Permute to match Python: (H_t, W_t, pH, pW, C) -> (C, H_t, pH, W_t, pW)COMMENT
LOWcandle-transformers/src/models/z_image/transformer.rs831 // Step 3: Reshape to combine H and W: (B, C, H_t, pH, W_t, pW) -> (B, C, H, W)COMMENT
LOWcandle-transformers/src/models/z_image/transformer.rs834 // Step 4: Add back F dimension: (B, C, H, W) -> (B, C, 1, H, W)COMMENT
LOWcandle-transformers/src/models/paddleocr_vl/mod.rs915 // Step 1: Get text embeddingsCOMMENT
LOWcandle-transformers/src/models/paddleocr_vl/mod.rs923 // Step 2: Encode imagesCOMMENT
LOWcandle-transformers/src/models/paddleocr_vl/mod.rs934 // Step 3: Merge vision embeddings into text embeddingsCOMMENT
LOWcandle-transformers/src/models/paddleocr_vl/mod.rs956 // Step 4: Compute M-RoPE position IDsCOMMENT
LOWcandle-transformers/src/models/paddleocr_vl/mod.rs979 // Step 5: Forward through text model with exportCOMMENT
LOWcandle-transformers/src/models/paddleocr_vl/mod.rs1014 // Step 0: Prefill with imageCOMMENT
LOWcandle-core/tests/pth.py20# Step 1: Create a 3D NumPy array with Fortran order using a range of numbersCOMMENT
LOWcandle-core/tests/pth.py28# Step 2: Convert the NumPy array to a PyTorch tensorCOMMENT
LOWcandle-core/tests/pth.py34# Step 3: Save the PyTorch tensor to a .pth fileCOMMENT
Structural Annotation Overuse18 hits · 38 pts
SeverityFileLineSnippetContext
LOWcandle-transformers/src/models/z_image/transformer.rs766 // Step 1: Squeeze F dimension: (B, C, 1, H, W) -> (B, C, H, W)COMMENT
LOWcandle-transformers/src/models/z_image/transformer.rs769 // Step 2: Reshape H into (H_tokens, pH): (B, C, H, W) -> (B, C, H_t, pH, W)COMMENT
LOWcandle-transformers/src/models/z_image/transformer.rs772 // Step 3: Reshape W into (W_tokens, pW): (B, C, H_t, pH, W) -> (B, C, H_t, pH, W_t, pW)COMMENT
LOWcandle-transformers/src/models/z_image/transformer.rs775 // Step 4: Permute to match Python: (C, H_t, pH, W_t, pW) -> (H_t, W_t, pH, pW, C)COMMENT
LOWcandle-transformers/src/models/z_image/transformer.rs780 // Step 5: Reshape to patches: (B, H_t, W_t, pH, pW, C) -> (B, H_t*W_t, pH*pW*C)COMMENT
LOWcandle-transformers/src/models/z_image/transformer.rs823 // Step 1: Reshape to (B, H_t, W_t, pH, pW, C)COMMENT
LOWcandle-transformers/src/models/z_image/transformer.rs826 // Step 2: Permute to match Python: (H_t, W_t, pH, pW, C) -> (C, H_t, pH, W_t, pW)COMMENT
LOWcandle-transformers/src/models/z_image/transformer.rs831 // Step 3: Reshape to combine H and W: (B, C, H_t, pH, W_t, pW) -> (B, C, H, W)COMMENT
LOWcandle-transformers/src/models/z_image/transformer.rs834 // Step 4: Add back F dimension: (B, C, H, W) -> (B, C, 1, H, W)COMMENT
LOWcandle-transformers/src/models/paddleocr_vl/mod.rs915 // Step 1: Get text embeddingsCOMMENT
LOWcandle-transformers/src/models/paddleocr_vl/mod.rs923 // Step 2: Encode imagesCOMMENT
LOWcandle-transformers/src/models/paddleocr_vl/mod.rs934 // Step 3: Merge vision embeddings into text embeddingsCOMMENT
LOWcandle-transformers/src/models/paddleocr_vl/mod.rs956 // Step 4: Compute M-RoPE position IDsCOMMENT
LOWcandle-transformers/src/models/paddleocr_vl/mod.rs979 // Step 5: Forward through text model with exportCOMMENT
LOWcandle-transformers/src/models/paddleocr_vl/mod.rs1014 // Step 0: Prefill with imageCOMMENT
LOWcandle-core/tests/pth.py20# Step 1: Create a 3D NumPy array with Fortran order using a range of numbersCOMMENT
LOWcandle-core/tests/pth.py28# Step 2: Convert the NumPy array to a PyTorch tensorCOMMENT
LOWcandle-core/tests/pth.py34# Step 3: Save the PyTorch tensor to a .pth fileCOMMENT
Unused Imports26 hits · 26 pts
SeverityFileLineSnippetContext
LOWcandle-wasm-examples/quant-qwen3/serve.py10CODE
LOWcandle-pyo3/e5.py8CODE
LOWcandle-pyo3/py_src/candle/__init__.py4CODE
LOWcandle-pyo3/py_src/candle/__init__.py49CODE
LOWcandle-pyo3/py_src/candle/nn/linear.py1CODE
LOWcandle-pyo3/py_src/candle/nn/__init__.py1CODE
LOWcandle-pyo3/py_src/candle/nn/__init__.py2CODE
LOWcandle-pyo3/py_src/candle/nn/__init__.py2CODE
LOWcandle-pyo3/py_src/candle/nn/__init__.py2CODE
LOWcandle-pyo3/py_src/candle/nn/__init__.py3CODE
LOWcandle-pyo3/py_src/candle/nn/__init__.py4CODE
LOWcandle-pyo3/py_src/candle/nn/__init__.py5CODE
LOWcandle-pyo3/py_src/candle/nn/container.py3CODE
LOWcandle-pyo3/py_src/candle/nn/sparse.py2CODE
LOWcandle-pyo3/py_src/candle/nn/sparse.py2CODE
LOWcandle-pyo3/py_src/candle/nn/sparse.py2CODE
LOWcandle-pyo3/py_src/candle/nn/normalization.py4CODE
LOWcandle-pyo3/py_src/candle/nn/normalization.py4CODE
LOWcandle-pyo3/py_src/candle/models/llama.py3CODE
LOWcandle-pyo3/tests/native/test_utils.py2CODE
LOWcandle-pyo3/tests/native/test_utils.py2CODE
LOWcandle-pyo3/tests/native/test_shape.py1CODE
LOWcandle-pyo3/tests/bindings/test_linear.py2CODE
LOWcandle-examples/examples/flux/t5_tokenizer.py1CODE
LOWcandle-examples/examples/resnet/export_models.py2CODE
LOWcandle-examples/examples/resnet/export_models.py3CODE
Excessive Try-Catch Wrapping8 hits · 14 pts
SeverityFileLineSnippetContext
MEDIUMcandle-wasm-examples/quant-qwen3/serve.py12 print("Error: Required packages not installed", file=sys.stderr)CODE
LOWcandle-wasm-examples/quant-qwen3/serve.py50 except Exception as e:CODE
MEDIUMcandle-wasm-examples/quant-qwen3/serve.py51 print(f"Error downloading {filename}: {e}", file=sys.stderr)CODE
MEDIUMcandle-wasm-examples/quant-qwen3/serve.py60 print(f"Error: Custom path does not exist: {custom_path}", file=sys.stderr)CODE
LOWcandle-wasm-examples/quant-qwen3/serve.py142 except Exception as e:CODE
MEDIUMcandle-wasm-examples/quant-qwen3/serve.py133def send_file(self, filepath, content_type):CODE
LOWcandle-pyo3/py_src/candle/nn/module.py462 except Exception as ex:STRING
LOW…es/examples/marian-mt/python/convert_slow_tokenizer.py43 except Exception:CODE
AI Slop Vocabulary4 hits · 12 pts
SeverityFileLineSnippetContext
MEDIUMcandle-transformers/src/models/rwkv_v7.rs66/// This is more robust than computing from a formula, as differentCOMMENT
MEDIUMcandle-transformers/src/models/rwkv_v5.rs72 // Certainly a weird convention but taken from modeling_rwkv5.pyCOMMENT
MEDIUMcandle-transformers/src/models/segment_anything/mod.rs4//! in an image based on prompts like points or boxes. //! This model provides a robust and fast image segmentation pipeCOMMENT
MEDIUMcandle-nn/src/loss.rs78/// A robust loss function that combines `MAE` and `MSE` losses:COMMENT
Self-Referential Comments3 hits · 10 pts
SeverityFileLineSnippetContext
MEDIUMcandle-pyo3/tests/native/test_tensor.py134 # Create a decoder attention mask as a test caseCOMMENT
MEDIUMcandle-core/tests/pth.py17# Create a tensor with fortran contiguous memory layoutCOMMENT
MEDIUM…ples/examples/reinforcement-learning/atari_wrappers.py303# Create the environment.COMMENT
Deep Nesting8 hits · 8 pts
SeverityFileLineSnippetContext
LOWcandle-pyo3/stub.py87CODE
LOWcandle-pyo3/py_src/candle/nn/container.py136CODE
LOWcandle-pyo3/py_src/candle/nn/container.py153CODE
LOWcandle-pyo3/py_src/candle/nn/module.py97CODE
LOWcandle-pyo3/py_src/candle/nn/module.py391CODE
LOWcandle-pyo3/py_src/candle/nn/module.py592CODE
LOWcandle-pyo3/py_src/candle/nn/module.py659CODE
LOW…ples/examples/reinforcement-learning/atari_wrappers.py232CODE
Synthetic Comment Markers1 hit · 8 pts
SeverityFileLineSnippetContext
HIGHcandle-examples/examples/quantized-lfm2/main.rs41 /// GGUF file to load, typically a .gguf file generated by llama.cpp.COMMENT
Modern AI Meta-Vocabulary1 hit · 3 pts
SeverityFileLineSnippetContext
MEDIUMcandle-examples/examples/stella-en-v5/README.md1# candle-stella-en-v5: Implementation of [stella_en_1.5B_v5](https://huggingface.co/dunzhang/stella_en_1.5B_v5) embeddinCOMMENT
Fake / Example Data2 hits · 2 pts
SeverityFileLineSnippetContext
LOWcandle-transformers/src/models/voxtral/model.rs901 let dummy_token = Tensor::new(&[1u32], &config.device)?;CODE
LOWcandle-transformers/src/models/voxtral/model.rs902 let dummy_embed = self.language_model.embed(&dummy_token)?;CODE
Modern Structural Boilerplate1 hit · 1 pts
SeverityFileLineSnippetContext
LOWcandle-pyo3/py_src/candle/nn/container.py19__all__ = ["Sequential", "ModuleList", "ModuleDict"]CODE
Redundant / Tautological Comments1 hit · 0 pts
SeverityFileLineSnippetContext
LOWcandle-pyo3/stub.py37 # Check if we have a return type annotation in the docstringSTRING