Repository Analysis

google/flax

Flax is a neural network library for JAX that is designed for flexibility.

17.9 Moderate AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of google/flax, a Jupyter Notebook project with 7,307 GitHub stars. SynthScan v2.0 examined 161,626 lines of code across 479 source files, recording 2403 pattern matches distributed across 23 syntactic categories. The overall adjusted score of 17.9 places this repository in the Moderate AI signal 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).

17.9
Adjusted Score
17.9
Raw Score
100%
Time Factor
2026-08-24
Last Push
7.3K
Stars
Jupyter Notebook
Language
161.6K
Lines of Code
479
Files
2.4K
Pattern Hits
2026-08-29
Scan Date
0.24
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

Longitudinal tracking requires multiple scan runs. Once this repository is re-scanned after new commits land, this chart will visualise how the synthetic code signal evolves over time — enabling you to detect whether AI authorship is growing, stabilising, or being actively corrected by human engineers.

No multi-scan history yet — run the scanner again to build trend data.

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 1HIGH 113MEDIUM 187LOW 2102

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 2403 distinct pattern matches across 23 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.

Hyper-Verbose Identifiers885 hits · 737 pts
SeverityFileLineSnippetContext
LOWtests/traceback_util_test.py49 def test_simple_exclusion_tracebackhide(self):CODE
LOWtests/traceback_util_test.py87 def test_simple_exclusion_remove_frames(self):CODE
LOWtests/struct_test.py87 def test_wrap_pytree_node_no_error(self):CODE
LOWtests/struct_test.py125 def test_metadata_pass_through(self):CODE
LOWtests/struct_test.py160 def test_generic_pytreenode_base_order(self):CODE
LOWtests/pickle_test.py22 def test_exception_can_be_pickled(self):CODE
LOWtests/jax_utils_test.py84 def test_min_device_batch_avoids_recompile(self, dtype):CODE
LOWtests/checkpoints_test.py106 def test_save_restore_checkpoints(self, use_orbax):CODE
LOWtests/checkpoints_test.py176 def test_overwrite_checkpoints(self, use_orbax):CODE
LOWtests/checkpoints_test.py232 def test_save_restore_checkpoints_w_float_steps(self, use_orbax):CODE
LOWtests/checkpoints_test.py266 def test_save_restore_checkpoints_target_none(self, use_orbax):CODE
LOWtests/checkpoints_test.py288 def test_save_restore_checkpoints_target_singular(self, use_orbax):CODE
LOWtests/checkpoints_test.py307 def test_save_restore_checkpoints_target_empty(self, use_orbax):CODE
LOWtests/checkpoints_test.py324 def test_async_save_checkpoints(self):CODE
LOWtests/traverse_util_test.py68 def test_traverse_tuple_items(self):CODE
LOWtests/traverse_util_test.py75 def test_traverse_namedtuple_item(self):CODE
LOWtests/traverse_util_test.py89 def test_traverse_namedtuple_attr(self):CODE
LOWtests/traverse_util_test.py96 def test_traverse_dataclass_attr(self):CODE
LOWtests/traverse_util_test.py196 def test_flatten_dict_keep_empty(self):CODE
LOWtests/traverse_util_test.py210 def test_flatten_dict_is_leaf(self):CODE
LOWtests/traverse_util_test.py227 def test_only_works_on_model_params(self):CODE
LOWtests/traverse_util_test.py284 def test_path_aware_map_with_multi_transform(self):CODE
LOWtests/traverse_util_test.py314 def test_path_aware_map_with_masked(self):CODE
LOWtests/traverse_util_test.py342 def test_path_aware_map_with_empty_nodes(self):CODE
LOWtests/tensorboard_test.py51 def parse_and_return_summary_value(self, path):CODE
LOWtests/tensorboard_test.py69 def test_summarywriter_flush_after_close(self):CODE
LOWtests/tensorboard_test.py76 def test_summarywriter_scalar(self):CODE
LOWtests/tensorboard_test.py116 def test_summarywriter_image_float_pixel_values(self):CODE
LOWtests/tensorboard_test.py145 def test_summarywriter_single_channel_image_scaled(self):CODE
LOWtests/tensorboard_test.py158 def test_summarywriter_multiple_images(self):CODE
LOWtests/tensorboard_test.py218 def test_summarywriter_audio_sampled_output(self):CODE
LOWtests/tensorboard_test.py244 def test_summarywriter_clipped_audio(self):CODE
LOWtests/tensorboard_test.py272 def test_summarywriter_histogram_defaultbins(self):CODE
LOWtests/serialization_test.py109 def test_dataclass_serialization(self):CODE
LOWtests/serialization_test.py128 def test_pass_through_serialization(self):CODE
LOWtests/serialization_test.py163 def test_partial_serialization(self):CODE
LOWtests/serialization_test.py170 def test_optimizer_serialization(self):CODE
LOWtests/serialization_test.py195 def test_collection_serialization(self):CODE
LOWtests/serialization_test.py314 def test_jax_numpy_serialization(self):CODE
LOWtests/serialization_test.py344 def test_complex_serialization(self):CODE
LOWtests/serialization_test.py383 def test_namedtuple_serialization(self):CODE
LOWtests/serialization_test.py392 def test_namedtuple_restore_legacy(self):CODE
LOWtests/serialization_test.py405 def test_model_serialization_to_bytes(self):CODE
LOWtests/serialization_test.py413 def test_optimizer_serialization_to_bytes(self):CODE
LOWtests/serialization_test.py424 def test_serialization_chunking(self):CODE
LOWtests/serialization_test.py526 def test_serialization_errors(self, target, wrong_target, msg):CODE
LOWtests/cursor_test.py594 def test_apply_update_root_node_unmodified(self):CODE
LOWtests/cursor_test.py658 def test_named_tuple_multi_access(self):CODE
LOWtests/core/core_meta_test.py84 def test_partition_axis_unspecified(self):CODE
LOWtests/core/core_meta_test.py188 def test_boxed_param_with_mesh(self):CODE
LOWtests/core/core_frozen_dict_test.py41 def test_frozen_dict_partially_maps(self):CODE
LOWtests/core/core_frozen_dict_test.py79 def test_frozen_dict_copy_reserved_name(self):CODE
LOWtests/core/core_frozen_dict_test.py132 def test_utility_copy_singlearg(self, x):CODE
LOWtests/core/core_lift_test.py234 def test_subscope_var_aliasing(self):CODE
LOWtests/core/core_scope_test.py121 def test_inconsistent_param_shapes(self):CODE
LOWtests/core/core_scope_test.py133 def test_apply_variables_bad_pytree(self):CODE
LOWtests/core/core_scope_test.py151 def test_mutate_undefined_collection(self):CODE
LOWtests/core/core_scope_test.py178 def test_rngs_check_w_frozen_dict(self):CODE
LOWtests/core/core_scope_test.py184 def test_rng_check_w_old_and_new_keys(self):CODE
LOWtests/core/core_scope_test.py201 def test_rng_check_w_lazy_rng(self):CODE
825 more matches not shown…
Decorative Section Separators148 hits · 458 pts
SeverityFileLineSnippetContext
MEDIUMtests/nnx/mutable_array_test.py1040 # ------------COMMENT
MEDIUMtests/nnx/mutable_array_test.py1042 # ------------COMMENT
MEDIUMtests/nnx/mutable_array_test.py1111 # ------------COMMENT
MEDIUMtests/nnx/mutable_array_test.py1113 # ------------COMMENT
MEDIUMflax/core/spmd.py100# ------------------------------------------------------------------------------COMMENT
MEDIUMflax/nnx/pytreelib.py904 # -------------------------COMMENT
MEDIUMflax/nnx/pytreelib.py906 # -------------------------COMMENT
MEDIUMflax/nnx/pytreelib.py984 # -------------------------COMMENT
MEDIUMflax/nnx/pytreelib.py986 # -------------------------COMMENT
MEDIUMflax/nnx/spmd.py33# ------------------------------------------------------------------------------COMMENT
MEDIUMflax/nnx/spmd.py116# ------------------------------------------------------------------------------COMMENT
MEDIUMflax/nnx/spmd.py172# ------------------------------------------------------------------------------COMMENT
MEDIUMflax/nnx/rnglib.py162 # ----------------------------------------------------------COMMENT
MEDIUMflax/nnx/rnglib.py164 # ----------------------------------------------------------COMMENT
MEDIUMflax/nnx/rnglib.py296 # ----------------------------------------------------------COMMENT
MEDIUMflax/nnx/rnglib.py298 # ----------------------------------------------------------COMMENT
MEDIUMflax/nnx/rnglib.py613 # ----------------------------------------------------------COMMENT
MEDIUMflax/nnx/rnglib.py615 # ----------------------------------------------------------COMMENT
MEDIUMflax/nnx/rnglib.py747 # ----------------------------------------------------------COMMENT
MEDIUMflax/nnx/rnglib.py749 # ----------------------------------------------------------COMMENT
MEDIUMflax/nnx/variablelib.py270# ---------------------------------COMMENT
MEDIUMflax/nnx/variablelib.py272# ---------------------------------COMMENT
MEDIUMflax/nnx/variablelib.py527# ---------------------------------COMMENT
MEDIUMflax/nnx/variablelib.py529# ---------------------------------COMMENT
MEDIUMflax/nnx/variablelib.py733 # --------------------------------------------COMMENT
MEDIUMflax/nnx/variablelib.py735 # --------------------------------------------COMMENT
MEDIUMflax/nnx/variablelib.py811# ---------------------------------COMMENT
MEDIUMflax/nnx/variablelib.py813# ---------------------------------COMMENT
MEDIUMflax/nnx/variablelib.py909 # ---------------------------------COMMENT
MEDIUMflax/nnx/variablelib.py911 # ---------------------------------COMMENT
MEDIUMflax/nnx/variablelib.py974 # --------------------------------COMMENT
MEDIUMflax/nnx/variablelib.py976 # --------------------------------COMMENT
MEDIUMflax/nnx/variablelib.py1030# --------------------------------------------COMMENT
MEDIUMflax/nnx/variablelib.py1032# --------------------------------------------COMMENT
MEDIUMflax/nnx/variablelib.py1825 # --------------------------------------------COMMENT
MEDIUMflax/nnx/variablelib.py1827 # --------------------------------------------COMMENT
MEDIUMflax/nnx/variablelib.py1996 # --------------------------------------------COMMENT
MEDIUMflax/nnx/graphlib.py1511# --------------------------------------------------------COMMENT
MEDIUMflax/nnx/graphlib.py1513# --------------------------------------------------------COMMENT
MEDIUMflax/nnx/graphlib.py2229# --------------------------------------------------------COMMENT
MEDIUMflax/nnx/graphlib.py2231# --------------------------------------------------------COMMENT
MEDIUMflax/nnx/graphlib.py3648# ---------------------------------------------------------COMMENT
MEDIUMflax/nnx/graphlib.py3650# ---------------------------------------------------------COMMENT
MEDIUMflax/nnx/extract.py205# -----------------------------COMMENT
MEDIUMflax/nnx/extract.py207# -----------------------------COMMENT
MEDIUMflax/nnx/transforms/iteration.py63# -------------------------------COMMENT
MEDIUMflax/nnx/transforms/iteration.py65# -------------------------------COMMENT
MEDIUMflax/nnx/transforms/iteration.py158# -------------------------------COMMENT
MEDIUMflax/nnx/transforms/iteration.py160# -------------------------------COMMENT
MEDIUMflax/nnx/transforms/iteration.py594# -------------------------------COMMENT
MEDIUMflax/nnx/transforms/iteration.py596# -------------------------------COMMENT
MEDIUMflax/nnx/transforms/iteration.py854# -------------------------------COMMENT
MEDIUMflax/nnx/transforms/iteration.py856# -------------------------------COMMENT
MEDIUMflax/nnx/transforms/iteration.py1875# -------------------------------COMMENT
MEDIUMflax/nnx/transforms/iteration.py1877# -------------------------------COMMENT
MEDIUMflax/nnx/transforms/transforms.py98# -------------------------------COMMENT
MEDIUMflax/nnx/transforms/transforms.py100# -------------------------------COMMENT
MEDIUMflax/nnx/transforms/transforms.py187# -------------------------------COMMENT
MEDIUMflax/nnx/transforms/transforms.py189# -------------------------------COMMENT
MEDIUMflax/nnx/transforms/compilation.py48# -------------------------------COMMENT
88 more matches not shown…
Unused Imports614 hits · 442 pts
SeverityFileLineSnippetContext
LOWnnx.py29CODE
LOWnnx.py30CODE
LOWflaxlib_src/src/flaxlib/__init__.py15CODE
LOWflaxlib_src/src/flaxlib/__init__.py16CODE
LOWflaxlib_src/src/flaxlib/__init__.py17CODE
LOWflaxlib_src/src/flaxlib/__init__.py18CODE
LOWflaxlib_src/src/flaxlib/__init__.py19CODE
LOWflax/__init__.py24CODE
LOWflax/__init__.py25CODE
LOWflax/__init__.py26CODE
LOWflax/__init__.py27CODE
LOWflax/__init__.py28CODE
LOWflax/typing.py14CODE
LOWflax/experimental/nnx.py17CODE
LOWflax/core/variables.py42CODE
LOWflax/core/__init__.py15CODE
LOWflax/core/__init__.py16CODE
LOWflax/core/__init__.py16CODE
LOWflax/core/__init__.py16CODE
LOWflax/core/__init__.py16CODE
LOWflax/core/__init__.py16CODE
LOWflax/core/__init__.py16CODE
LOWflax/core/__init__.py24CODE
LOWflax/core/__init__.py24CODE
LOWflax/core/__init__.py24CODE
LOWflax/core/__init__.py24CODE
LOWflax/core/__init__.py24CODE
LOWflax/core/__init__.py24CODE
LOWflax/core/__init__.py24CODE
LOWflax/core/__init__.py24CODE
LOWflax/core/__init__.py24CODE
LOWflax/core/__init__.py35CODE
LOWflax/core/__init__.py35CODE
LOWflax/core/__init__.py35CODE
LOWflax/core/__init__.py40CODE
LOWflax/core/__init__.py40CODE
LOWflax/core/__init__.py40CODE
LOWflax/core/__init__.py40CODE
LOWflax/core/__init__.py40CODE
LOWflax/core/__init__.py40CODE
LOWflax/core/__init__.py48CODE
LOWflax/core/__init__.py48CODE
LOWflax/core/__init__.py53CODE
LOWflax/core/scope.py43CODE
LOWflax/core/nn/__init__.py19CODE
LOWflax/core/nn/__init__.py20CODE
LOWflax/core/nn/__init__.py21CODE
LOWflax/core/nn/__init__.py21CODE
LOWflax/core/nn/__init__.py21CODE
LOWflax/core/nn/__init__.py21CODE
LOWflax/core/nn/__init__.py21CODE
LOWflax/core/nn/__init__.py21CODE
LOWflax/core/nn/__init__.py21CODE
LOWflax/core/nn/__init__.py21CODE
LOWflax/core/nn/__init__.py21CODE
LOWflax/core/nn/__init__.py21CODE
LOWflax/core/nn/__init__.py21CODE
LOWflax/core/nn/__init__.py21CODE
LOWflax/core/nn/__init__.py21CODE
LOWflax/core/nn/__init__.py21CODE
554 more matches not shown…
Cross-File Repetition83 hits · 415 pts
SeverityFileLineSnippetContext
HIGHdocs_nnx/README.md0applies a linear transformation to the inputs along multiple dimensions. args: inputs: the nd-array to be transformed. rSTRING
HIGHdocs/README.md0applies a linear transformation to the inputs along multiple dimensions. args: inputs: the nd-array to be transformed. rSTRING
HIGHflax/nnx/nn/linear.py0applies a linear transformation to the inputs along multiple dimensions. args: inputs: the nd-array to be transformed. rSTRING
HIGHflax/linen/linear.py0applies a linear transformation to the inputs along multiple dimensions. args: inputs: the nd-array to be transformed. rSTRING
HIGHdocs_nnx/flip/2434-general-metadata.md0abstract base class for boxed metadata. ``axismetadata`` enables arbitrary, per axis metadata for variables. by using ``STRING
HIGHdocs/flip/2434-general-metadata.md0abstract base class for boxed metadata. ``axismetadata`` enables arbitrary, per axis metadata for variables. by using ``STRING
HIGHflax/core/meta.py0abstract base class for boxed metadata. ``axismetadata`` enables arbitrary, per axis metadata for variables. by using ``STRING
HIGHdocs_nnx/flip/2434-general-metadata.md0returns the content of the axismetadata box. note that unlike ``meta.unbox`` the unbox call should not recursively unboxSTRING
HIGHdocs/flip/2434-general-metadata.md0returns the content of the axismetadata box. note that unlike ``meta.unbox`` the unbox call should not recursively unboxSTRING
HIGHflax/core/meta.py0returns the content of the axismetadata box. note that unlike ``meta.unbox`` the unbox call should not recursively unboxSTRING
HIGHdocs_nnx/flip/2434-general-metadata.md0adds a new axis to the axis metadata. note that add_axis and remove_axis should act as each other's inverse (meaning: ``STRING
HIGHdocs/flip/2434-general-metadata.md0adds a new axis to the axis metadata. note that add_axis and remove_axis should act as each other's inverse (meaning: ``STRING
HIGHflax/core/meta.py0adds a new axis to the axis metadata. note that add_axis and remove_axis should act as each other's inverse (meaning: ``STRING
HIGHdocs_nnx/flip/2434-general-metadata.md0removes an axis from the axis metadata. note that add_axis and remove_axis should act as each other's inverse (meaning: STRING
HIGHdocs/flip/2434-general-metadata.md0removes an axis from the axis metadata. note that add_axis and remove_axis should act as each other's inverse (meaning: STRING
HIGHflax/core/meta.py0removes an axis from the axis metadata. note that add_axis and remove_axis should act as each other's inverse (meaning: STRING
HIGHflax/core/nn/linear.py0computes the dimension numbers based on the input shape.STRING
HIGHflax/nnx/nn/linear.py0computes the dimension numbers based on the input shape.STRING
HIGHflax/linen/linear.py0computes the dimension numbers based on the input shape.STRING
HIGHflax/core/nn/linear.py0attend over the embedding using a query array. args: query: array with last dimension equal the feature depth ``featuresSTRING
HIGHflax/linen/experimental/layers_with_named_axes.py0attend over the embedding using a query array. args: query: array with last dimension equal the feature depth ``featuresSTRING
HIGHflax/linen/linear.py0attend over the embedding using a query array. args: query: array with last dimension equal the feature depth ``featuresSTRING
HIGHflax/nnx/nn/linear.py0applies a linear transformation to the inputs along the last dimension. args: inputs: the nd-array to be transformed. reSTRING
HIGHflax/linen/linear.py0applies a linear transformation to the inputs along the last dimension. args: inputs: the nd-array to be transformed. reSTRING
HIGHflax/linen/experimental/layers_with_named_axes.py0applies a linear transformation to the inputs along the last dimension. args: inputs: the nd-array to be transformed. reSTRING
HIGHflax/nnx/nn/normalization.py0returns a tuple of deduplicated, sorted, and positive axes.STRING
HIGHflax/linen/normalization.py0returns a tuple of deduplicated, sorted, and positive axes.STRING
HIGHflax/linen/experimental/layers_with_named_axes.py0returns a tuple of deduplicated, sorted, and positive axes.STRING
HIGHflax/nnx/nn/normalization.py0computes the elementwise square of the absolute value |x|^2.STRING
HIGHflax/linen/normalization.py0computes the elementwise square of the absolute value |x|^2.STRING
HIGHflax/linen/experimental/layers_with_named_axes.py0computes the elementwise square of the absolute value |x|^2.STRING
HIGHexamples/gemma/input_pipeline_tf.py0normalizes feature names to 'inputs' and 'targets'.STRING
HIGHexamples/gemma/input_pipeline_grain.py0normalizes feature names to 'inputs' and 'targets'.STRING
HIGHexamples/wmt/input_pipeline.py0normalizes feature names to 'inputs' and 'targets'.STRING
HIGHexamples/lm1b/input_pipeline.py0normalizes feature names to 'inputs' and 'targets'.STRING
HIGHexamples/gemma/input_pipeline_tf.py0creates a 'packed' version of a dataset on-the-fly. adapted from the mesh-tf implementation. this is meant to replace thSTRING
HIGHexamples/wmt/input_pipeline.py0creates a 'packed' version of a dataset on-the-fly. adapted from the mesh-tf implementation. this is meant to replace thSTRING
HIGHexamples/lm1b/input_pipeline.py0creates a 'packed' version of a dataset on-the-fly. adapted from the mesh-tf implementation. this is meant to replace thSTRING
HIGHexamples/gemma/input_pipeline_tf.py0helper-function for packing a dataset which has already been batched. helper for pack_dataset() uses tf.while_loop. argsSTRING
HIGHexamples/lm1b/input_pipeline.py0helper-function for packing a dataset which has already been batched. helper for pack_dataset() uses tf.while_loop. argsSTRING
HIGHexamples/wmt/input_pipeline.py0helper-function for packing a dataset which has already been batched. helper for pack_dataset() uses tf.while_loop. argsSTRING
HIGHexamples/gemma/input_pipeline_tf.py0internal function to flat_map over. consumes a batch of input examples and produces a variable number of output examplesSTRING
HIGHexamples/wmt/input_pipeline.py0internal function to flat_map over. consumes a batch of input examples and produces a variable number of output examplesSTRING
HIGHexamples/lm1b/input_pipeline.py0internal function to flat_map over. consumes a batch of input examples and produces a variable number of output examplesSTRING
HIGHexamples/gemma/input_pipeline_tf.py0body function for while_loop. args: i: integer scalar partial: dictionary of tensor (partially-constructed example) outpSTRING
HIGHexamples/wmt/input_pipeline.py0body function for while_loop. args: i: integer scalar partial: dictionary of tensor (partially-constructed example) outpSTRING
HIGHexamples/lm1b/input_pipeline.py0body function for while_loop. args: i: integer scalar partial: dictionary of tensor (partially-constructed example) outpSTRING
HIGHexamples/gemma/input_pipeline_tf.py0load and return dataset of batched examples for use during training.STRING
HIGHexamples/gemma/input_pipeline_grain.py0load and return dataset of batched examples for use during training.STRING
HIGHexamples/wmt/input_pipeline.py0load and return dataset of batched examples for use during training.STRING
HIGHexamples/lm1b/input_pipeline.py0load and return dataset of batched examples for use during training.STRING
HIGHexamples/gemma/tokenizer.py0write part of a tfds sentence dataset to lines in a text file. args: dataset: tf.dataset containing string-data. maxcharSTRING
HIGHexamples/wmt/tokenizer.py0write part of a tfds sentence dataset to lines in a text file. args: dataset: tf.dataset containing string-data. maxcharSTRING
HIGHexamples/lm1b/tokenizer.py0write part of a tfds sentence dataset to lines in a text file. args: dataset: tf.dataset containing string-data. maxcharSTRING
HIGHexamples/gemma/tokenizer.py0loads the tokenizer at `vocab_path` or trains a one from `dataset`.STRING
HIGHexamples/wmt/tokenizer.py0loads the tokenizer at `vocab_path` or trains a one from `dataset`.STRING
HIGHexamples/lm1b/tokenizer.py0loads the tokenizer at `vocab_path` or trains a one from `dataset`.STRING
HIGHexamples/gemma/train.py0applies a reverse square-root schedule. the reverse square root schedule is simply `lr = init_value / sqrt(step)`. args:STRING
HIGHexamples/lm1b/train.py0applies a reverse square-root schedule. the reverse square root schedule is simply `lr = init_value / sqrt(step)`. args:STRING
HIGHexamples/wmt/train.py0applies a reverse square-root schedule. the reverse square root schedule is simply `lr = init_value / sqrt(step)`. args:STRING
23 more matches not shown…
Over-Commented Block373 hits · 369 pts
SeverityFileLineSnippetContext
LOWnnx.py1# Copyright 2026 The Flax Authors.COMMENT
LOW.pre-commit-config.yaml1# Install the pre-commit hooks below withCOMMENT
LOW.readthedocs.yml1# deprecatedCOMMENT
LOWflaxlib_src/src/flaxlib/__init__.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/configurations_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/traceback_util_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/struct_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/pickle_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/early_stopping_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/flaxlib_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/jax_utils_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/checkpoints_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/traverse_util_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/io_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/tensorboard_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/serialization_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/cursor_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/core/core_meta_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/core/core_frozen_dict_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/core/core_lift_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/core/core_scope_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/core/design/core_weight_std_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/core/design/core_vmap_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/core/design/core_big_resnets_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/core/design/core_dense_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/core/design/core_custom_vjp_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/core/design/core_auto_encoder_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/core/design/core_tied_autoencoder_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/core/design/core_scan_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/core/design/core_flow_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/core/design/core_attention_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/core/design/core_resnet_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/nnx/containers_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/nnx/rngs_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/nnx/optimizer_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/nnx/filters_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/nnx/mutable_array_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/nnx/graph_utils_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/nnx/transforms_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/nnx/__init__.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/nnx/metrics_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/nnx/helpers_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/nnx/state_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/nnx/module_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/nnx/nnx_compat_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/nnx/ids_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/nnx/partitioning_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/nnx/ema_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/nnx/summary_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/nnx/test_traversals.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/nnx/integration_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/nnx/variable_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/nnx/spmd_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/nnx/nn/recurrent_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/nnx/nn/normalization_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/nnx/nn/linear_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/nnx/nn/conv_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/nnx/nn/attention_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/nnx/nn/stochastic_test.py1# Copyright 2024 The Flax Authors.COMMENT
LOWtests/nnx/nn/lora_test.py1# Copyright 2024 The Flax Authors.COMMENT
313 more matches not shown…
Docstring Block Structure17 hits · 85 pts
SeverityFileLineSnippetContext
HIGHflax/configurations.py188Read an environment variable and interpret it as a boolean. This is deprecated. Please use bool_flag() unless your flSTRING
HIGHflax/configurations.py215Read an environment variable and interpret it as an integer. Args: varname: the name of the variable default:STRING
HIGHflax/jax_utils.py276Wraps a function with code that pads, shards, then un-shards, un-pads. Args: wrapped: the function to be wrapped.STRING
HIGHflax/core/lift.py721A lifted version of ``jax.vmap``. See ``jax.vmap`` for the unlifted batch transform in Jax. ``vmap`` can be used tSTRING
HIGHflax/nnx/visualization.py52Renders an object in "constructor format", similar to a dataclass. This produces a rendering like `Foo(bar=1, baz=2)`STRING
HIGHflax/nnx/summary.py268Creates a summary of the graph object represented as a table. The table summarizes the object's state and metadata. TSTRING
HIGHflax/linen/transforms.py846A lifted version of ``jax.vmap``. See ``jax.vmap`` for the unlifted batch transform in Jax. ``vmap`` can be used tSTRING
HIGHflax/linen/attention.py63Computes dot-product attention weights given query and key. Used by :func:`dot_product_attention`, which is what you'STRING
HIGHflax/linen/attention.py184Computes dot-product attention given query, key, and value. This is the core function for applying attention based onSTRING
HIGHflax/linen/partitioning.py92Reduction function for sow() calls. Args: x: Existing value, or () if there was none. y: New axis names sown.STRING
HIGHflax/linen/partitioning.py131Declares and returns a parameter with logical axes in the current Module. See :mod:`flax.linen.module.param` for origSTRING
HIGHflax/linen/partitioning.py255Declares and returns a variable with logical axes in the current Module. See :mod:`flax.linen.module.variable` for orSTRING
HIGHflax/linen/summary.py187Returns a function that creates a summary of the Module represented as a table. This function accepts most of the samSTRING
HIGHflax/linen/module.py2742Creates a summary of the Module represented as a table. This method has the same signature and internally calls ``MSTRING
HIGHexamples/nlp_seq/input_pipeline.py107Map for a token a selected subset of attributes to indices. Input example: CoNLL 09 representation for a token. [STRING
HIGHexamples/nlp_seq/input_pipeline.py143Create a sentence containing a root. Args: attributes: attributes extracted from token. vocabs: dictionary ofSTRING
HIGHexamples/nlp_seq/input_pipeline.py166Load and returns conll data in list format. Args: corpus_filename: filename of corpus. vocabs: dictionary of STRING
Deep Nesting93 hits · 84 pts
SeverityFileLineSnippetContext
LOWtests/cursor_test.py125CODE
LOWtests/linen/linen_test.py1064CODE
LOWdocs_nnx/conf_sphinx_patch.py32CODE
LOWdocs_nnx/conf_sphinx_patch.py86CODE
LOWdocs_nnx/conf_sphinx_patch.py115CODE
LOWdocs/conf_sphinx_patch.py32CODE
LOWdocs/conf_sphinx_patch.py86CODE
LOWdocs/conf_sphinx_patch.py115CODE
LOWflax/serialization.py327CODE
LOWflax/serialization.py364CODE
LOWflax/serialization.py379CODE
LOWflax/cursor.py60CODE
LOWflax/cursor.py224CODE
LOWflax/core/lift.py125CODE
LOWflax/core/lift.py259CODE
LOWflax/nnx/pytreelib.py313CODE
LOWflax/nnx/pytreelib.py518CODE
LOWflax/nnx/pytreelib.py680CODE
LOWflax/nnx/rnglib.py1256CODE
LOWflax/nnx/rnglib.py461CODE
LOWflax/nnx/rnglib.py509CODE
LOWflax/nnx/summary.py70CODE
LOWflax/nnx/summary.py255CODE
LOWflax/nnx/summary.py566CODE
LOWflax/nnx/reprlib.py100CODE
LOWflax/nnx/variablelib.py1419CODE
LOWflax/nnx/module.py619CODE
LOWflax/nnx/module.py789CODE
LOWflax/nnx/module.py928CODE
LOWflax/nnx/module.py955CODE
LOWflax/nnx/module.py85CODE
LOWflax/nnx/module.py186CODE
LOWflax/nnx/module.py307CODE
LOWflax/nnx/module.py874CODE
LOWflax/nnx/module.py932CODE
LOWflax/nnx/graphlib.py882CODE
LOWflax/nnx/graphlib.py1066CODE
LOWflax/nnx/graphlib.py1178CODE
LOWflax/nnx/graphlib.py1388CODE
LOWflax/nnx/graphlib.py1444CODE
LOWflax/nnx/graphlib.py3233CODE
LOWflax/nnx/graphlib.py3462CODE
LOWflax/nnx/graphlib.py3657CODE
LOWflax/nnx/graphlib.py1203CODE
LOWflax/nnx/graphlib.py1302CODE
LOWflax/nnx/graphlib.py1911CODE
LOWflax/nnx/helpers.py260CODE
LOWflax/nnx/filterlib.py32CODE
LOWflax/nnx/extract.py82CODE
LOWflax/nnx/extract.py147CODE
LOWflax/nnx/extract.py338CODE
LOWflax/nnx/nn/recurrent.py1058CODE
LOWflax/nnx/nn/linear.py52CODE
LOWflax/nnx/bridge/wrappers.py178CODE
LOWflax/nnx/bridge/wrappers.py396CODE
LOWflax/nnx/transforms/iteration.py234CODE
LOWflax/nnx/transforms/iteration.py892CODE
LOWflax/nnx/transforms/iteration.py977CODE
LOWflax/nnx/transforms/iteration.py1064CODE
LOWflax/nnx/transforms/iteration.py1180CODE
33 more matches not shown…
AI Structural Patterns88 hits · 80 pts
SeverityFileLineSnippetContext
LOWtests/core/design/core_attention_test.py99CODE
LOWtests/nnx/bridge/wrappers_test.py243CODE
LOWtests/linen/linen_transforms_test.py459CODE
LOWtests/linen/linen_transforms_test.py507CODE
LOWtests/linen/linen_transforms_test.py553CODE
LOWtests/linen/linen_transforms_test.py608CODE
LOWtests/linen/linen_transforms_test.py664CODE
LOWtests/linen/linen_transforms_test.py707CODE
LOWflax/core/lift.py872CODE
LOWflax/core/nn/attention.py34CODE
LOWflax/core/nn/attention.py412CODE
LOWflax/core/nn/attention.py169CODE
LOWflax/core/nn/linear.py183CODE
LOWflax/core/nn/linear.py261CODE
LOWflax/core/nn/normalization.py28CODE
LOWflax/core/nn/normalization.py129CODE
LOWflax/nnx/pytreelib.py62CODE
LOWflax/nnx/pytreelib.py223CODE
LOWflax/nnx/pytreelib.py274CODE
LOWflax/nnx/pytreelib.py287CODE
LOWflax/nnx/summary.py255CODE
LOWflax/nnx/nn/attention.py63CODE
LOWflax/nnx/nn/attention.py211CODE
LOWflax/nnx/nn/attention.py567CODE
LOWflax/nnx/nn/attention.py923CODE
LOWflax/nnx/nn/attention.py737CODE
LOWflax/nnx/nn/recurrent.py114CODE
LOWflax/nnx/nn/recurrent.py306CODE
LOWflax/nnx/nn/recurrent.py473CODE
LOWflax/nnx/nn/recurrent.py633CODE
LOWflax/nnx/nn/recurrent.py786CODE
LOWflax/nnx/nn/linear.py156CODE
LOWflax/nnx/nn/linear.py357CODE
LOWflax/nnx/nn/linear.py482CODE
LOWflax/nnx/nn/linear.py715CODE
LOWflax/nnx/nn/linear.py1018CODE
LOWflax/nnx/nn/lora.py89CODE
LOWflax/nnx/nn/lora.py179CODE
LOWflax/nnx/nn/normalization.py289CODE
LOWflax/nnx/nn/normalization.py500CODE
LOWflax/nnx/nn/normalization.py645CODE
LOWflax/nnx/nn/normalization.py802CODE
LOWflax/nnx/nn/normalization.py988CODE
LOWflax/nnx/nn/normalization.py1158CODE
LOWflax/nnx/transforms/iteration.py364CODE
LOWflax/nnx/transforms/iteration.py380CODE
LOWflax/nnx/transforms/iteration.py396CODE
LOWflax/nnx/transforms/iteration.py633CODE
LOWflax/nnx/transforms/iteration.py652CODE
LOWflax/nnx/transforms/iteration.py671CODE
LOWflax/nnx/transforms/iteration.py1461CODE
LOWflax/nnx/transforms/iteration.py1479CODE
LOWflax/nnx/transforms/iteration.py1497CODE
LOWflax/nnx/transforms/iteration.py2074CODE
LOWflax/nnx/transforms/iteration.py2192CODE
LOWflax/nnx/transforms/iteration.py1924CODE
LOWflax/nnx/transforms/compilation.py160CODE
LOWflax/nnx/transforms/compilation.py184CODE
LOWflax/nnx/transforms/compilation.py200CODE
LOWflax/nnx/transforms/compilation.py735CODE
28 more matches not shown…
Self-Referential Comments23 hits · 65 pts
SeverityFileLineSnippetContext
MEDIUMtests/linen/linen_test.py1507 # Create a scan loop with reused ah_f32 and sf_f32. So, the autograd willCOMMENT
MEDIUMdocs_nnx/_ext/codediff.py187 # Create a test node as a comment node so it won't show up in the docs.COMMENT
MEDIUMdocs_nnx/_ext/flax_module.py72 # Create a container for the rendered nodesCOMMENT
MEDIUMdocs/_ext/codediff.py187 # Create a test node as a comment node so it won't show up in the docs.COMMENT
MEDIUMdocs/_ext/flax_module.py72 # Create a container for the rendered nodesCOMMENT
MEDIUMflax/nnx/summary.py394 # Create a dictionary-version of the object's class. This makesCOMMENT
MEDIUMflax/nnx/module.py898 # Create the captures tupleSTRING
MEDIUMflax/nnx/bridge/wrappers.py486 >>> # Create a specialized Linen wrapper for linears.DenseGeneralSTRING
MEDIUMflax/training/checkpoints.py900 # Creating the directory containing GDAs explicitly. This should happen onlyCOMMENT
MEDIUMflax/linen/fp8_ops.py42# Define a custom dtype for FP8 meta params.COMMENT
MEDIUMexamples/mnist/train_test.py57 # Create a temporary directory where tensorboard metrics are written.COMMENT
MEDIUMexamples/mnist/train.py109 # Create a shuffled dataset by allocating a buffer size of 1024 to randomlyCOMMENT
MEDIUMexamples/ogbg_molpcba/train_test.py274 # Create the optimizer.COMMENT
MEDIUMexamples/ogbg_molpcba/train_test.py277 # Create the training state.COMMENT
MEDIUMexamples/ogbg_molpcba/train_test.py317 # Create the optimizer.COMMENT
MEDIUMexamples/ogbg_molpcba/train_test.py320 # Create the evaluation state.COMMENT
MEDIUMexamples/ogbg_molpcba/train_test.py338 # Create a temporary directory where TensorBoard metrics are written.COMMENT
MEDIUMexamples/ogbg_molpcba/train.py331 # Create the optimizer.COMMENT
MEDIUMexamples/ogbg_molpcba/train.py334 # Create the training state.COMMENT
MEDIUMexamples/ogbg_molpcba/train.py348 # Create the evaluation state, corresponding to a deterministic model.COMMENT
MEDIUMexamples/nnx_toy_examples/hijax_demo.py217# Create a copy of the model structure and set its attributes to eval model.COMMENT
MEDIUMexamples/imagenet/train_test.py70 # Create a temporary directory where tensorboard metrics are written.COMMENT
MEDIUMexamples/nlp_seq/input_pipeline.py153 # Create the token properties of an artificial root node.COMMENT
Cross-Language Confusion12 hits · 58 pts
SeverityFileLineSnippetContext
HIGHtests/core/core_lift_test.py28 a = scope.push('a')CODE
HIGHtests/core/core_lift_test.py47 dense(scope.push('dense'), np.ones((3, 2)), 2)CODE
HIGHtests/core/core_lift_test.py236 subscope = scope.push(name='a')CODE
HIGHtests/core/core_scope_test.py164 nn.dense(scope.push('dense'), np.ones((1, 2)), 2)CODE
HIGHtests/core/core_scope_test.py254 subscope = scope.push(name='a')CODE
HIGHtests/core/design/core_resnet_test.py73 block_scope = scope.push(f'block_{i}_{j}')CODE
HIGHflax/core/lift.py116 scope = scope.push(name, reuse=True)CODE
HIGHflax/core/lift.py1691 with jit_context.push((scope_fn, repack_fn)):CODE
HIGHflax/core/lift.py1839 with fold_rngs_context.push((scope_fn, repack_fn)):CODE
HIGHflax/core/scope.py683 scope = self.push(name)CODE
HIGHflax/linen/module.py387 _global_interceptor_stack.push(interceptor)STRING
HIGHflax/linen/module.py1371 self, 'scope', self.parent.scope.push(self.name, reuse=reuse_scopes)CODE
Dead Code11 hits · 22 pts
SeverityFileLineSnippetContext
MEDIUMtests/traceback_util_test.py64CODE
MEDIUMtests/traceback_util_test.py99CODE
MEDIUMtests/traceback_util_test.py140CODE
MEDIUMtests/linen/linen_transforms_test.py157CODE
MEDIUMtests/linen/linen_transforms_test.py163CODE
MEDIUMtests/linen/linen_transforms_test.py164CODE
MEDIUMtests/linen/linen_transforms_test.py165CODE
MEDIUMtests/linen/linen_transforms_test.py166CODE
MEDIUMtests/linen/linen_transforms_test.py167CODE
MEDIUMtests/linen/linen_transforms_test.py169CODE
MEDIUMtests/linen/linen_transforms_test.py172CODE
Excessive Try-Catch Wrapping15 hits · 16 pts
SeverityFileLineSnippetContext
LOWdocs_nnx/conf_sphinx_patch.py52 except Exception as exc:CODE
LOWdocs_nnx/hijax/hijax.md126except Exception as e:CODE
LOWdocs_nnx/hijax/hijax.md222except Exception as e:CODE
LOWdocs_nnx/hijax/hijax.md243 except Exception as e:CODE
MEDIUMdocs_nnx/hijax/hijax.md240def get_error(f, *args):CODE
LOWdocs_nnx/guides/pytree.md326except Exception as e:STRING
MEDIUMdocs_nnx/guides/pytree.md327 print(f"Error: {e}")STRING
LOWdocs_nnx/guides/surgery.md152except Exception as e:CODE
LOWdocs_nnx/guides/transforms.md336except Exception as e:CODE
LOWdocs/conf_sphinx_patch.py52 except Exception as exc:CODE
LOWflax/nnx/summary.py604 except Exception:CODE
LOWflax/nnx/summary.py626 except Exception:CODE
LOWflax/training/prefetch_iterator.py95 except Exception as e: # pylint: disable=broad-exceptCODE
LOWflax/linen/transforms.py555 except Exception as e:CODE
LOWexamples/gemma/tokenizer.py162 except Exception:CODE
AI Slop Vocabulary9 hits · 11 pts
SeverityFileLineSnippetContext
LOWtests/linen/linen_transforms_test.py850 @nn.remat # we just use remat as a convenient test of transform logicCODE
LOWflax/core/scope.py717 # If this is the top-level Scope, just add an empty collection.COMMENT
LOWflax/nnx/nn/recurrent.py905 # carry for each sequence. Otherwise we just use the last carry.STRING
LOWflax/linen/transforms.py485 # if we have already seen the module we just use the indexCOMMENT
LOWflax/linen/recurrent.py1139 # carry for each sequence. Otherwise we just use the last carry.STRING
LOWexamples/gemma/input_pipeline_test.py26# We just use different values here to verify that the input pipeline uses theCOMMENT
LOWexamples/wmt/input_pipeline_test.py27# We just use different values here to verify that the input pipeline uses theCOMMENT
LOWexamples/nnx_toy_examples/hijax_demo.py266# Sampling is trivial, just use 'model_eval'COMMENT
LOWexamples/lm1b/input_pipeline_test.py26# We just use different values here to verify that the input pipeline uses theCOMMENT
Modern Structural Boilerplate9 hits · 10 pts
SeverityFileLineSnippetContext
LOWflax/nnx/pytreelib.py652 def _setattr(self, name, value: tp.Any) -> None:CODE
LOWflax/nnx/variablelib.py1408 def set_metadata(self, metadata: dict[str, tp.Any], /) -> None:CODE
LOWflax/nnx/variablelib.py1412 def set_metadata(self, name: str, value: tp.Any, /) -> None:CODE
LOWflax/nnx/variablelib.py1416 def set_metadata(self, **metadata: tp.Any) -> None:CODE
LOWflax/nnx/variablelib.py1419 def set_metadata(self, *args, **kwargs) -> None:CODE
LOWflax/nnx/graphlib.py3152 def _set_metadata(path: PathParts, variable: V) -> None:CODE
LOWflax/nnx/helpers.py129 def _set_elem(self, key: int, value: A) -> None:CODE
LOWflax/nnx/nn/activations.py51__all__ = [CODE
LOWflax/nnx/bridge/module.py218 def _setattr(self, name: str, value: tp.Any) -> None:CODE
Hallucination Indicators1 hit · 10 pts
SeverityFileLineSnippetContext
CRITICALdocs_nnx/guides/flax_gspmd.md300assert logical_model.layers.dot1.kernel.sharding.is_equivalent_to(CODE
AI Response Leakage1 hit · 8 pts
SeverityFileLineSnippetContext
HIGHexamples/nnx_toy_examples/hijax_demo.py39# In this version we want the Modules to be pytrees so they can be used with JAX transformsCOMMENT
Slop Phrases4 hits · 6 pts
SeverityFileLineSnippetContext
MEDIUMflax/errors.py685 empty_variables = {} # you can also use the real variablesSTRING
MEDIUMflax/nnx/graphlib.py2154 Here is a simple example showing the use of ``update_context``::STRING
LOWexamples/gemma/main.py53 # Please make sure you have installed tensorflow-cpu package without GPU support.COMMENT
MEDIUMexamples/linen_design_test/autoencoder.py75# Now you can use `ae` as a normal object, calling any methods defined on AutoEncoderCOMMENT
Redundant / Tautological Comments4 hits · 6 pts
SeverityFileLineSnippetContext
LOWtests/nnx/nn/recurrent_test.py304 # Check if the outputs are in reverse orderCOMMENT
LOWtests/nnx/nn/recurrent_test.py386 # Check if the outputs are in the original order despite processing in reverseCOMMENT
LOWflax/training/checkpoints.py275 # Check if reading from GCS and the array dir is potentially corrupted.COMMENT
LOWflax/training/checkpoints.py281 # Check if the given target array types are valid.COMMENT
TODO Padding3 hits · 4 pts
SeverityFileLineSnippetContext
LOWflax/nnx/bridge/variables.py57 # TODO: implement this, supporting hooksCOMMENT
LOWflax/nnx/bridge/variables.py61 # TODO: implement this, supporting hooksCOMMENT
LOWflax/nnx/training/metrics.py26# TODO: add tests and docstringsCOMMENT
Overly Generic Function Names6 hits · 4 pts
SeverityFileLineSnippetContext
LOWtests/nnx/module_test.py364 def helper(self, x):CODE
LOWtests/linen/linen_transforms_test.py1515 def helper(self, x, m):CODE
LOWtests/linen/linen_transforms_test.py1531 def helper(self, x, m):CODE
LOWtests/linen/linen_transforms_test.py1550 def helper(self, x, m):CODE
LOWtests/linen/linen_transforms_test.py1594 def helper(self, x, ms):CODE
LOWtests/linen/linen_transforms_test.py1606 def helper(self, x, ms):CODE
Structural Annotation Overuse2 hits · 2 pts
SeverityFileLineSnippetContext
LOWflax/nnx/module.py223 >>> # Step 1: Initialize perturbationsSTRING
LOW.github/analytics/get_repo_metrics.py81 # WARNING: The cursor injection depends on the specific structure of theCOMMENT
Fake / Example Data1 hit · 1 pts
SeverityFileLineSnippetContext
LOWexamples/imagenet/README.md26- [Running fake data benchmarks](#running-fake-data-benchmarks)CODE
Verbosity Indicators1 hit · 0 pts
SeverityFileLineSnippetContext
LOWflax/nnx/module.py223 >>> # Step 1: Initialize perturbationsSTRING