Repository Analysis

huggingface/candle

Minimalist ML framework for Rust

2.7 Likely human-written View on GitHub
2.7
Adjusted Score
2.7
Raw Score
100%
Time Factor
2026-05-29
Last Push
20,375
Stars
Rust
Language
242,571
Lines of Code
920
Files
485
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 0HIGH 8MEDIUM 62LOW 415

Pattern Findings

485 matches across 12 categories. Click a row to expand file-level details.

Over-Commented Block316 hits · 306 pts
SeverityFileLineSnippet
LOWcandle-transformers/src/utils.rs1//! Shared utilities: repeat_kv, repeat_penalty, causal mask.
LOWcandle-transformers/src/models/starcoder2.rs1//! StarCoder model implementation with quantization support.
LOWcandle-transformers/src/models/quantized_mixformer.rs1//! Module containing quantized MixFormer model implementation.
LOWcandle-transformers/src/models/parler_tts.rs1//! Parler Model implementation for parler_tts text-to-speech synthesis
LOWcandle-transformers/src/models/eva2.rs1//! EVA-2 inference implementation.
LOWcandle-transformers/src/models/quantized_moondream.rs1//! Implementation of a quantized Moondream vision language model.
LOWcandle-transformers/src/models/dinov2.rs1//! Implementation of the DINOv2 models from Meta Research.
LOWcandle-transformers/src/models/dinov2.rs21//!
LOWcandle-transformers/src/models/csm.rs1//! Implementation of the Conversational Speech Model (CSM) from Sesame
LOW…e-transformers/src/models/quantized_recurrent_gemma.rs1//! Recurrent Gemma model implementation with quantization support.
LOWcandle-transformers/src/models/quantized_phi.rs1//! Phi2 model implementation with quantization support.
LOWcandle-transformers/src/models/mobilenetv4.rs1//! # MobileNet-v4
LOWcandle-transformers/src/models/rwkv_v7.rs1//! RWKV v7 "Goose" (x070) model implementation.
LOWcandle-transformers/src/models/paligemma.rs1//! Multimodal multi-purpose model combining Gemma-based language model with SigLIP image understanding
LOWcandle-transformers/src/models/t5.rs1//! T5 model implementation.
LOWcandle-transformers/src/models/t5.rs21//! ```bash
LOWcandle-transformers/src/models/t5.rs41//! --prompt "<2de> How are you, my friend?" \
LOWcandle-transformers/src/models/phi3.rs1//! Microsoft Phi-3 model implementation
LOWcandle-transformers/src/models/bigcode.rs1//! BigCode implementation in Rust based on the GPT-BigCode model.
LOWcandle-transformers/src/models/rwkv_v6.rs1//! RWKV v6 model implementation.
LOWcandle-transformers/src/models/quantized_blip.rs1//! BLIP model implementation with quantization support.
LOWcandle-transformers/src/models/quantized_rwkv_v5.rs1//! RWKV v5 model implementation with quantization support.
LOWcandle-transformers/src/models/vgg.rs1//! VGG-16 model implementation.
LOWcandle-transformers/src/models/recurrent_gemma.rs1//! Recurrent Gemma model implementation
LOWcandle-transformers/src/models/quantized_mpt.rs1//! Quantized MPT model implementation.
LOWcandle-transformers/src/models/stable_lm.rs1//! StableLM model implementation.
LOWcandle-transformers/src/models/quantized_stable_lm.rs1//! Module for quantized StableLM implementation.
LOWcandle-transformers/src/models/mixtral.rs1//! Mixtral Model, a sparse mixture of expert model based on the Mistral architecture
LOWcandle-transformers/src/models/rwkv_v5.rs1//! RWKV v5 model implementation.
LOWcandle-transformers/src/models/rwkv_v5.rs21//! ```bash
LOWcandle-transformers/src/models/olmo.rs1//! OLMo (Open Language Model) implementation
LOWcandle-transformers/src/models/qwen2.rs1//! Qwen2 model implementation with quantization support.
LOWcandle-transformers/src/models/mod.rs1//! Candle implementations for various deep learning models
LOWcandle-transformers/src/models/dinov2reg4.rs1//! Implementation of the DINOv2 revision (4 regularization)
LOWcandle-transformers/src/models/dinov2reg4.rs21//!
LOWcandle-transformers/src/models/quantized_rwkv_v6.rs1//! RWKV v6 model implementation with quantization support.
LOWcandle-transformers/src/models/phi.rs1//! Microsoft Phi model implementation
LOWcandle-transformers/src/models/convnext.rs1//! ConvNeXt implementation.
LOWcandle-transformers/src/models/segformer.rs1//! Segformer model implementation for semantic segmentation and image classification.
LOWcandle-transformers/src/models/quantized_gemma3.rs1//! Gemma 3 model implementation with quantization support.
LOWcandle-transformers/src/models/qwen2_moe.rs1//! Qwen2 model implementation with Mixture of Experts support.
LOWcandle-transformers/src/models/quantized_qwen2.rs1//! Qwen2 model implementation with quantization support.
LOWcandle-transformers/src/models/quantized_t5.rs1//! T5 model implementation with quantization support.
LOWcandle-transformers/src/models/quantized_blip_text.rs1//! Quantized BLIP text module implementation.
LOWcandle-transformers/src/models/quantized_mistral.rs1//! Mistral model implementation with quantization support.
LOWcandle-transformers/src/models/bert.rs1//! BERT (Bidirectional Encoder Representations from Transformers)
LOWcandle-transformers/src/models/efficientvit.rs1//! EfficientViT (MSRA) inference implementation based on timm.
LOWcandle-transformers/src/models/efficientvit.rs21//! --example efficientvit \
LOWcandle-transformers/src/models/quantized_llama2_c.rs1//! Quantized Llama2 model implementation.
LOWcandle-transformers/src/models/mobileclip.rs1//! Mobile CLIP model, combining a lightweight vision encoder with a text encoder
LOWcandle-transformers/src/models/quantized_llama.rs1//! Quantized llama model implementation.
LOWcandle-transformers/src/models/quantized_llama.rs521 span,
LOWcandle-transformers/src/models/quantized_llama.rs621
LOWcandle-transformers/src/models/trocr.rs1//! TrOCR model implementation.
LOWcandle-transformers/src/models/nomic_bert.rs1//! # NomicBERT
LOWcandle-transformers/src/models/mpt.rs1//! Module implementing the MPT (Multi-Purpose Transformer) model
LOWcandle-transformers/src/models/yi.rs1//! Yi model implementation.
LOWcandle-transformers/src/models/quantized_metavoice.rs1//! Quantized MetaVoice model implementation.
LOWcandle-transformers/src/models/stella_en_v5.rs1//! Stella v5 model implementation.
LOWcandle-transformers/src/models/stella_en_v5.rs501 // state = other_layernorm(xs)
256 more matches not shown…
Decorative Section Separators51 hits · 153 pts
SeverityFileLineSnippet
MEDIUMcandle-transformers/src/models/rwkv_v7.rs23// ─── Config ──────────────────────────────────────────────────────────────────
MEDIUMcandle-transformers/src/models/rwkv_v7.rs77// ─── State ───────────────────────────────────────────────────────────────────
MEDIUMcandle-transformers/src/models/rwkv_v7.rs155// ─── Tokenizer ───────────────────────────────────────────────────────────────
MEDIUMcandle-transformers/src/models/rwkv_v7.rs159// ─── Helpers ─────────────────────────────────────────────────────────────────
MEDIUMcandle-transformers/src/models/rwkv_v7.rs191// ─── TimeMix (Attention) ─────────────────────────────────────────────────────
MEDIUMcandle-transformers/src/models/rwkv_v7.rs458// ─── ChannelMix (FFN) ────────────────────────────────────────────────────────
MEDIUMcandle-transformers/src/models/rwkv_v7.rs549// ─── DeaAttention (v7b only) ─────────────────────────────────────────────────
MEDIUMcandle-transformers/src/models/rwkv_v7.rs724// ─── Block ───────────────────────────────────────────────────────────────────
MEDIUMcandle-transformers/src/models/rwkv_v7.rs831// ─── Model ───────────────────────────────────────────────────────────────────
MEDIUMcandle-transformers/src/models/quantized_llama.rs604 // ── Mask shape tests ──────────────────────────────────────────────────────
MEDIUMcandle-transformers/src/models/quantized_llama.rs622 // ── Mask value tests ──────────────────────────────────────────────────────
MEDIUMcandle-transformers/src/models/quantized_llama.rs672 // ── Mask broadcast compatibility test ─────────────────────────────────────
MEDIUMcandle-transformers/src/models/gemma4/config.rs5// ── Text config defaults ────────────────────────────────────────────────────
MEDIUMcandle-transformers/src/models/gemma4/config.rs50// ── Rope parameters ─────────────────────────────────────────────────────────
MEDIUMcandle-transformers/src/models/gemma4/config.rs68// ── Gemma4TextConfig ────────────────────────────────────────────────────────
MEDIUMcandle-transformers/src/models/gemma4/config.rs147// ── Vision config defaults ──────────────────────────────────────────────────
MEDIUMcandle-transformers/src/models/gemma4/config.rs189// ── Gemma4VisionConfig ──────────────────────────────────────────────────────
MEDIUMcandle-transformers/src/models/gemma4/config.rs236// ── Audio config defaults ───────────────────────────────────────────────────
MEDIUMcandle-transformers/src/models/gemma4/config.rs302// ── Gemma4AudioConfig ───────────────────────────────────────────────────────
MEDIUMcandle-transformers/src/models/gemma4/config.rs374// ── Top-level config defaults ───────────────────────────────────────────────
MEDIUMcandle-transformers/src/models/gemma4/config.rs386// ── Gemma4Config ────────────────────────────────────────────────────────────
MEDIUMcandle-transformers/src/models/gemma4/vision.rs11// ── RmsNorm (Gemma-style) ───────────────────────────────────────────────────
MEDIUMcandle-transformers/src/models/gemma4/vision.rs52// ── 2D Vision Rotary Embedding ──────────────────────────────────────────────
MEDIUMcandle-transformers/src/models/gemma4/vision.rs114// ── PatchEmbedder ───────────────────────────────────────────────────────────
MEDIUMcandle-transformers/src/models/gemma4/vision.rs185// ── VisionAttention ─────────────────────────────────────────────────────────
MEDIUMcandle-transformers/src/models/gemma4/vision.rs275// ── VisionMlp ───────────────────────────────────────────────────────────────
MEDIUMcandle-transformers/src/models/gemma4/vision.rs310// ── VisionEncoderLayer ──────────────────────────────────────────────────────
MEDIUMcandle-transformers/src/models/gemma4/vision.rs368// ── VisionPooler ────────────────────────────────────────────────────────────
MEDIUMcandle-transformers/src/models/gemma4/vision.rs437// ── VisionTower (public) ────────────────────────────────────────────────────
MEDIUMcandle-transformers/src/models/gemma4/mod.rs95 // ── Vision embedding injection ──────────────────────────────────
MEDIUMcandle-transformers/src/models/gemma4/mod.rs118 // ── Audio embedding injection ───────────────────────────────────
MEDIUMcandle-transformers/src/models/gemma4/audio.rs11// ── RmsNorm (standard, no +1 offset for audio) ─────────────────────────────
MEDIUMcandle-transformers/src/models/gemma4/audio.rs41// ── LayerNorm (for SSCP conv blocks) ────────────────────────────────────────
MEDIUMcandle-transformers/src/models/gemma4/audio.rs67// ── SSCP Conv Blocks ────────────────────────────────────────────────────────
MEDIUMcandle-transformers/src/models/gemma4/audio.rs170// ── SubSampleConvProjection ─────────────────────────────────────────────────
MEDIUMcandle-transformers/src/models/gemma4/audio.rs225// ── Relative Position Embedding ─────────────────────────────────────────────
MEDIUMcandle-transformers/src/models/gemma4/audio.rs367// ── Conformer Attention ─────────────────────────────────────────────────────
MEDIUMcandle-transformers/src/models/gemma4/audio.rs645// ── Conformer FeedForward ───────────────────────────────────────────────────
MEDIUMcandle-transformers/src/models/gemma4/audio.rs699// ── Conformer LightConv1d ───────────────────────────────────────────────────
MEDIUMcandle-transformers/src/models/gemma4/audio.rs772// ── ConformerBlock ──────────────────────────────────────────────────────────
MEDIUMcandle-transformers/src/models/gemma4/audio.rs808// ── AudioModel (public) ─────────────────────────────────────────────────────
MEDIUMcandle-transformers/src/models/gemma4/text.rs12// ── RmsNorm (Gemma-style with +1 offset) ────────────────────────────────────
MEDIUMcandle-transformers/src/models/gemma4/text.rs53// ── RotaryEmbedding (standard, for sliding layers) ──────────────────────────
MEDIUMcandle-transformers/src/models/gemma4/text.rs100// ── ProportionalRotaryEmbedding (for global/full layers) ────────────────────
MEDIUMcandle-transformers/src/models/gemma4/text.rs153// ── MLP ─────────────────────────────────────────────────────────────────────
MEDIUMcandle-transformers/src/models/gemma4/text.rs192// ── Flash attention ─────────────────────────────────────────────────────────
MEDIUMcandle-transformers/src/models/gemma4/text.rs210// ── KvCache ─────────────────────────────────────────────────────────────────
MEDIUMcandle-transformers/src/models/gemma4/text.rs218// ── Attention ───────────────────────────────────────────────────────────────
MEDIUMcandle-transformers/src/models/gemma4/text.rs386// ── DecoderLayer ────────────────────────────────────────────────────────────
MEDIUMcandle-transformers/src/models/gemma4/text.rs477// ── Causal mask ─────────────────────────────────────────────────────────────
MEDIUMcandle-transformers/src/models/gemma4/text.rs515// ── TextModel ───────────────────────────────────────────────────────────────
Hyper-Verbose Identifiers42 hits · 46 pts
SeverityFileLineSnippet
LOWcandle-wasm-examples/quant-qwen3/serve.py85def find_or_download_tokenizer():
LOWcandle-pyo3/stub.py127 def process_additional_function(fn):
LOWcandle-pyo3/tests/native/test_tensor.py8def test_tensor_can_be_constructed():
LOWcandle-pyo3/tests/native/test_tensor.py13def test_tensor_can_be_constructed_from_list():
LOWcandle-pyo3/tests/native/test_tensor.py18def test_tensor_can_be_constructed_from_list_of_lists():
LOWcandle-pyo3/tests/native/test_tensor.py23def test_tensor_can_be_quantized():
LOWcandle-pyo3/tests/native/test_tensor.py43def test_tensor_can_be_indexed():
LOWcandle-pyo3/tests/native/test_tensor.py51def test_tensor_can_be_sliced():
LOWcandle-pyo3/tests/native/test_tensor.py87def test_tensor_supports_equality_operations_with_scalars():
LOWcandle-pyo3/tests/native/test_tensor.py109def test_tensor_supports_equality_operations_with_tensors():
LOWcandle-pyo3/tests/native/test_tensor.py133def test_tensor_equality_operations_can_broadcast():
LOWcandle-pyo3/tests/native/test_tensor.py145def test_tensor_can_be_hashed():
LOWcandle-pyo3/tests/native/test_tensor.py153def test_tensor_can_be_expanded_with_none():
LOWcandle-pyo3/tests/native/test_tensor.py168def test_tensor_can_be_index_via_tensor():
LOWcandle-pyo3/tests/native/test_tensor.py179def test_tensor_can_be_index_via_list():
LOWcandle-pyo3/tests/native/test_tensor.py190def test_tensor_can_be_cast_via_to():
LOWcandle-pyo3/tests/native/test_tensor.py212def test_tensor_can_be_moved_via_to():
LOWcandle-pyo3/tests/native/test_tensor.py234def test_tensor_can_be_moved_and_cast_via_to():
LOWcandle-pyo3/tests/native/test_tensor.py272def test_tensor_can_be_subtracted():
LOWcandle-pyo3/tests/native/test_tensor.py290def test_tensor_can_be_multiplied():
LOWcandle-pyo3/tests/native/test_tensor.py308def test_tensor_can_be_divided():
LOWcandle-pyo3/tests/native/test_utils.py10def test_can_roundtrip_safetensors():
LOWcandle-pyo3/tests/native/test_shape.py6def test_absolute_shapes_are_valid():
LOWcandle-pyo3/tests/native/test_shape.py17def test_relative_shapes_are_valid():
LOWcandle-pyo3/tests/bindings/test_module.py9def test_module_can_be_constructed():
LOWcandle-pyo3/tests/bindings/test_module.py18def test_module_registers_tensors():
LOWcandle-pyo3/tests/bindings/test_module.py30def test_module_registers_submodules():
LOWcandle-pyo3/tests/bindings/test_module.py45def test_module_can_dump_statedict():
LOWcandle-pyo3/tests/bindings/test_module.py61def test_module_can_load_statedict():
LOWcandle-pyo3/tests/bindings/test_module.py77def test_module_throws_on_shape_mismatch():
LOWcandle-pyo3/tests/bindings/test_module.py92def test_module_throws_on_missing_key():
LOWcandle-pyo3/tests/bindings/test_module.py108def test_module_can_load_quantized_tensors():
LOWcandle-pyo3/tests/bindings/test_module.py124def test_module_dequantizes_tensors_automatically():
LOWcandle-pyo3/tests/bindings/test_module.py139def test_module_can_be_moved_to_cuda():
LOWcandle-pyo3/tests/bindings/test_module.py151def test_module_can_be_moved_from_cuda_to_cpu():
LOWcandle-pyo3/tests/bindings/test_linear.py6def test_linear_layer_can_be_constructed():
LOWcandle-pyo3/tests/bindings/test_linear.py11def test_linear_layer_can_forward_a_singular_input():
LOWcandle-pyo3/tests/bindings/test_linear.py18def test_linear_layer_can_forward_a_batched_input():
LOWcandle-pyo3/tests/bindings/test_linear.py25def test_quantized_linear_layer_can_forward_a_singular_input():
LOWcandle-pyo3/tests/bindings/test_linear.py33def test_quantized_linear_layer_can_forward_a_batched_input():
LOWcandle-pyo3/tests/bindings/test_testing.py8def test_assert_equal_asserts_correctly(dtype: candle.DType):
LOWcandle-pyo3/tests/bindings/test_testing.py18def test_assert_almost_equal_asserts_correctly(dtype: candle.DType):
Verbosity Indicators18 hits · 36 pts
SeverityFileLineSnippet
LOWcandle-transformers/src/models/z_image/transformer.rs766 // Step 1: Squeeze F dimension: (B, C, 1, H, W) -> (B, C, H, W)
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)
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)
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)
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)
LOWcandle-transformers/src/models/z_image/transformer.rs823 // Step 1: Reshape to (B, H_t, W_t, pH, pW, C)
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)
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)
LOWcandle-transformers/src/models/z_image/transformer.rs834 // Step 4: Add back F dimension: (B, C, H, W) -> (B, C, 1, H, W)
LOWcandle-transformers/src/models/paddleocr_vl/mod.rs915 // Step 1: Get text embeddings
LOWcandle-transformers/src/models/paddleocr_vl/mod.rs923 // Step 2: Encode images
LOWcandle-transformers/src/models/paddleocr_vl/mod.rs934 // Step 3: Merge vision embeddings into text embeddings
LOWcandle-transformers/src/models/paddleocr_vl/mod.rs956 // Step 4: Compute M-RoPE position IDs
LOWcandle-transformers/src/models/paddleocr_vl/mod.rs979 // Step 5: Forward through text model with export
LOWcandle-transformers/src/models/paddleocr_vl/mod.rs1014 // Step 0: Prefill with image
LOWcandle-core/tests/pth.py20# Step 1: Create a 3D NumPy array with Fortran order using a range of numbers
LOWcandle-core/tests/pth.py28# Step 2: Convert the NumPy array to a PyTorch tensor
LOWcandle-core/tests/pth.py34# Step 3: Save the PyTorch tensor to a .pth file
Cross-File Repetition7 hits · 35 pts
SeverityFileLineSnippet
HIGHcandle-pyo3/_additional_typing/__init__.py0compare a tensor with a scalar or one tensor with another.
HIGHcandle-pyo3/_additional_typing/__init__.py0compare a tensor with a scalar or one tensor with another.
HIGHcandle-pyo3/_additional_typing/__init__.py0compare a tensor with a scalar or one tensor with another.
HIGHcandle-pyo3/_additional_typing/__init__.py0compare a tensor with a scalar or one tensor with another.
HIGHcandle-pyo3/_additional_typing/__init__.py0compare a tensor with a scalar or one tensor with another.
HIGHcandle-pyo3/_additional_typing/__init__.py0compare a tensor with a scalar or one tensor with another.
HIGHcandle-pyo3/_additional_typing/__init__.py0compare a tensor with a scalar or one tensor with another.
Unused Imports26 hits · 26 pts
SeverityFileLineSnippet
LOWcandle-wasm-examples/quant-qwen3/serve.py10
LOWcandle-pyo3/e5.py8
LOWcandle-pyo3/py_src/candle/__init__.py4
LOWcandle-pyo3/py_src/candle/__init__.py49
LOWcandle-pyo3/py_src/candle/nn/linear.py1
LOWcandle-pyo3/py_src/candle/nn/__init__.py1
LOWcandle-pyo3/py_src/candle/nn/__init__.py2
LOWcandle-pyo3/py_src/candle/nn/__init__.py2
LOWcandle-pyo3/py_src/candle/nn/__init__.py2
LOWcandle-pyo3/py_src/candle/nn/__init__.py3
LOWcandle-pyo3/py_src/candle/nn/__init__.py4
LOWcandle-pyo3/py_src/candle/nn/__init__.py5
LOWcandle-pyo3/py_src/candle/nn/container.py3
LOWcandle-pyo3/py_src/candle/nn/sparse.py2
LOWcandle-pyo3/py_src/candle/nn/sparse.py2
LOWcandle-pyo3/py_src/candle/nn/sparse.py2
LOWcandle-pyo3/py_src/candle/nn/normalization.py4
LOWcandle-pyo3/py_src/candle/nn/normalization.py4
LOWcandle-pyo3/py_src/candle/models/llama.py3
LOWcandle-pyo3/tests/native/test_utils.py2
LOWcandle-pyo3/tests/native/test_utils.py2
LOWcandle-pyo3/tests/native/test_shape.py1
LOWcandle-pyo3/tests/bindings/test_linear.py2
LOWcandle-examples/examples/flux/t5_tokenizer.py1
LOWcandle-examples/examples/resnet/export_models.py2
LOWcandle-examples/examples/resnet/export_models.py3
Excessive Try-Catch Wrapping8 hits · 14 pts
SeverityFileLineSnippet
MEDIUMcandle-wasm-examples/quant-qwen3/serve.py12 print("Error: Required packages not installed", file=sys.stderr)
LOWcandle-wasm-examples/quant-qwen3/serve.py50 except Exception as e:
MEDIUMcandle-wasm-examples/quant-qwen3/serve.py51 print(f"Error downloading {filename}: {e}", file=sys.stderr)
MEDIUMcandle-wasm-examples/quant-qwen3/serve.py60 print(f"Error: Custom path does not exist: {custom_path}", file=sys.stderr)
LOWcandle-wasm-examples/quant-qwen3/serve.py142 except Exception as e:
MEDIUMcandle-wasm-examples/quant-qwen3/serve.py133def send_file(self, filepath, content_type):
LOWcandle-pyo3/py_src/candle/nn/module.py462 except Exception as ex:
LOW…es/examples/marian-mt/python/convert_slow_tokenizer.py43 except Exception:
AI Slop Vocabulary4 hits · 12 pts
SeverityFileLineSnippet
MEDIUMcandle-transformers/src/models/rwkv_v7.rs66/// This is more robust than computing from a formula, as different
MEDIUMcandle-transformers/src/models/rwkv_v5.rs72 // Certainly a weird convention but taken from modeling_rwkv5.py
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 pipe
MEDIUMcandle-nn/src/loss.rs78/// A robust loss function that combines `MAE` and `MSE` losses:
Self-Referential Comments3 hits · 10 pts
SeverityFileLineSnippet
MEDIUMcandle-pyo3/tests/native/test_tensor.py134 # Create a decoder attention mask as a test case
MEDIUMcandle-core/tests/pth.py17# Create a tensor with fortran contiguous memory layout
MEDIUM…ples/examples/reinforcement-learning/atari_wrappers.py303# Create the environment.
Deep Nesting8 hits · 8 pts
SeverityFileLineSnippet
LOWcandle-pyo3/stub.py87
LOWcandle-pyo3/py_src/candle/nn/container.py136
LOWcandle-pyo3/py_src/candle/nn/container.py153
LOWcandle-pyo3/py_src/candle/nn/module.py97
LOWcandle-pyo3/py_src/candle/nn/module.py391
LOWcandle-pyo3/py_src/candle/nn/module.py592
LOWcandle-pyo3/py_src/candle/nn/module.py659
LOW…ples/examples/reinforcement-learning/atari_wrappers.py232
Synthetic Comment Markers1 hit · 8 pts
SeverityFileLineSnippet
HIGHcandle-examples/examples/quantized-lfm2/main.rs41 /// GGUF file to load, typically a .gguf file generated by llama.cpp.
Redundant / Tautological Comments1 hit · 0 pts
SeverityFileLineSnippet
LOWcandle-pyo3/stub.py37 # Check if we have a return type annotation in the docstring