Repository Analysis

pytorch/rl

A modular, primitive-first, python-first PyTorch library for Reinforcement Learning.

23.2 Moderate AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of pytorch/rl, a Python project with 3,539 GitHub stars. SynthScan v2.0 examined 532,686 lines of code across 1292 source files, recording 9836 pattern matches distributed across 25 syntactic categories. The overall adjusted score of 23.2 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).

23.2
Adjusted Score
23.2
Raw Score
100%
Time Factor
2026-08-29
Last Push
3.5K
Stars
Python
Language
532.7K
Lines of Code
1.3K
Files
9.8K
Pattern Hits
2026-08-29
Scan Date
0.22
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 3HIGH 280MEDIUM 1272LOW 8281

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 9836 distinct pattern matches across 25 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 Identifiers3705 hits · 3089 pts
SeverityFileLineSnippetContext
LOWsetup.py145def _check_and_clean_stale_builds():CODE
LOWAGENTS.md120def test_something_cuda_specific():CODE
LOWCLAUDE.md120def test_something_cuda_specific():CODE
LOWtest/test_configs.py301 def test_wrapped_class_kwargs_have_config_fields(self, config_name):CODE
LOWtest/test_configs.py388 def test_vmas_env_config_instantiation(self):CODE
LOWtest/test_configs.py424 def test_async_env_shared_exchange_config(self):CODE
LOWtest/test_configs.py447 def test_batched_env_config_omegaconf_schema(self):CODE
LOWtest/test_configs.py466 def test_batched_env_config_validation(self, field, value):CODE
LOWtest/test_configs.py497 def test_round_robin_writer_config(self):CODE
LOWtest/test_configs.py521 def test_random_sampler_config(self):CODE
LOWtest/test_configs.py556 def test_tensor_storage_config(self):CODE
LOWtest/test_configs.py577 def test_tensordict_replay_buffer_config(self):CODE
LOWtest/test_configs.py618 def test_replay_buffer_config(self):CODE
LOWtest/test_configs.py654 def test_tensordict_replay_buffer_config_optional_fields(self):CODE
LOWtest/test_configs.py670 def test_writer_ensemble_config(self):CODE
LOWtest/test_configs.py691 def test_tensor_dict_max_value_writer_config(self):CODE
LOWtest/test_configs.py708 def test_tensor_dict_round_robin_writer_config(self):CODE
LOWtest/test_configs.py727 def test_immutable_dataset_writer_config(self):CODE
LOWtest/test_configs.py741 def test_sampler_ensemble_config(self):CODE
LOWtest/test_configs.py762 def test_prioritized_slice_sampler_config(self):CODE
LOWtest/test_configs.py816 def test_slice_sampler_without_replacement_config(self):CODE
LOWtest/test_configs.py853 def test_slice_sampler_config(self):CODE
LOWtest/test_configs.py887 def test_prioritized_sampler_config(self):CODE
LOWtest/test_configs.py912 def test_sampler_without_replacement_config(self):CODE
LOWtest/test_configs.py930 def test_storage_ensemble_writer_config(self):CODE
LOWtest/test_configs.py950 def test_lazy_stack_storage_config(self):CODE
LOWtest/test_configs.py967 def test_storage_ensemble_config(self):CODE
LOWtest/test_configs.py992 def test_lazy_memmap_storage_config(self):CODE
LOWtest/test_configs.py1013 def test_lazy_tensor_storage_config(self):CODE
LOWtest/test_configs.py1042 def test_complex_replay_buffer_configuration(self):CODE
LOWtest/test_configs.py1194 def test_tensor_dict_module_config(self):CODE
LOWtest/test_configs.py1216 def test_tanh_normal_model_config(self):CODE
LOWtest/test_configs.py1250 def test_tanh_normal_model_config_defaults(self):CODE
LOWtest/test_configs.py1271 def test_tensordict_sequential_config(self):CODE
LOWtest/test_configs.py1401 def test_qmixer_network_config(self):CODE
LOWtest/test_configs.py1415 def test_additive_gaussian_module_config(self):CODE
LOWtest/test_configs.py1455 def test_generic_collector_backend_fields(self):CODE
LOWtest/test_configs.py1556 def test_collector_auto_configures_exploration_modules(self, factory, collector):CODE
LOWtest/test_configs.py1646 def test_gae_config_value_chunk_dim(self):CODE
LOWtest/test_configs.py1811 def test_reinforce_loss_config(self):CODE
LOWtest/test_configs.py1895 def test_wandb_logger_config_instantiation(self, monkeypatch):CODE
LOWtest/test_configs.py1922 def test_trackio_logger_config(self):CODE
LOWtest/test_configs.py1941 def test_trackio_logger_config_instantiation(self, monkeypatch):CODE
LOWtest/test_configs.py1993 def test_checkpoint_config_parity(self, config_name, field_name):CODE
LOWtest/test_configs.py1997 def test_nested_key_normalization_for_hydra_lists(self):CODE
LOWtest/test_configs.py2083 def test_reinforce_trainer_config(self):CODE
LOWtest/test_configs.py2113 def test_ppo_trainer_config_optional_fields(self):CODE
LOWtest/test_configs.py2276 def test_individual_hook_configs(self, config_cls, kwargs, hook_cls):CODE
LOWtest/test_configs.py4077 def test_weight_updater_config(self):CODE
LOWtest/test_configs.py4087 def test_vanilla_weight_updater_config(self):CODE
LOWtest/test_configs.py4099 def test_multiprocessed_weight_updater_config(self):CODE
LOWtest/test_configs.py4111 def test_ray_weight_updater_config(self):CODE
LOWtest/test_configs.py4124 def test_rpc_weight_updater_config(self):CODE
LOWtest/test_configs.py4139 def test_distributed_weight_updater_config(self):CODE
LOWtest/test_configs.py4153 def test_remote_module_weight_updater_config(self):CODE
LOWtest/test_configs.py2565 def test_batched_env_with_one_transform(self, tmpdir):STRING
LOWtest/test_configs.py2594 def test_batched_env_with_two_transforms(self, tmpdir):STRING
LOWtest/test_configs.py2635 def test_simple_config_instantiation(self, tmpdir):STRING
LOWtest/test_configs.py2685 def test_env_parsing_with_file(self, tmpdir):STRING
LOWtest/test_configs.py2705 def test_collector_parsing_with_file(self, tmpdir):STRING
3645 more matches not shown…
Decorative Section Separators931 hits · 2952 pts
SeverityFileLineSnippetContext
MEDIUMtest/test_inference_server.py128# =============================================================================COMMENT
MEDIUMtest/test_inference_server.py130# =============================================================================COMMENT
MEDIUMtest/test_inference_server.py1813# =============================================================================COMMENT
MEDIUMtest/test_inference_server.py1815# =============================================================================COMMENT
MEDIUMtest/test_inference_server.py2539# =============================================================================COMMENT
MEDIUMtest/test_inference_server.py2541# =============================================================================COMMENT
MEDIUMtest/test_inference_server.py2582# =============================================================================COMMENT
MEDIUMtest/test_inference_server.py2584# =============================================================================COMMENT
MEDIUMtest/test_inference_server.py77# =============================================================================COMMENT
MEDIUMtest/test_inference_server.py79# =============================================================================COMMENT
MEDIUMtest/test_inference_server.py1087# =============================================================================COMMENT
MEDIUMtest/test_inference_server.py1089# =============================================================================COMMENT
MEDIUMtest/test_inference_server.py1188# =============================================================================COMMENT
MEDIUMtest/test_inference_server.py1190# =============================================================================COMMENT
MEDIUMtest/test_inference_server.py1280# =============================================================================COMMENT
MEDIUMtest/test_inference_server.py1282# =============================================================================COMMENT
MEDIUMtest/test_inference_server.py1563# =============================================================================COMMENT
MEDIUMtest/test_inference_server.py1565# =============================================================================COMMENT
MEDIUMtest/test_inference_server.py1753# =============================================================================COMMENT
MEDIUMtest/test_inference_server.py1755# =============================================================================COMMENT
MEDIUMtest/test_inference_server.py1956# ---------------------------------------------------------------------------COMMENT
MEDIUMtest/test_inference_server.py1958# ---------------------------------------------------------------------------COMMENT
MEDIUMtest/test_inference_server.py2465# =============================================================================COMMENT
MEDIUMtest/test_inference_server.py2467# =============================================================================COMMENT
MEDIUMtest/test_collectors.py7303 # ------------------------------------------------------------------COMMENT
MEDIUMtest/test_collectors.py7305 # ------------------------------------------------------------------COMMENT
MEDIUMtest/test_collectors.py7574 # ------------------------------------------------------------------COMMENT
MEDIUMtest/test_collectors.py7576 # ------------------------------------------------------------------COMMENT
MEDIUMtest/test_collectors.py7902 # ------------------------------------------------------------------COMMENT
MEDIUMtest/test_collectors.py7904 # ------------------------------------------------------------------COMMENT
MEDIUMtest/test_collectors.py8099 # ------------------------------------------------------------------COMMENT
MEDIUMtest/test_collectors.py8101 # ------------------------------------------------------------------COMMENT
MEDIUMtest/test_collectors.py8202 # ------------------------------------------------------------------COMMENT
MEDIUMtest/test_collectors.py8204 # ------------------------------------------------------------------COMMENT
MEDIUMtest/test_collectors.py8251 # ------------------------------------------------------------------COMMENT
MEDIUMtest/test_collectors.py8253 # ------------------------------------------------------------------COMMENT
MEDIUMtest/test_collectors.py8359 # ------------------------------------------------------------------COMMENT
MEDIUMtest/test_collectors.py8361 # ------------------------------------------------------------------COMMENT
MEDIUMtest/test_collectors.py8611 # ------------------------------------------------------------------COMMENT
MEDIUMtest/test_collectors.py8613 # ------------------------------------------------------------------COMMENT
MEDIUMtest/test_collectors.py7287 # ------------------------------------------------------------------COMMENT
MEDIUMtest/test_collectors.py7289 # ------------------------------------------------------------------COMMENT
MEDIUMtest/test_rnd.py98# ---------------------------------------------------------------------------COMMENT
MEDIUMtest/test_rnd.py100# ---------------------------------------------------------------------------COMMENT
MEDIUMtest/test_rnd.py230# ---------------------------------------------------------------------------COMMENT
MEDIUMtest/test_rnd.py232# ---------------------------------------------------------------------------COMMENT
MEDIUMtest/test_rnd.py20# ---------------------------------------------------------------------------COMMENT
MEDIUMtest/test_rnd.py22# ---------------------------------------------------------------------------COMMENT
MEDIUMtest/test_rnd.py35# ---------------------------------------------------------------------------COMMENT
MEDIUMtest/test_rnd.py37# ---------------------------------------------------------------------------COMMENT
MEDIUMtest/llm/test_wrapper.py1623 # ================================================COMMENT
MEDIUMtest/llm/test_wrapper.py1625 # ================================================COMMENT
MEDIUMtest/llm/test_wrapper.py1701 # ================================================COMMENT
MEDIUMtest/llm/test_wrapper.py1703 # ================================================COMMENT
MEDIUMtest/llm/test_wrapper.py3964 # ------------------------------------------------------------------COMMENT
MEDIUMtest/llm/test_wrapper.py3966 # ------------------------------------------------------------------COMMENT
MEDIUMtest/llm/test_wrapper.py4135 # ------------------------------------------------------------------COMMENT
MEDIUMtest/llm/test_wrapper.py4137 # ------------------------------------------------------------------COMMENT
MEDIUMtest/llm/test_wrapper.py4390 # ------------------------------------------------------------------COMMENT
MEDIUMtest/llm/test_wrapper.py4392 # ------------------------------------------------------------------COMMENT
871 more matches not shown…
Unused Imports2253 hits · 1814 pts
SeverityFileLineSnippetContext
LOWsetup.py1CODE
LOWtest/test_configs.py6CODE
LOWtest/test_shared.py5CODE
LOWtest/test_exploration.py5CODE
LOWtest/smoke_test.py5CODE
LOWtest/test_utils.py5CODE
LOWtest/conftest.py5CODE
LOWtest/opengl_rendering.py26CODE
LOWtest/opengl_rendering.py33CODE
LOWtest/opengl_rendering.py71CODE
LOWtest/test_docstring_args_checker.py1CODE
LOWtest/test_offline_to_online.py5CODE
LOWtest/test_custom_envs.py5CODE
LOWtest/test_inference_server.py5CODE
LOWtest/test_loggers.py5CODE
LOWtest/test_rlhf.py5CODE
LOWtest/test_postprocs.py5CODE
LOWtest/test_specs.py5CODE
LOWtest/smoke_test_deps.py5CODE
LOWtest/smoke_test_deps.py33CODE
LOWtest/smoke_test_deps.py34CODE
LOWtest/smoke_test_deps.py35CODE
LOWtest/smoke_test_deps.py36CODE
LOWtest/smoke_test_deps.py108CODE
LOWtest/test_render.py5CODE
LOWtest/test_distributions.py5CODE
LOWtest/test_collectors.py5CODE
LOWtest/test_helpers.py5CODE
LOWtest/test_distributed.py9CODE
LOWtest/test_trainer.py5CODE
LOWtest/test_rnd.py5CODE
LOWtest/test_checkpoint.py5CODE
LOWtest/collectors/test_evaluator.py5CODE
LOWtest/llm/test_vllm.py5CODE
LOWtest/llm/test_llm_objectives.py5CODE
LOWtest/llm/test_wrapper.py5CODE
LOWtest/llm/smoke_test_llm.py5CODE
LOWtest/llm/test_sglang_updaters.py6CODE
LOWtest/llm/test_sglang.py6CODE
LOWtest/llm/test_vllm_plugin.py5CODE
LOWtest/llm/test_llm_envs.py5CODE
LOWtest/llm/smoke_test_llm_deps.py5CODE
LOWtest/llm/test_llm_transforms.py6CODE
LOWtest/llm/test_llm_collectors.py5CODE
LOWtest/llm/test_llm_updaters.py5CODE
LOWtest/llm/test_llm_updaters.py30CODE
LOWtest/llm/test_data.py6CODE
LOWtest/llm/libs/test_mlgym.py5CODE
LOWtest/objectives/test_controllers.py6CODE
LOWtest/objectives/test_loss_module.py6CODE
LOWtest/objectives/test_loss_module.py79CODE
LOWtest/objectives/test_loss_module.py79CODE
LOWtest/objectives/conftest.py5CODE
LOWtest/objectives/test_mappo.py12CODE
LOWtest/objectives/test_cql.py6CODE
LOWtest/objectives/test_cql.py28CODE
LOWtest/objectives/test_cql.py28CODE
LOWtest/objectives/test_cql.py28CODE
LOWtest/objectives/test_bc.py5CODE
LOWtest/objectives/_objectives_common.py5CODE
2193 more matches not shown…
Docstring Block Structure171 hits · 842 pts
SeverityFileLineSnippetContext
HIGH…ta-implementations/vla_grpo/openvla_oft/train_utils.py59 Find a specific checkpoint file matching a pattern. Args: pretrained_checkpoint: Path to the checkpoinSTRING
HIGHsota-implementations/dreamer/dreamer_utils.py85Allocate CUDA devices for collectors, reserving cuda:0 for training. Device allocation strategy: - Training alwSTRING
HIGHsota-implementations/grpo/grpo_utils.py111Creates and configures the training model with LoRA adapters. This function initializes the main training model witSTRING
HIGHsota-implementations/grpo/grpo_utils.py196Creates the inference model for fast generation. This function initializes a model server (vLLM or SGLang) for effiSTRING
HIGHsota-implementations/grpo/grpo_utils.py540Creates and configures a HuggingFace model with optional optimizations. Args: model_name (str): HuggingFaceSTRING
HIGHsota-implementations/redq/utils.py177Creates a Trainer instance given its constituents. Args: collector (BaseCollector): A data collector to be STRING
HIGHsota-implementations/expert-iteration/ei_utils.py107Creates and configures the training model with LoRA adapters. This function initializes the main training model witSTRING
HIGHsota-implementations/expert-iteration/ei_utils.py188Creates the vLLM-based inference model for fast generation. This function initializes a vLLM model server for efficSTRING
HIGHsota-implementations/expert-iteration/ei_utils.py342Creates and configures a HuggingFace model with optional optimizations. Args: model_name (str): HuggingFaceSTRING
HIGHtorchrl/_utils.py1119Return the available accelerator device, or CPU if none is found. Checks for accelerator availability in the followSTRING
HIGHtorchrl/_utils.py1240Compile a model with warm-up. This function wraps :func:`~torch.compile` to add a warm-up phase. During the warm-upSTRING
HIGHtorchrl/_utils.py1417Return current CUDA memory statistics for ``device`` in gigabytes. Wraps :func:`torch.cuda.memory_allocated`, :funcSTRING
HIGHtorchrl/_utils.py1803Merge user-provided ray_init_config with default runtime_env excludes. This function ensures that the default TorchSTRING
HIGHtorchrl/weight_update/utils.py32Resolve an attribute path like 'policy' or 'env.value_net' to actual object. Also processes getitem notation like 'STRING
HIGHtorchrl/collectors/_base.py651Execute a method on a nested attribute of this collector. This method allows remote callers to invoke methods oSTRING
HIGHtorchrl/collectors/_base.py684Get a nested attribute of this collector. This method allows remote callers to retrieve attributes from nested STRING
HIGHtorchrl/collectors/_base.py715Apply a method to each set of arguments. This method executes a method on the collector with different argumentSTRING
HIGHtorchrl/collectors/_base.py986Update policy weights for the data collector. This method synchronizes the policy weights used by the collectorSTRING
HIGHtorchrl/collectors/_base.py1267Receive and apply weights to the collector's policy. This method applies weights to the local policy. When receSTRING
HIGHtorchrl/collectors/_multi_base.py1196Receive from a pipe while periodically checking worker health. This method prevents the main process from hangiSTRING
HIGHtorchrl/collectors/_multi_base.py1967Sets the seeds of the environments stored in the DataCollector. Args: seed: integer representing thSTRING
HIGHtorchrl/collectors/_multi_base.py2112Get an attribute from the policy of the first worker. Args: attr (str): The attribute name to retriSTRING
HIGHtorchrl/collectors/_multi_base.py2138Get an attribute from the environment of the first worker. Args: attr (str): The attribute name to STRING
HIGHtorchrl/collectors/_multi_base.py2168Get model instance by ID (for weight sync schemes). Args: model_id: Model identifier (e.g., "policySTRING
HIGHtorchrl/collectors/utils.py98A util function for trajectory separation. Takes a tensordict with a key traj_ids that indicates the id of each traSTRING
HIGHtorchrl/collectors/_single.py1738Sets the seeds of the environments stored in the DataCollector. Args: seed (int): integer representSTRING
HIGHtorchrl/collectors/_single.py2527Get model instance by ID (for weight sync schemes). Args: model_id: Model identifier (e.g., "policySTRING
HIGHtorchrl/collectors/distributed/default_configs.py61Create a TCPStore with retry logic for handling port conflicts. This function attempts to create a TCPStore, and ifSTRING
HIGHtorchrl/record/recorder.py333Convert recorded frames to a Matplotlib animation. This helper is intended for tutorials and notebooks where thSTRING
HIGHtorchrl/render/checkpoint.py52Writes a checkpoint in the layout expected by rlrender factories. The model weights are stored under the canonical STRING
HIGHtorchrl/render/mujoco_wasm.py57Writes a local Vite viewer for MuJoCo WASM notebook rendering. Args: output_dir: Directory that will contaiSTRING
HIGHtorchrl/render/mujoco_wasm.py125Starts and displays a generated MuJoCo WASM viewer in a notebook. Args: viewer_dir: Directory produced by :STRING
HIGHtorchrl/render/mujoco_wasm.py184Sends one qpos vector to a live MuJoCo WASM notebook viewer. Args: qpos: Iterable of joint position values.STRING
HIGHtorchrl/render/mujoco_wasm.py235Plays a qpos trajectory in a live MuJoCo WASM notebook viewer. Args: qpos: Iterable of waypoints, each contSTRING
HIGHtorchrl/render/mujoco_wasm.py312Extracts a qpos trajectory from a rollout TensorDict. Args: rollout: Rollout TensorDict saved by ``rlrenderSTRING
HIGHtorchrl/render/backends/mujoco.py53Returns a detached snapshot of the environment's MuJoCo state. Args: env: TorchRL-native MuJoCo envSTRING
HIGHtorchrl/objectives/dreamer_v3.py73Return DreamerV3 dynamics and representation KL losses. The dynamics term stops gradients through the posterior andSTRING
HIGHtorchrl/objectives/dreamer_v3.py121KL divergence with balancing between posterior and prior. Computes: loss = alpha * KL(sg(posterior) || prioSTRING
HIGHtorchrl/objectives/dreamer_v3.py1163Compute the DreamerV3 critic loss on a replay sequence. The return of each replay state uses the reward of the STRING
HIGHtorchrl/objectives/common.py855Value-function constructor. If the non-default value function is wanted, it must be built using this meSTRING
HIGHtorchrl/objectives/llm/distillation.py27Per-token k3 estimate of the KL divergence to a target distribution. Uses the k3 estimator ``exp(d) - 1 - d`` with STRING
HIGHtorchrl/objectives/value/advantages.py1099Computes the TD(0) advantage given the data in tensordict. If a functional module is provided, a nested TensorDSTRING
HIGHtorchrl/objectives/value/advantages.py1388Computes the TD(1) advantage given the data in tensordict. If a functional module is provided, a nested TensorDSTRING
HIGHtorchrl/objectives/value/advantages.py1701Computes the TD(:math:`\lambda`) advantage given the data in tensordict. If a functional module is provided, a STRING
HIGHtorchrl/objectives/value/advantages.py2078Computes the GAE given the data in tensordict. If a functional module is provided, a nested TensorDict containiSTRING
HIGHtorchrl/objectives/value/advantages.py2691Computes the V-Trace correction given the data in tensordict. If a functional module is provided, a nested TensSTRING
HIGHtorchrl/objectives/value/functional.py1393Compute the discounted cumulative sum of rewards given multiple trajectories and the episode ends. Args: reSTRING
HIGHtorchrl/_comm/backends.py79Return the canonical spelling of a TorchRL service backend. The long ``threading`` and ``multiprocessing`` spellingSTRING
HIGHtorchrl/_comm/backends.py104Return the canonical spelling of a TorchRL payload transport. Args: backend: Transport selector to validateSTRING
HIGHtorchrl/trainers/trainers.py2893Resolve a module from a trainer using a string path. Args: trainer (Trainer): The trainer instance to resolSTRING
HIGHtorchrl/trainers/helpers/models.py67DQN constructor helper function. Args: proof_environment (EnvBase): a dummy environment to retrieve the obsSTRING
HIGHtorchrl/trainers/helpers/trainers.py90Creates a Trainer instance given its constituents. Args: collector (BaseCollector): A data collector to be STRING
HIGHtorchrl/modules/functional.py12Apply the element-wise symmetric logarithm transform. The transform is defined as ``sign(value) * log(1 + abs(vSTRING
HIGHtorchrl/modules/functional.py42Apply the inverse symmetric exponential transform element-wise. Args: value (torch.Tensor): Input tensor inSTRING
HIGHtorchrl/modules/functional.py69Apply the signed hyperbolic value transform. This is the scale-compressing transform introduced by Pohlen et al. anSTRING
HIGHtorchrl/modules/functional.py108Apply the inverse of :func:`signed_hyperbolic` element-wise. Args: value (torch.Tensor): Input tensor in siSTRING
HIGHtorchrl/modules/llm/backends/vllm/vllm_async.py1435Create a load balancer for this AsyncVLLM service. Args: strategy: Load balancing strategy or sequeSTRING
HIGHtorchrl/modules/llm/backends/vllm/vllm_async.py1657Select the optimal actor index based on the configured strategy hierarchy. Args: prompt: The input STRING
HIGHtorchrl/modules/llm/backends/vllm/vllm_async.py1776Select actor based on prompt prefix for cache locality. Args: prompt: Input prompt as string or tokSTRING
HIGHtorchrl/modules/llm/backends/vllm/vllm_async.py1826Extract prefix tokens from prompt (string or token list). Args: prompt: Input prompt. RetuSTRING
111 more matches not shown…
Self-Referential Comments198 hits · 508 pts
SeverityFileLineSnippetContext
MEDIUMtest/test_configs.py1051 # Create a complex configurationCOMMENT
MEDIUMtest/test_configs.py2442 # Create a test script that follows the patternCOMMENT
MEDIUMtest/test_configs.py2463 # Create the config directory structureSTRING
MEDIUMtest/test_exploration.py688 # Create a policy with exploration module that has spec=NoneCOMMENT
MEDIUMtest/test_exploration.py1132 # Create a simple network with NoisyLinear using new behaviorCOMMENT
MEDIUMtest/test_utils.py624 # Create a tensor with batch dimensionCOMMENT
MEDIUMtest/test_postprocs.py230 # Create a sample TensorDictCOMMENT
MEDIUMtest/test_postprocs.py244 # Create an instance of LastRewardToTrajCOMMENT
MEDIUMtest/test_specs.py4576 # Create a OneHot spec with a mask that varies across batch dimensionCOMMENT
MEDIUMtest/smoke_test_deps.py16# This file is a smoke test for optional deps. All optional-dep imports mustCOMMENT
MEDIUMtest/test_collectors.py6313 # Create a ParallelEnv factory - this is the key component that was failingCOMMENT
MEDIUMtest/test_collectors.py6331 # Create the multi-collector with ParallelEnv and replay_bufferCOMMENT
MEDIUMtest/test_collectors.py6403 # Create a simple dummy environmentCOMMENT
MEDIUMtest/test_collectors.py6409 # Create a simple dummy policyCOMMENT
MEDIUMtest/test_collectors.py6717 # Create a deterministic policy (linear, no bias) so zeroing weights → zero actionsCOMMENT
MEDIUMtest/llm/test_conversions.py116 # Create a batch of ChatHistory objectsCOMMENT
MEDIUMtest/llm/test_conversions.py427 # Create a 2x2 batchCOMMENT
MEDIUMtest/llm/test_conversions.py429 # Create a 2x2 batch of ChatHistory objectsCOMMENT
MEDIUMtest/llm/test_conversions.py62 # Create a batch of ChatHistory objectsCOMMENT
MEDIUMtest/llm/test_conversions.py181 # Create a batch of ChatHistory objectsCOMMENT
MEDIUMtest/llm/test_conversions.py233 # Create a batch of ChatHistory objectsCOMMENT
MEDIUMtest/llm/test_conversions.py310 # Create a batch of ChatHistory objectsCOMMENT
MEDIUMtest/llm/test_conversions.py408 # Create a batch of ChatHistory objectsCOMMENT
MEDIUMtest/llm/test_vllm.py118 # Create a transformer policy with the same modelCOMMENT
MEDIUMtest/llm/test_vllm.py153 # Create a proper collector mock that provides access to the AsyncVLLM serviceCOMMENT
MEDIUMtest/llm/test_wrapper.py2734 # Create a custom mask matching the logits shapeCOMMENT
MEDIUMtest/llm/test_wrapper.py3385 # Create a simple mock function to test the decoratorCOMMENT
MEDIUMtest/llm/test_wrapper.py3393 # Create a mock self object with batching attributesCOMMENT
MEDIUMtest/llm/test_llm_envs.py850 # Define a simple calculator toolCOMMENT
MEDIUMtest/llm/test_llm_envs.py859 # Define the tool schemaCOMMENT
MEDIUMtest/llm/test_llm_envs.py970 # Define a tool that waits for a random amount of timeCOMMENT
MEDIUMtest/llm/test_llm_envs.py983 # Define the tool schemaCOMMENT
MEDIUMtest/llm/test_data.py577 # Create a simple historyCOMMENT
MEDIUMtest/llm/test_data.py726 # Create a custom template (trivially different from Qwen)COMMENT
MEDIUMtest/llm/test_data.py1000 # Create a batch of 2 prompt historiesCOMMENT
MEDIUMtest/objectives/test_loss_module.py1371 # Create a value estimator instanceCOMMENT
MEDIUMtest/objectives/test_loss_module.py1377 # Create a loss module that supports value estimationCOMMENT
MEDIUMtest/objectives/test_loss_module.py1470 # Create a GAE instanceCOMMENT
MEDIUMtest/objectives/test_loss_module.py1477 # Create a PPO lossCOMMENT
MEDIUMtest/objectives/test_loss_module.py1398 # Create a loss moduleCOMMENT
MEDIUMtest/objectives/test_loss_module.py1424 # Create a loss moduleCOMMENT
MEDIUMtest/objectives/test_loss_module.py1446 # Create a PPO loss which supports GAECOMMENT
MEDIUMtest/libs/test_envpool.py234 # Create the first env, set the seed, and perform a sequence of operationsCOMMENT
MEDIUMtest/libs/test_envpool.py248 # Create a new env, set the seed, and repeat same operationsCOMMENT
MEDIUMtest/libs/test_isaac.py937 # Create a fresh env with InitTracker (required for LSTM)COMMENT
MEDIUMtest/libs/test_isaac.py968 # Create a simple policy using the LSTM and move to correct deviceCOMMENT
MEDIUMtest/transforms/test_reward_transforms.py1208 # Create a simple env with multi-objective rewardsCOMMENT
MEDIUMtest/transforms/test_reward_transforms.py1211 # Create a composed transform with LineariseRewards and RewardScalingCOMMENT
MEDIUMtest/transforms/test_reward_transforms.py1250 # Create a dummy env that produces nested rewardsCOMMENT
MEDIUMtest/transforms/test_compose_and_env.py633 # Create a Compose transform that renames "action" to "action_1" and then to "action_2"COMMENT
MEDIUMtest/transforms/test_module_transforms.py224 # Create a simple module that adds a learnable bias to observationsCOMMENT
MEDIUMtest/rb/test_samplers.py1512 # Create a new buffer with the loaded storage but NEW samplerCOMMENT
MEDIUMtest/rb/test_storages.py414 # Create a list of tensordicts (like a collector would produce)COMMENT
MEDIUMtest/rb/test_storages.py752 # Create an instance of LazyStackStorage with given parametersCOMMENT
MEDIUMtest/rb/test_storages.py754 # Create a ReplayBuffer using the created storageCOMMENT
MEDIUMtest/rb/test_storages.py1548 # Create a script that creates a storage and exits normallyCOMMENT
MEDIUMtest/rb/test_storages.py1579 # Create a script that sleeps and can be interruptedCOMMENT
MEDIUM…ta-implementations/vla_grpo/openvla_oft/train_utils.py9 # Create a tensor marking positions of IGNORE_INDEXCOMMENT
MEDIUM…ta-implementations/vla_grpo/openvla_oft/train_utils.py15 # Create the maskCOMMENT
MEDIUM…ta-implementations/vla_grpo/openvla_oft/train_utils.py26 # Create a tensor marking positions of IGNORE_INDEXCOMMENT
138 more matches not shown…
Deep Nesting548 hits · 445 pts
SeverityFileLineSnippetContext
LOWsetup.py145CODE
LOWpackaging/wheel/relocate.py76CODE
LOWtest/test_configs.py1479CODE
LOWtest/test_configs.py2438CODE
LOWtest/test_utils.py379CODE
LOWtest/opengl_rendering.py87CODE
LOWtest/test_specs.py3482CODE
LOWtest/test_specs.py3528CODE
LOWtest/test_specs.py1910CODE
LOWtest/test_specs.py2245CODE
LOWtest/test_specs.py2530CODE
LOWtest/test_specs.py2826CODE
LOWtest/test_collectors.py1567CODE
LOWtest/test_collectors.py1649CODE
LOWtest/test_collectors.py2519CODE
LOWtest/test_collectors.py2871CODE
LOWtest/test_collectors.py3775CODE
LOWtest/test_collectors.py4214CODE
LOWtest/test_collectors.py4375CODE
LOWtest/test_collectors.py4590CODE
LOWtest/test_collectors.py4656CODE
LOWtest/test_collectors.py5503CODE
LOWtest/test_collectors.py5524CODE
LOWtest/test_collectors.py5554CODE
LOWtest/test_collectors.py6381CODE
LOWtest/test_collectors.py6543CODE
LOWtest/test_collectors.py6798CODE
LOWtest/test_collectors.py8616CODE
LOWtest/test_collectors.py8673CODE
LOWtest/test_mcts.py107CODE
LOWtest/test_mcts.py853CODE
LOWtest/test_distributed.py442CODE
LOWtest/test_distributed.py568CODE
LOWtest/test_distributed.py784CODE
LOWtest/test_distributed.py1524CODE
LOWtest/test_distributed.py1623CODE
LOWtest/test_trainer.py381CODE
LOWtest/test_trainer.py758CODE
LOWtest/test_trainer.py1147CODE
LOWtest/llm/test_vllm.py116CODE
LOWtest/llm/test_wrapper.py469CODE
LOWtest/llm/test_wrapper.py2337CODE
LOWtest/llm/test_llm_collectors.py242CODE
LOWtest/llm/test_llm_collectors.py349CODE
LOWtest/llm/test_data.py494CODE
LOWtest/objectives/test_loss_module.py182CODE
LOWtest/objectives/test_cql.py174CODE
LOWtest/objectives/_objectives_common.py208CODE
LOWtest/objectives/_objectives_common.py209CODE
LOWtest/objectives/test_iql.py289CODE
LOWtest/objectives/test_iql.py544CODE
LOWtest/objectives/test_iql.py1205CODE
LOWtest/objectives/test_iql.py1378CODE
LOWtest/objectives/test_ddpg.py375CODE
LOWtest/objectives/test_ddpg.py999CODE
LOWtest/objectives/test_ddpg.py1257CODE
LOWtest/objectives/test_ddpg.py1922CODE
LOWtest/objectives/test_ddpg.py2089CODE
LOWtest/objectives/test_ppo.py399CODE
LOWtest/objectives/test_ppo.py508CODE
488 more matches not shown…
Excessive Try-Catch Wrapping390 hits · 400 pts
SeverityFileLineSnippetContext
LOWsetup.py353 except Exception:CODE
MEDIUMsetup.py346def _git_output(args) -> str | None:CODE
LOWtest/test_configs.py2517 except Exception:STRING
LOWtest/test_setup.py216except Exception as err:CODE
MEDIUMtest/test_inference_server.py1353def run(idx):CODE
MEDIUMtest/test_inference_server.py2150def _hammer(server, fn_name):CODE
LOWtest/test_inference_server.py1359 except Exception as exc: # noqa: BLE001CODE
LOWtest/test_inference_server.py2155 except Exception as exc:CODE
LOWtest/test_inference_server.py2603 except Exception:CODE
LOWtest/test_loggers.py757 except Exception:CODE
LOWtest/smoke_test_deps.py109 except Exception: # pragma: no coverCODE
LOWtest/smoke_test_deps.py113 except Exception as err: # gymnasium.error.NamespaceNotFound and similarCODE
MEDIUMtest/smoke_test_deps.py89def test_gym():CODE
MEDIUMtest/test_collectors.py2464def test_cudagraph_policy_stochastic_diversity(self):CODE
LOWtest/test_collectors.py5261 except Exception:CODE
LOWtest/test_collectors.py5276 except Exception:CODE
LOWtest/test_collectors.py5226 except Exception as e:CODE
LOWtest/test_collectors.py5307 except Exception:CODE
MEDIUMtest/test_distributed.py309def _test_distributed_collector_basic(cls, queue, frames_per_batch):CODE
MEDIUMtest/test_distributed.py355def _test_distributed_collector_mult(cls, queue, frames_per_batch):CODE
MEDIUMtest/test_distributed.py398def _test_distributed_collector_sync(cls, queue, sync):CODE
MEDIUMtest/test_distributed.py517def _test_distributed_collector_class(cls, queue, collector_class):CODE
MEDIUMtest/test_distributed.py568def _test_distributed_collector_updatepolicy(CODE
MEDIUMtest/test_distributed.py895def reset_process_group(self):CODE
MEDIUMtest/test_distributed.py1781def reset_process_group(self):CODE
LOWtest/test_distributed.py329 except Exception as e:CODE
LOWtest/test_distributed.py374 except Exception as e:CODE
LOWtest/test_distributed.py418 except Exception as e:CODE
LOWtest/test_distributed.py479 except Exception as e:CODE
LOWtest/test_distributed.py537 except Exception as e:CODE
LOWtest/test_distributed.py630 except Exception as e:CODE
LOWtest/test_distributed.py698 except Exception as e:CODE
LOWtest/test_distributed.py830 except Exception as e:CODE
LOWtest/test_distributed.py898 except Exception:CODE
LOWtest/test_distributed.py1784 except Exception:CODE
LOWtest/llm/test_llm_objectives.py1395 except Exception as e:CODE
LOWtest/llm/test_wrapper.py109 except Exception as e:CODE
LOWtest/llm/test_wrapper.py142 except Exception as e:CODE
LOWtest/llm/test_wrapper.py588 except Exception as e:CODE
LOWtest/llm/test_wrapper.py2890 except Exception as e:CODE
LOWtest/llm/test_wrapper.py3155 except Exception as e:CODE
LOWtest/llm/test_wrapper.py3309 except Exception as e:CODE
LOWtest/llm/test_wrapper.py3536 except Exception:CODE
LOWtest/llm/test_sglang_updaters.py255 except Exception as e:CODE
LOWtest/llm/test_llm_envs.py1298 except Exception as e:CODE
LOWtest/llm/test_llm_updaters.py135 except Exception as e:CODE
LOWtest/llm/test_llm_updaters.py272 except Exception as e:CODE
LOWtest/llm/test_llm_updaters.py346 except Exception as e:CODE
LOWtest/llm/test_llm_updaters.py400 except Exception as e:CODE
LOWtest/llm/test_data.py691 except Exception as e:CODE
LOWtest/libs/conftest.py33 except Exception:CODE
MEDIUMtest/libs/test_datasets.py790def test_correct_categorical_missions(self):CODE
LOWtest/libs/test_datasets.py445 except Exception as err:CODE
LOWtest/libs/test_datasets.py550 except Exception:CODE
LOWtest/libs/test_datasets.py555 except Exception:CODE
LOWtest/libs/test_datasets.py797 except Exception as e:CODE
MEDIUMtest/libs/test_gym.py119def get_gym_pixel_wrapper():CODE
LOWtest/libs/test_gym.py68 except Exception:CODE
LOWtest/libs/test_gym.py125 except Exception:CODE
LOWtest/libs/test_gym.py139 except Exception:CODE
330 more matches not shown…
Over-Commented Block503 hits · 372 pts
SeverityFileLineSnippetContext
LOWbuild_nightly.sh41# PyPI rejects PEP 440 local version identifiers (e.g. "+g<sha>"). Pin theCOMMENT
LOWpyproject.toml261# Auto-loaded by vLLM in every process (main, workers, and the registryCOMMENT
LOWpackaging/pkg_helpers.bash1# A set of useful bash functions for common functionality we need to do inCOMMENT
LOWpackaging/pkg_helpers.bash21# /usr/local/cuda-*COMMENT
LOWpackaging/pkg_helpers.bash201COMMENT
LOWtest/opengl_rendering.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOWtest/opengl_rendering.py41COMMENT
LOWtest/test_collectors.py2041 def test_no_deepcopy_policy(self, collector_type):COMMENT
LOWtest/test_collectors.py2921 # Use -1 for padding to uniform with other preemptionCOMMENT
LOWtest/test_collectors.py3561 )COMMENT
LOWtest/test_collectors.py3581# ) and not torch.cuda.is_available():COMMENT
LOWtest/test_collectors.py3601# else:COMMENT
LOWtest/test_collectors.py3621# policy=policy,COMMENT
LOWtest/test_collectors.py3641# frames_per_batch=20,COMMENT
LOWtest/test_collectors.py3661# @pytest.mark.parametrize("env_name", ["vec"])COMMENT
LOWtest/test_collectors.py3681# create_env_kwargs=[{"seed": i} for i in range(seed, seed + num_env)],COMMENT
LOWtest/test_collectors.py3701# assert (d["done"].sum(-2) >= 1).all()COMMENT
LOWtest/test_collectors.py3721# create_env_fn=env_fn,COMMENT
LOWtest/test_collectors.py3821 # Debug: shutting down collectorCOMMENT
LOWtest/test_collectors.py3841 # assert collector.policy.out_keys == ["action"]COMMENT
LOWtest/llm/test_wrapper.py2841 # """Setup and teardown for each test.COMMENT
LOWtest/objectives/test_loss_module.py1181class TestBuffer:COMMENT
LOWtest/libs/test_isaac.py401 # "AllegroKukaTwoArms",COMMENT
LOWtest/modules/test_td_module.py221COMMENT
LOWtest/envs/test_env_base.py661COMMENT
LOWtest/rb/conftest.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOWtest/rb/test_storage_map.py561 node_id = vertex.node_idCOMMENT
LOWsota-implementations/multiagent/utils/__init__.py1# Copyright (c) Meta Platforms, Inc. and affiliates.COMMENT
LOWsota-implementations/vla_grpo/openvla.py61PROMPT_TEMPLATE = "In: What action should the robot take to {instruction}?\nOut:"COMMENT
LOWsota-implementations/vla_grpo/openvla_oft/__init__.py1# Vendored from SimpleVLA-RL (https://github.com/PRIME-RL/SimpleVLA-RL),COMMENT
LOW…ementations/vla_grpo/openvla_oft/modeling_prismatic.py521 dtype=labels.dtype,COMMENT
LOW…ementations/vla_grpo/openvla_oft/modeling_prismatic.py541 # proprio=None,COMMENT
LOW…ementations/vla_grpo/openvla_oft/modeling_prismatic.py561COMMENT
LOW…ementations/vla_grpo/openvla_oft/modeling_prismatic.py581 # # === Handle Unimodal Forward ===COMMENT
LOW…ementations/vla_grpo/openvla_oft/modeling_prismatic.py601 # assert past_key_values is None, "Unexpected key `past_key_values` provided during multimodal forward!"COMMENT
LOW…ementations/vla_grpo/openvla_oft/modeling_prismatic.py621 # # Add proprioceptive state if providedCOMMENT
LOW…ementations/vla_grpo/openvla_oft/modeling_prismatic.py641 # noisy_actions = noisy_actions.reshape(B, -1).unsqueeze(-1)COMMENT
LOW…ementations/vla_grpo/openvla_oft/modeling_prismatic.py661 # # Build labels for multimodal sequence if neededCOMMENT
LOW…ementations/vla_grpo/openvla_oft/modeling_prismatic.py681COMMENT
LOW…ementations/vla_grpo/openvla_oft/modeling_prismatic.py821 output_hidden_states=False,COMMENT
LOW…ementations/vla_grpo/openvla_oft/modeling_prismatic.py841 COMMENT
LOW…ementations/vla_grpo/openvla_oft/modeling_prismatic.py861COMMENT
LOW…ementations/vla_grpo/openvla_oft/modeling_prismatic.py881 # #print("!!!!!!!!!!!!!!Entering forward!!!!!!!!!!")COMMENT
LOW…ementations/vla_grpo/openvla_oft/modeling_prismatic.py901 # # Add stop token to sequence (needed in non-causal bi-directional self-attention, as it appears at train time)COMMENT
LOW…ementations/vla_grpo/openvla_oft/modeling_prismatic.py921 # #test COMMENT
LOW…ementations/vla_grpo/openvla_oft/modeling_prismatic.py941 COMMENT
LOW…ementations/vla_grpo/openvla_oft/modeling_prismatic.py961 # newline_positions = labels != IGNORE_INDEXCOMMENT
LOW…ementations/vla_grpo/openvla_oft/modeling_prismatic.py981COMMENT
LOW…ementations/vla_grpo/openvla_oft/modeling_prismatic.py1001 # projected_patch_embeddings, proprio, proprio_projectorCOMMENT
LOW…ementations/vla_grpo/openvla_oft/modeling_prismatic.py1021 # # Run diffusion-based predictionCOMMENT
LOW…ementations/vla_grpo/openvla_oft/modeling_prismatic.py1041 # # labels,COMMENT
LOW…ementations/vla_grpo/openvla_oft/modeling_prismatic.py1061 # (projected_patch_embeddings.shape[0], projected_patch_embeddings.shape[1]),COMMENT
LOW…ementations/vla_grpo/openvla_oft/modeling_prismatic.py1081COMMENT
LOW…ementations/vla_grpo/openvla_oft/modeling_prismatic.py1281 else:COMMENT
LOW…ementations/vla_grpo/openvla_oft/modeling_prismatic.py1641 # if action_head is not None:COMMENT
LOW…ementations/vla_grpo/openvla_oft/modeling_prismatic.py1661 device = language_model_output.logits.deviceCOMMENT
LOW…a-implementations/vla_grpo/config/vla_grpo_libero.yaml1# SimpleVLA-RL (arXiv:2509.09674) on LIBERO: OpenVLA-OFT token variant (7B),COMMENT
LOWsota-implementations/cql/utils.py261COMMENT
LOWsota-implementations/rnd/rnd_mujoco.py81 # The env already normalizes and clips observations with VecNorm andCOMMENT
LOWsota-implementations/dreamer/dreamer_utils.py181COMMENT
443 more matches not shown…
Modern Structural Boilerplate354 hits · 348 pts
SeverityFileLineSnippetContext
LOWsetup.py26logger = logging.getLogger(__name__)CODE
LOWpackaging/prepare_nightly_build.py7logger = logging.getLogger(__name__)CODE
LOWtest/conftest.py81def set_warnings() -> None:STRING
LOWtest/test_render.py162 def _set_seed(self, seed: int | None) -> None:CODE
LOWtest/test_collectors.py1754 def _set_seed(self, seed: Optional[int]) -> None:CODE
LOWtest/test_collectors.py3207 def _set_seed(self, seed: int | None = None) -> None:CODE
LOWtest/test_collectors.py3264 def _set_seed(self, seed: int | None = None) -> None:CODE
LOWtest/test_collectors.py3439 def _set_seed(self, seed: int | None) -> None:CODE
LOWtest/test_collectors.py4550 def _set_seed(self, seed: int | None) -> None:CODE
LOWtest/collectors/test_evaluator.py1041 def set_extra_state(self, state: OrderedDict) -> None:CODE
LOWtest/objectives/_objectives_common.py132 def _set_seed(self, seed: int | None) -> None:CODE
LOWtest/libs/test_gym.py195 def _set_seed(self, seed: int | None) -> None:CODE
LOWtest/transforms/test_action_transforms.py135 def _set_seed(self, seed: int | None) -> None:CODE
LOWtest/transforms/test_key_transforms.py95 def _set_seed(self, seed: int | None) -> None:CODE
LOWtest/transforms/test_key_transforms.py333 def _set_seed(self, seed: int | None) -> None:CODE
LOWtest/transforms/test_key_transforms.py934 def _set_seed(self, seed: int | None) -> None:CODE
LOWtest/transforms/test_reward_transforms.py1284 def _set_seed(self, seed: int | None = None) -> None:CODE
LOWtest/transforms/test_reward_transforms.py1344 def _set_seed(self, seed: int | None = None) -> None:CODE
LOWtest/transforms/test_compose_and_env.py174 def _set_seed(self, seed: int) -> None:CODE
LOWtest/transforms/test_compose_and_env.py1175 def _set_seed(self, seed: int | None) -> None:CODE
LOWtest/transforms/test_env_transforms.py439 def _set_seed(self, seed: int | None) -> None:CODE
LOWtest/transforms/test_normalization.py79 def _set_seed(self, seed: int | None) -> None:CODE
LOWtest/envs/test_env_base.py142 def _set_seed(self, seed: int | None) -> None:CODE
LOWtest/envs/test_env_base.py318 def _set_seed(self, seed: int | None) -> None:CODE
LOW…implementations/vla_grpo/compare_simplevla_rollouts.py229def _set_seed(seed: int) -> None:CODE
LOW…ementations/vla_grpo/openvla_oft/modeling_prismatic.py395 def set_input_embeddings(self, value: nn.Module) -> None:CODE
LOW…ementations/vla_grpo/openvla_oft/modeling_prismatic.py401 def set_output_embeddings(self, new_embeddings: nn.Module) -> None:CODE
LOW…ementations/vla_grpo/openvla_oft/modeling_prismatic.py407 def set_decoder(self, decoder: nn.Module) -> None:CODE
LOW…ementations/vla_grpo/openvla_oft/modeling_prismatic.py43logger = logging.getLogger(__name__)CODE
LOW…ementations/vla_grpo/openvla_oft/modeling_prismatic.py199 def set_num_images_in_input(self, num_images_in_input: int) -> None:CODE
LOWsota-implementations/bandits/dqn.py91 def _set_seed(self, seed: int | None) -> None:CODE
LOWexamples/replay-buffers/filter-imcomplete-trajs.py33 def _update_repertoire(self, tensordict: TensorDictBase) -> None:CODE
LOWexamples/rlhf/models/actor_critic.py15__all__ = ["init_actor_critic"]CODE
LOWexamples/rlhf/data/__init__.py3__all__ = ["get_prompt_dataloader_tldr"]CODE
LOWexamples/envs/benchmark_compile_step_and_maybe_reset.py110 def _set_seed(self, seed: int | None) -> None:CODE
LOWbenchmarks/conftest.py143def set_warnings() -> None:STRING
LOWbenchmarks/test_collectors_benchmark.py51 def _set_seed(self, seed: int | None) -> None:CODE
LOWbenchmarks/bench_collectors.py117 def _set_seed(self, seed: int) -> None:CODE
LOWtorchrl/__init__.py143__all__ = [CODE
LOWtorchrl/_utils.py449def set_profiling_enabled(enabled: bool) -> None:CODE
LOWtorchrl/_utils.py1168 def set_mode(self, type: Any | None) -> None:CODE
LOWtorchrl/weight_update/weight_sync_schemes.py23__all__ = [CODE
LOWtorchrl/weight_update/__init__.py20__all__ = [CODE
LOWtorchrl/weight_update/_shared.py266 def _update_single_worker(self, worker_idx: int, weights: TensorDictBase) -> None:CODE
LOWtorchrl/weight_update/_ray.py163 def set_model(self, model: Any) -> None:CODE
LOWtorchrl/weight_update/_ray.py171 def set_process_group(self, process_group, store=None) -> None:CODE
LOWtorchrl/weight_update/_ray.py176 def set_model_version(self, model_version: int | None) -> None:CODE
LOWtorchrl/weight_update/_ray.py534 def _set_model_version(self, model_version: int) -> None:CODE
LOWtorchrl/weight_update/_ray.py971 def _set_transform(self, ray_transform) -> None:CODE
LOWtorchrl/weight_update/llm/vllm_nccl.py641 def update_weights(self, weights: Any | None = None) -> None:CODE
LOWtorchrl/weight_update/llm/__init__.py26__all__ = [CODE
LOWtorchrl/weight_update/llm/vllm_double_buffer.py260 def update_weights(self, weights: Any | None = None) -> None:CODE
LOWtorchrl/collectors/_constants.py26__all__ = [CODE
LOWtorchrl/collectors/_base.py1209 def _set_received_policy_version(self, model_version: int | None) -> None:CODE
LOWtorchrl/collectors/collectors.py31__all__ = [CODE
LOWtorchrl/collectors/__init__.py27__all__ = [CODE
LOWtorchrl/collectors/_multi_base.py912 def _setup_preemptive_threshold(self, preemptive_threshold: float | None) -> None:CODE
LOWtorchrl/collectors/_multi_base.py1735 def _set_worker_attr(self, attr_name: str, value: Any) -> None:CODE
LOWtorchrl/collectors/_single.py1080 def _setup_policy_and_weights(self, policy: TensorDictModule | Callable) -> None:CODE
LOWtorchrl/collectors/_single.py1231 def _setup_max_frames_per_traj(self, max_frames_per_traj: int | None) -> None:CODE
294 more matches not shown…
Cross-File Repetition62 hits · 310 pts
SeverityFileLineSnippetContext
HIGHtest/llm/test_llm_objectives.py0create transformers model and tokenizer for testing.STRING
HIGHtest/llm/test_wrapper.py0create transformers model and tokenizer for testing.STRING
HIGHtest/llm/test_llm_envs.py0create transformers model and tokenizer for testing.STRING
HIGHtest/objectives/test_cql.py0regression test for target_entropy='auto' should be -dim(a).STRING
HIGHtest/objectives/test_dt.py0regression test for target_entropy='auto' should be -dim(a).STRING
HIGHtest/objectives/test_sac.py0regression test for target_entropy='auto' should be -dim(a).STRING
HIGHtest/libs/test_dm_control.py0smoke test that setting seed and reset works (seed forwarded into build).STRING
HIGHtest/libs/test_gym.py0smoke test that setting seed and reset works (seed forwarded into build).STRING
HIGHtest/libs/test_habitat.py0smoke test that setting seed and reset works (seed forwarded into build).STRING
HIGHsota-implementations/sac/sac.py0crossq example. this is a simple self-contained example of a crossq training script. it supports state environments likeSTRING
HIGHsota-implementations/discrete_sac/discrete_sac.py0crossq example. this is a simple self-contained example of a crossq training script. it supports state environments likeSTRING
HIGHsota-implementations/ddpg/ddpg.py0crossq example. this is a simple self-contained example of a crossq training script. it supports state environments likeSTRING
HIGHsota-implementations/td3/td3.py0crossq example. this is a simple self-contained example of a crossq training script. it supports state environments likeSTRING
HIGHsota-implementations/crossq/crossq.py0crossq example. this is a simple self-contained example of a crossq training script. it supports state environments likeSTRING
HIGHsota-implementations/cql/cql_offline.py0decision transformer example. this is a self-contained example of an offline decision transformer training script. the hSTRING
HIGHsota-implementations/cql/discrete_cql_offline.py0decision transformer example. this is a self-contained example of an offline decision transformer training script. the hSTRING
HIGHsota-implementations/iql/iql_offline.py0decision transformer example. this is a self-contained example of an offline decision transformer training script. the hSTRING
HIGHsota-implementations/td3_bc/td3_bc.py0decision transformer example. this is a self-contained example of an offline decision transformer training script. the hSTRING
HIGHsota-implementations/decision_transformer/online_dt.py0decision transformer example. this is a self-contained example of an offline decision transformer training script. the hSTRING
HIGHsota-implementations/decision_transformer/dt.py0decision transformer example. this is a self-contained example of an offline decision transformer training script. the hSTRING
HIGHsota-implementations/cql/cql_online.py0iql example. this is a self-contained example of an online iql training script. it works across gym and mujoco over a vaSTRING
HIGHsota-implementations/iql/discrete_iql.py0iql example. this is a self-contained example of an online iql training script. it works across gym and mujoco over a vaSTRING
HIGHsota-implementations/iql/iql_online.py0iql example. this is a self-contained example of an online iql training script. it works across gym and mujoco over a vaSTRING
HIGHsota-implementations/impala/impala_multi_node_ray.py0this script reproduces the impala algorithm results from espeholt et al. 2018 for the on atari environments.STRING
HIGHsota-implementations/impala/impala_single_node.py0this script reproduces the impala algorithm results from espeholt et al. 2018 for the on atari environments.STRING
HIGH…a-implementations/impala/impala_multi_node_submitit.py0this script reproduces the impala algorithm results from espeholt et al. 2018 for the on atari environments.STRING
HIGHsota-implementations/grpo/grpo-async.py0setup required environment variables and configurations.STRING
HIGHsota-implementations/grpo/grpo-sync.py0setup required environment variables and configurations.STRING
HIGH…lementations/expert-iteration/expert-iteration-sync.py0setup required environment variables and configurations.STRING
HIGH…ementations/expert-iteration/expert-iteration-async.py0setup required environment variables and configurations.STRING
HIGHexamples/distributed/collectors/single_machine/sync.py0rpc data collection on a single node. the default configuration works fine on machines equipped with 4 gpus, but can be STRING
HIGH…mples/distributed/collectors/single_machine/generic.py0rpc data collection on a single node. the default configuration works fine on machines equipped with 4 gpus, but can be STRING
HIGHexamples/distributed/collectors/single_machine/rpc.py0rpc data collection on a single node. the default configuration works fine on machines equipped with 4 gpus, but can be STRING
HIGHtorchrl/record/loggers/mlflow.py0logs a scalar value to the tensorboard. args: name (str): the name of the scalar. value (float): the value of the scalarSTRING
HIGHtorchrl/record/loggers/trackio.py0logs a scalar value to the tensorboard. args: name (str): the name of the scalar. value (float): the value of the scalarSTRING
HIGHtorchrl/record/loggers/csv.py0logs a scalar value to the tensorboard. args: name (str): the name of the scalar. value (float): the value of the scalarSTRING
HIGHtorchrl/record/loggers/tensorboard.py0logs a scalar value to the tensorboard. args: name (str): the name of the scalar. value (float): the value of the scalarSTRING
HIGHtorchrl/record/loggers/mlflow.py0logs the hyperparameters of the experiment. args: cfg (dictconfig or dict): the configuration of the experiment.STRING
HIGHtorchrl/record/loggers/wandb.py0logs the hyperparameters of the experiment. args: cfg (dictconfig or dict): the configuration of the experiment.STRING
HIGHtorchrl/record/loggers/trackio.py0logs the hyperparameters of the experiment. args: cfg (dictconfig or dict): the configuration of the experiment.STRING
HIGHtorchrl/record/loggers/csv.py0logs the hyperparameters of the experiment. args: cfg (dictconfig or dict): the configuration of the experiment.STRING
HIGHtorchrl/record/loggers/tensorboard.py0logs the hyperparameters of the experiment. args: cfg (dictconfig or dict): the configuration of the experiment.STRING
HIGHtorchrl/objectives/td3.py0maintains default values for all configurable tensordict keys. this class defines which tensordict keys can be set usingSTRING
HIGHtorchrl/objectives/td3_bc.py0maintains default values for all configurable tensordict keys. this class defines which tensordict keys can be set usingSTRING
HIGHtorchrl/objectives/iql.py0maintains default values for all configurable tensordict keys. this class defines which tensordict keys can be set usingSTRING
HIGHtorchrl/objectives/crossq.py0maintains default values for all configurable tensordict keys. this class defines which tensordict keys can be set usingSTRING
HIGHtorchrl/objectives/deprecated.py0maintains default values for all configurable tensordict keys. this class defines which tensordict keys can be set usingSTRING
HIGHtorchrl/objectives/redq.py0maintains default values for all configurable tensordict keys. this class defines which tensordict keys can be set usingSTRING
HIGHtorchrl/objectives/sac.py0maintains default values for all configurable tensordict keys. this class defines which tensordict keys can be set usingSTRING
HIGHtorchrl/objectives/ddpg.py0maintains default values for all configurable tensordict keys. this class defines which tensordict keys can be set usingSTRING
HIGHtorchrl/objectives/reinforce.py0maintains default values for all configurable tensordict keys. this class defines which tensordict keys can be set usingSTRING
HIGHtorchrl/objectives/ppo.py0maintains default values for all configurable tensordict keys. this class defines which tensordict keys can be set usingSTRING
HIGHtorchrl/objectives/a2c.py0maintains default values for all configurable tensordict keys. this class defines which tensordict keys can be set usingSTRING
HIGHtorchrl/objectives/cql.py0maintains default values for all configurable tensordict keys. this class defines which tensordict keys can be set usingSTRING
HIGHtorchrl/objectives/dqn.py0maintains default values for all configurable tensordict keys. this class defines which tensordict keys can be set usingSTRING
HIGHtorchrl/objectives/multiagent/qmixer.py0maintains default values for all configurable tensordict keys. this class defines which tensordict keys can be set usingSTRING
HIGHtorchrl/_comm/distributed.py0return ``true`` when the result can be read without blocking.STRING
HIGHtorchrl/_comm/mailbox.py0return ``true`` when the result can be read without blocking.STRING
HIGHtorchrl/modules/inference_server/_shared_memory.py0return ``true`` when the result can be read without blocking.STRING
HIGHtorchrl/modules/llm/policies/vllm_wrapper.py0returns a new version of the module with altered parameters. for instance, the generate parameter can be altered to enabSTRING
2 more matches not shown…
AI Structural Patterns275 hits · 242 pts
SeverityFileLineSnippetContext
LOWtest/test_postprocs.py300CODE
LOWtest/llm/test_llm_objectives.py660CODE
LOWtest/llm/test_wrapper.py636CODE
LOWtest/objectives/test_iql.py199CODE
LOWtest/objectives/test_iql.py1111CODE
LOWtest/objectives/test_dqn.py90CODE
LOWtest/objectives/test_dqn.py884CODE
LOWtest/objectives/test_ddpg.py138CODE
LOWtest/objectives/test_ddpg.py179CODE
LOWtest/objectives/test_ddpg.py905CODE
LOWtest/objectives/test_ddpg.py1827CODE
LOWtest/objectives/test_ppo.py74CODE
LOWtest/objectives/test_ppo.py262CODE
LOWtest/objectives/test_ppo.py314CODE
LOWtest/objectives/test_ppo.py1877CODE
LOWtest/objectives/test_ppo.py2029CODE
LOWtest/objectives/test_sac.py75CODE
LOWtest/objectives/test_sac.py257CODE
LOWtest/objectives/test_sac.py1585CODE
LOWtest/objectives/test_sac.py2420CODE
LOWtest/objectives/test_sac.py3269CODE
LOWtest/libs/test_datasets.py1153CODE
LOWtest/libs/test_envpool.py150CODE
LOWsota-implementations/vla_grpo/utils.py529CODE
LOWsota-implementations/vla_grpo/utils.py584CODE
LOWsota-implementations/vla_grpo/openvla.py186CODE
LOWsota-implementations/vla_grpo/openvla.py476CODE
LOWsota-implementations/vla_grpo/openvla.py815CODE
LOWsota-implementations/vla_grpo/openvla.py1101CODE
LOW…ations/vla_grpo/openvla_oft/configuration_prismatic.py76CODE
LOWsota-implementations/grpo/grpo_utils.py518CODE
LOWsota-implementations/decision_transformer/lamb.py38CODE
LOWsota-implementations/ppo/utils_mujoco.py43CODE
LOWsota-implementations/redq/utils.py561CODE
LOWsota-implementations/expert-iteration/ei_utils.py319CODE
LOWexamples/satellite/_utils.py443CODE
LOWexamples/satellite/_utils.py538CODE
LOWtorchrl/weight_update/_shared.py386CODE
LOWtorchrl/weight_update/_shared.py511CODE
LOWtorchrl/weight_update/_mp.py83CODE
LOWtorchrl/collectors/_base.py468CODE
LOWtorchrl/collectors/_single_async.py175CODE
LOWtorchrl/collectors/_multi_base.py423CODE
LOWtorchrl/collectors/_async_batched.py254CODE
LOWtorchrl/collectors/_single.py677CODE
LOWtorchrl/collectors/_single.py1762CODE
LOWtorchrl/collectors/_evaluator.py289CODE
LOWtorchrl/collectors/_runner.py36CODE
LOWtorchrl/collectors/llm/ray_collector.py82CODE
LOWtorchrl/collectors/llm/base.py146CODE
LOWtorchrl/collectors/distributed/sync.py288CODE
LOWtorchrl/collectors/distributed/generic.py542CODE
LOWtorchrl/collectors/distributed/ray.py348CODE
LOWtorchrl/collectors/distributed/rpc.py317CODE
LOWtorchrl/record/recorder.py142CODE
LOWtorchrl/record/loggers/monitoring.py219CODE
LOWtorchrl/render/mujoco_wasm.py220CODE
LOWtorchrl/objectives/td3.py224CODE
LOWtorchrl/objectives/iql.py269CODE
LOWtorchrl/objectives/iql.py826CODE
215 more matches not shown…
Cross-Language Confusion44 hits · 230 pts
SeverityFileLineSnippetContext
HIGHtest/test_inference_server.py1883 ws.push(new_weights)CODE
HIGHtest/test_inference_server.py1912 ws.push(new_weights)CODE
HIGHtest/envs/test_special.py254 board.push(move)CODE
HIGH.github/scripts/generate_dashboard.py310 document.getElementById('new-flaky-count').textContent = report.summary.new_flaky_count || 0;CODE
HIGH.github/scripts/generate_dashboard.py311 document.getElementById('resolved-count').textContent = report.summary.resolved_count || 0;CODE
HIGH.github/scripts/generate_dashboard.py344 if (!flakyTests || flakyTests.length === 0) {CODE
HIGH.github/scripts/generate_dashboard.py370 const lastFailed = test.recent_failures && test.recent_failures.length > 0CODE
HIGHtorchrl/_extension.py59 " - make sure you ran `python setup.py clean && python setup.py develop` and that no error was raised\n"CODE
HIGHtorchrl/render/mujoco_wasm.py833let model = null;CODE
HIGHtorchrl/render/mujoco_wasm.py834let data = null;CODE
HIGHtorchrl/render/mujoco_wasm.py835let mujoco = null;CODE
HIGHtorchrl/render/mujoco_wasm.py838let threeScene = null;CODE
HIGHtorchrl/render/mujoco_wasm.py839let renderer = null;CODE
HIGHtorchrl/render/mujoco_wasm.py840let camera = null;CODE
HIGHtorchrl/render/mujoco_wasm.py841let controls = null;CODE
HIGHtorchrl/render/mujoco_wasm.py844let trajectoryPlayback = null;CODE
HIGHtorchrl/render/mujoco_wasm.py1091 jointControls.push({name, jointId, qposAddress, slider, output});CODE
HIGHtorchrl/render/mujoco_wasm.py1098 if (!trajectoryUrl || params.get("autoplay") === "0") return;CODE
HIGHtorchrl/render/mujoco_wasm.py1103 const result = applyTrajectoryMessage(payload, null);CODE
HIGHtorchrl/render/mujoco_wasm.py1108 if (!value || typeof value !== "object") return null;CODE
HIGHtorchrl/render/mujoco_wasm.py1108 if (!value || typeof value !== "object") return null;CODE
HIGHtorchrl/render/mujoco_wasm.py1109 if (value.type !== "torchrl:mujoco_wasm:setQpos" && value.type !== "torchrl:mujoco_wasm:playTrajectory") return null;CODE
HIGHtorchrl/render/mujoco_wasm.py1214 if (renderer && camera) renderer.render(rendererScene(), camera);CODE
HIGHtorchrl/render/mujoco_wasm.py1222 if (!playback.loop && framePosition >= finalIndex) {CODE
HIGHtorchrl/render/mujoco_wasm.py1224 trajectoryPlayback = null;CODE
HIGHtorchrl/render/mujoco_wasm.py613 if (requestId && callbackUrl) {{CODE
HIGHtorchrl/render/mujoco_wasm.py620 if (message.ok === false || done || cancelled) {{CODE
HIGHtorchrl/render/mujoco_wasm.py996 visuals.push({geomId, object: mesh});CODE
HIGHtorchrl/render/mujoco_wasm.py1017 return null;CODE
HIGHtorchrl/render/mujoco_wasm.py1057 if (jointType !== HINGE_JOINT_TYPE && jointType !== SLIDE_JOINT_TYPE) continue;CODE
HIGHtorchrl/render/mujoco_wasm.py1162 if (out.length !== model.nq && out.length !== jointControls.length) throw new Error(`qpos must have model.nq (${model.CODE
HIGHtorchrl/render/mujoco_wasm.py1181 if (message.dt !== undefined) {CODE
HIGHtorchrl/render/mujoco_wasm.py1186 if (message.fps !== undefined) {CODE
HIGHtorchrl/render/mujoco_wasm.py1253 trajectoryPlayback = null;CODE
HIGHtorchrl/render/mujoco_wasm.py1263 if (!data || homeQpos.length < 3) return;CODE
HIGHtorchrl/render/mujoco_wasm.py1336 while (end < bytes.length && bytes[end] !== 0) end++;CODE
HIGHtorchrl/objectives/dreamer_v3.py125 + (1 - alpha) * KL(posterior || sg(prior))STRING
HIGHtorchrl/objectives/llm/distillation.py37 ``KL(sampling distribution || target distribution)``, and the directionSTRING
HIGHtorchrl/objectives/llm/distillation.py118 - ``"reverse"`` (default): minimizes ``KL(student || teacher)``. This isCODE
HIGHtorchrl/objectives/llm/distillation.py121 - ``"forward"``: minimizes ``KL(teacher || student)``. Here the scoredCODE
HIGHtorchrl/envs/common.py885 - The number of actions can be undefined, e.g., ``Categorical(n=-1)``;STRING
HIGHtorchrl/envs/transforms/_reward.py336 """Maps the reward to a binary value (0 or 1) if the reward is null or non-null, respectively.STRING
HIGHtorchrl/envs/custom/chess.py498 board.push(move)CODE
HIGHtorchrl/data/tensor_specs.py3825 n (int): number of possible outcomes. If set to -1, the cardinality of the categorical spec is undefined,STRING
Modern AI Meta-Vocabulary43 hits · 150 pts
SeverityFileLineSnippetContext
MEDIUMREADME.md143# Nested keys make multi-agent, recurrent, and next-state data explicit.COMMENT
MEDIUMtest/libs/test_mujoco_playground.py67# Cached environment dims for the multi-agent test env, avoiding O(n_tests)COMMENT
MEDIUMexamples/multiagent/mappo_vmas.py148 # multi-agent value estimator broadcasts the latter across agents.COMMENT
MEDIUMtorchrl/envs/utils.py641 # "multi-agent-emergence-environments": None,COMMENT
MEDIUMtorchrl/envs/utils.py642 # OpenAI, https://github.com/openai/multi-agent-emergence-environmentsCOMMENT
MEDIUMtorchrl/envs/libs/meltingpot.py312 # Create multi-agent specsCOMMENT
MEDIUMtorchrl/envs/libs/vmas.py429 # Create multi-agent specsCOMMENT
MEDIUMtorchrl/envs/libs/mujoco_playground.py220# Predefined multi-agent partitionings for common MuJoCo locomotion tasks.COMMENT
MEDIUMtorchrl/envs/model_based/world_model_env.py229 # done structure (e.g. multi-agent dones) consistent with the spec.COMMENT
MEDIUMtorchrl/data/postprocs/postprocs.py45 # Note: rewards could have a different shape than done (e.g. multi-agent with a singleCOMMENT
MEDIUM…orials/sphinx-tutorials/multiagent_competitive_ddpg.py936# - How to create a competitive multi-group multi-agent environment in TorchRL, how its specs work, and how it integrateCOMMENT
MEDIUM…orials/sphinx-tutorials/multiagent_competitive_ddpg.py937# - How to create multi-agent network architectures in TorchRL for multiple groups;COMMENT
MEDIUM…orials/sphinx-tutorials/multiagent_competitive_ddpg.py938# - How we can use :class:`tensordict.TensorDict` to carry multi-agent multi-group data;COMMENT
MEDIUM…orials/sphinx-tutorials/multiagent_competitive_ddpg.py939# - How we can tie all the library components (collectors, modules, replay buffers, and losses) in a multi-agent multi-gCOMMENT
MEDIUM…orials/sphinx-tutorials/multiagent_competitive_ddpg.py941# Now that you are proficient with multi-agent DDPG, you can check out all the TorchRL multi-agent implementations in thCOMMENT
MEDIUM…orials/sphinx-tutorials/multiagent_competitive_ddpg.py63# This approach has been extended to multi-agent learning in `Multi-Agent Actor-Critic for Mixed Cooperative-CompetitiveCOMMENT
MEDIUM…orials/sphinx-tutorials/multiagent_competitive_ddpg.py65# In multi-agent settings, things are a bit different. We now have multiple policies :math:`\mathbf{\pi}`,COMMENT
MEDIUM…orials/sphinx-tutorials/multiagent_competitive_ddpg.py88# 2. Subsequently, we will construct a multi-agent environment, utilizing TorchRL'sCOMMENT
MEDIUM…orials/sphinx-tutorials/multiagent_competitive_ddpg.py196# TorchRL API allows integrating various types of multi-agent environment flavors.COMMENT
MEDIUM…orials/sphinx-tutorials/multiagent_competitive_ddpg.py311# (``"done", "terminated", "truncated"``), which do not have a leading multi-agent dimension.COMMENT
MEDIUM…orials/sphinx-tutorials/multiagent_competitive_ddpg.py333# We stress that, in multi-agent contexts, it is paramount to provide explicitly the keys to modify.COMMENT
MEDIUM…orials/sphinx-tutorials/multiagent_competitive_ddpg.py612# **From this point on, the multi-agent-specific components have been instantiated, and we will simply use the sameCOMMENT
MEDIUM…orials/sphinx-tutorials/multiagent_competitive_ddpg.py677 ), # We will store up to memory_size multi-agent transitionsCODE
MEDIUMtutorials/sphinx-tutorials/getting-started-0.py180# multiple copies across various processes, a multi-agent environment, or evenCOMMENT
MEDIUMtutorials/sphinx-tutorials/getting-started-0.py243# :ref:`multi-agent environment API <MARL-environment-API>`COMMENT
MEDIUMtutorials/sphinx-tutorials/getting-started-4.py20# The final chapter of this series before we orchestrate everything in aCOMMENT
MEDIUMtutorials/sphinx-tutorials/multiagent_ppo.py190# TorchRL API allows integrating various types of multi-agent environment flavors.COMMENT
MEDIUMtutorials/sphinx-tutorials/multiagent_ppo.py192# For more information on how the multi-agent environments API works in TorchRL, you can check out the dedicatedCOMMENT
MEDIUMtutorials/sphinx-tutorials/multiagent_ppo.py205# The multi-agent task we will solve today is *Navigation* (see animated figure above).COMMENT
MEDIUMtutorials/sphinx-tutorials/multiagent_ppo.py525# **From this point on, the multi-agent-specific components have been instantiated, and we will simply use the sameCOMMENT
MEDIUMtutorials/sphinx-tutorials/multiagent_ppo.py780# - How to create a multi-agent environment in TorchRL, how its specs work, and how it integrates with the library;COMMENT
MEDIUMtutorials/sphinx-tutorials/multiagent_ppo.py782# - How to create different multi-agent network architectures in TorchRL (e.g., using parameter sharing, centralised criCOMMENT
MEDIUMtutorials/sphinx-tutorials/multiagent_ppo.py783# - How we can use :class:`tensordict.TensorDict` to carry multi-agent data;COMMENT
MEDIUMtutorials/sphinx-tutorials/multiagent_ppo.py784# - How we can tie all the library components (collectors, modules, replay buffers, and losses) in a multi-agent MAPPO/ICOMMENT
MEDIUMtutorials/sphinx-tutorials/multiagent_ppo.py786# Now that you are proficient with multi-agent DDPG, you can check out all the TorchRL multi-agent implementations in thCOMMENT
MEDIUMtutorials/sphinx-tutorials/multiagent_ppo.py791# You can also check out our other multi-agent tutorial on how to train competitiveCOMMENT
MEDIUMtutorials/sphinx-tutorials/multiagent_ppo.py794# If you are interested in creating or wrapping your own multi-agent environments in TorchRL,COMMENT
MEDIUMtutorials/sphinx-tutorials/multiagent_ppo.py76# In multi-agent settings, things are a bit different. We now have multiple policies :math:`\mathbf{\pi}`,COMMENT
MEDIUMtutorials/sphinx-tutorials/multiagent_ppo.py98# 2. Next, we will create a vectorized multi-agent environment, using TorchRL'sCOMMENT
MEDIUMtutorials/sphinx-tutorials/multiagent_ppo.py301# We stress that, in multi-agent contexts, it is paramount to provide explicitly the keys to modify.COMMENT
MEDIUMtutorials/sphinx-tutorials/getting-started-2.py47# module orchestrates the various components of your algorithm andCOMMENT
MEDIUMtutorials/sphinx-tutorials/pendulum.py289# it (for example, in multi-agent settings we may want to indicate which agents needCOMMENT
MEDIUMtutorials/sphinx-tutorials/coding_dqn.py169# the training script. The trainer is there to orchestrate everything for you!COMMENT
Redundant / Tautological Comments83 hits · 120 pts
SeverityFileLineSnippetContext
LOWbuild_nightly.sh4# Check if we're in a nightly buildCOMMENT
LOWpackaging/verify_nightly_version.py15# Check if __version__ attribute existsCOMMENT
LOWpackaging/verify_nightly_version.py53 # Check if it's the nightly version by looking at the versionCOMMENT
LOWpackaging/verify_nightly_version.py57 # Check if it's a nightly version (either date format or contains 'd' followed by date)COMMENT
LOWpackaging/verify_nightly_version.py68 # Check if it's a stable version that should not be used in nightly buildsCOMMENT
LOWtest/test_collectors.py5270 # Check if there was an exception even with exitcode 0COMMENT
LOWtest/test_mcts.py451 ): # Check if action_prob_key was also populatedCODE
LOWtest/llm/test_conversions.py109 # Check if it's a nested tensor by checking if it has the _values attributeCOMMENT
LOWtest/llm/test_conversions.py126 # Check if it's a nested tensorCOMMENT
LOWtest/llm/test_conversions.py144 # Check if they're nested tensorsCOMMENT
LOWtest/llm/conftest.py78 # Check if test already has a timeout markerCOMMENT
LOWtest/llm/test_llm_envs.py100 # Set list to stack for tensordictCOMMENT
LOWtest/objectives/test_loss_module.py1529 # Assign float to entropy_coeffCOMMENT
LOWtest/transforms/test_module_transforms.py150 # Check if ray is initializedCOMMENT
LOWsota-implementations/vla_grpo/openvla_oft/constants.py90# Assign constants to global variablesCOMMENT
LOWsota-implementations/dreamer/dreamer.py462 # Check if profiling is complete and we should exitCOMMENT
LOWsota-implementations/dreamer/dreamer_utils.py233 # Check if we should stop profilingCOMMENT
LOWsota-implementations/grpo/grpo-async.py272 # Check if num_devices is setCOMMENT
LOWsota-implementations/grpo/grpo-sync.py251 # Check if num_devices is setCOMMENT
LOW…lementations/expert-iteration/expert-iteration-sync.py407 # Check if num_devices is setCOMMENT
LOW…ementations/expert-iteration/expert-iteration-async.py408 # Check if num_devices is setCOMMENT
LOWsota-check/submitit-release-check.sh19# Check if the script is called with --help or without any argumentsCOMMENT
LOWexamples/agents/recurrent_actor.py126# Print result:COMMENT
LOW.github/unittest/linux_libs/scripts_isaaclab/isaac.sh42# Check if isaaclab.sh existsCOMMENT
LOW.github/workflows/auto-tag.yml100 # Check if title starts with [...]COMMENT
LOW.github/workflows/release.yml151 # Check if it's on a release branch matching the versionCOMMENT
LOW.github/workflows/release.yml437 # Check if the version folder existsCOMMENT
LOW.github/workflows/release.yml480 # Check if changes were madeCOMMENT
LOW.github/workflows/release.yml546 # Check if release already existsCOMMENT
LOW.github/workflows/nightly_status_collector.yml151 # Check if success rate dropped below 70% in last 7 daysCOMMENT
LOW.github/scripts/td_script.sh16# Check if ARCH is set to aarch64COMMENT
LOWtorchrl/_utils.py57 # Check if user has explicitly set a global start methodCOMMENT
LOWtorchrl/weight_update/_rpc.py256 # Check if all futures are completeCOMMENT
LOWtorchrl/weight_update/_shared.py211 # Check if per-worker weights dict is providedCOMMENT
LOWtorchrl/weight_update/_shared.py581 # Check if policy factories are uniform or distinctCOMMENT
LOWtorchrl/weight_update/_shared.py936 # Check if per-worker weights dict is providedCOMMENT
LOWtorchrl/weight_update/_shared.py1108 # Check if already shutdownCOMMENT
LOWtorchrl/weight_update/_distributed.py478 # Check if we have weights to sendCOMMENT
LOWtorchrl/weight_update/_distributed.py549 # Check if already shutdownCOMMENT
LOWtorchrl/weight_update/_distributed.py716 # Check if all futures are completeSTRING
LOWtorchrl/weight_update/llm/vllm_double_buffer.py326 # Check if this is an AsyncVLLM instance (uses RPC to coordinate workers)COMMENT
LOWtorchrl/collectors/_multi_base.py1232 # Check if any worker has diedCOMMENT
LOWtorchrl/collectors/_multi_base.py1524 # Check if it's an error dict from workerCOMMENT
LOWtorchrl/collectors/_single.py1089 # Check if policy has meta-device parameters (sent from weight sync schemes)COMMENT
LOWtorchrl/collectors/_single.py1226 # Check if we need to cast to env deviceCOMMENT
LOWtorchrl/collectors/_single.py1430 # Check if policy has meta-device parameters (not yet initialized)COMMENT
LOWtorchrl/collectors/llm/weight_update/vllm.py311 # Check if it's a LoRA modelCOMMENT
LOWtorchrl/collectors/llm/weight_update/vllm.py339 # Check if the model has a LoRA adapterCOMMENT
LOWtorchrl/collectors/llm/weight_update/vllm_v2.py119 # Check if it's a LoRA modelCOMMENT
LOWtorchrl/collectors/llm/weight_update/vllm_v2.py126 # Check if it's a LoRA modelCOMMENT
LOWtorchrl/collectors/llm/weight_update/vllm_v2.py290 # Check if it's a LoRA modelCOMMENT
LOWtorchrl/collectors/llm/weight_update/vllm_v2.py297 # Check if it's a LoRA modelCOMMENT
LOWtorchrl/trainers/trainers.py1861 # Check if we've reached the target framesCOMMENT
LOWtorchrl/trainers/trainers.py1953 # Check if enough frames have passed since last logging for this keyCOMMENT
LOWtorchrl/modules/llm/backends/vllm/vllm_async.py254 # Check if it's a list of lists or a single listCOMMENT
LOWtorchrl/modules/llm/backends/vllm/vllm_async.py832 # Check if this is actually a single prompt represented as token IDsCOMMENT
LOWtorchrl/modules/llm/backends/vllm/vllm_async.py966 # Check if this is a batch requestCOMMENT
LOWtorchrl/modules/llm/backends/vllm/vllm_async.py1797 # Check if preferred actor is overloadedCOMMENT
LOWtorchrl/modules/llm/backends/vllm/vllm_async.py2050 # Set tensor_parallel_size to num_devices if not setCOMMENT
LOWtorchrl/modules/llm/backends/sglang/sglang_utils.py87 # Check if subprocess diedCOMMENT
23 more matches not shown…
Structural Annotation Overuse60 hits · 108 pts
SeverityFileLineSnippetContext
LOWtest/llm/test_wrapper.py2389 # Step 1: Generate the canonical response tokens with vLLM.COMMENT
LOWtest/llm/test_wrapper.py2395 # Step 2: Extract generated tokens and create new input for log-probs computationCOMMENT
LOWtest/llm/test_wrapper.py2438 # Step 3: Create log-probs only wrappersCOMMENT
LOWtest/llm/test_wrapper.py2457 # Step 4: Compute log-probs for the full sequence (original + generated)COMMENT
LOWbenchmarks/test_storage_write_benchmark.py142 # Step 1: Stack to contiguous (this allocates new memory)COMMENT
LOWbenchmarks/test_storage_write_benchmark.py144 # Step 2: Write to storageCOMMENT
LOWbenchmarks/test_storage_write_benchmark.py176 # Step 1: Create lazy stack (no allocation, just wrapping)COMMENT
LOWbenchmarks/test_storage_write_benchmark.py178 # Step 2: Write to storage (storage handles the lazy stack)COMMENT
LOW.github/RELEASE_AGENT_PROMPT.md60## Step 1: Analyze Commits for Release NotesCOMMENT
LOW.github/RELEASE_AGENT_PROMPT.md167## Step 2: Draft Release NotesCOMMENT
LOW.github/RELEASE_AGENT_PROMPT.md231## Step 3: Update Version FilesCOMMENT
LOW.github/RELEASE_AGENT_PROMPT.md270## Step 4: Commit Version Changes on the main branch (Major releases only)COMMENT
LOW.github/RELEASE_AGENT_PROMPT.md284## Step 5: Create Release BranchCOMMENT
LOW.github/RELEASE_AGENT_PROMPT.md298## Step 6: Commit Version Changes (Minor releases only)COMMENT
LOW.github/RELEASE_AGENT_PROMPT.md309## Step 7: Create and Push TagCOMMENT
LOW.github/RELEASE_AGENT_PROMPT.md322## Step 8: Trigger Release WorkflowCOMMENT
LOW.github/RELEASE_AGENT_PROMPT.md337## Step 9: Create Draft GitHub ReleaseCOMMENT
LOW.github/RELEASE_AGENT_PROMPT.md350## Step 10: Monitor WorkflowCOMMENT
LOWtorchrl/weight_update/_rpc.py181 # Step 1: Signal the remote collector via RPC to start receiving (async)COMMENT
LOWtorchrl/weight_update/_rpc.py185 # Step 2: Send weights via torch.distributed (blocks until receiver calls recv())COMMENT
LOWtorchrl/weight_update/_rpc.py188 # Step 3: Wait for RPC to complete (receiver has applied weights)COMMENT
LOWtorchrl/weight_update/_rpc.py207 # Step 1: Signal the remote collector via RPC to start receiving (async)COMMENT
LOWtorchrl/weight_update/_rpc.py213 # Step 2: Send weights asynchronously via torch.distributedCOMMENT
LOWtorchrl/weight_update/_ray.py206 # Step 1: Signal the remote actor via Ray to start receiving (async)COMMENT
LOWtorchrl/weight_update/_ray.py214 # Step 2: Send weights via torch.distributed (async)COMMENT
LOWtorchrl/weight_update/_ray.py218 # Step 3: Wait for the Ray call to complete (receiver has applied weights)COMMENT
LOWtorchrl/weight_update/_ray.py232 # Step 1: Signal the actor via Ray to start receiving (async)COMMENT
LOWtorchrl/weight_update/_ray.py242 # Step 2: Send weights via torch.distributed (async)COMMENT
LOWtorchrl/weight_update/llm/sglang_nccl.py604 # Step 1: Send a single HTTP request with all weight metadata.COMMENT
LOWtorchrl/weight_update/llm/sglang_nccl.py614 # Step 2: Broadcast each weight tensor via NCCL in the same order.COMMENT
LOWtorchrl/weight_update/llm/sglang_nccl.py623 # Step 3: Wait for the HTTP response confirming server received all weightsCOMMENT
LOWtorchrl/modules/llm/backends/vllm/vllm_async.py1190 # Step 1: Start trainer NCCL group in a background thread — it blocksCOMMENT
LOWtorchrl/modules/llm/backends/vllm/vllm_async.py1204 # Step 2: Dispatch init_weight_transfer_engine to all vLLM actorsCOMMENT
LOWtorchrl/modules/llm/backends/vllm/vllm_async.py1220 # Step 3: Wait for both sides to completeCOMMENT
LOWtorchrl/modules/llm/backends/vllm/vllm_async.py1293 # Step 1: Tell all actors to start receiving weightsCOMMENT
LOWtorchrl/modules/llm/backends/vllm/vllm_async.py1298 # Step 2: Send weights from trainer sideCOMMENT
LOWtorchrl/modules/llm/backends/vllm/vllm_async.py1317 # Step 3: Wait for all actors to finish receivingCOMMENT
LOWtorchrl/modules/llm/backends/sglang/sglang_server.py707 # Step 1: Signal server to expect this weightCOMMENT
LOWtorchrl/modules/llm/backends/sglang/sglang_server.py712 # Step 2: Broadcast the weight via NCCLCOMMENT
LOWtutorials/sphinx-tutorials/llm_browser.py81# Step 1: Basic Environment ConfigurationCOMMENT
LOWtutorials/sphinx-tutorials/llm_browser.py189# Step 2: Tool Execution HelperCOMMENT
LOWtutorials/sphinx-tutorials/llm_browser.py262# Step 3: Starting the InteractionCOMMENT
LOWtutorials/sphinx-tutorials/llm_browser.py292# Step 4: Performing the SearchCOMMENT
LOWtutorials/sphinx-tutorials/llm_browser.py321# Step 5: Providing the AnswerCOMMENT
LOWtutorials/sphinx-tutorials/trl_interop.py50# Step 1: build and populate a replay bufferCOMMENT
LOWtutorials/sphinx-tutorials/trl_interop.py77# Step 2: wrap the buffer as an IterableDatasetCOMMENT
LOWtutorials/sphinx-tutorials/trl_interop.py109# Step 3: key filteringCOMMENT
LOWtutorials/sphinx-tutorials/trl_interop.py124# Step 4: device placementCOMMENT
LOWtutorials/sphinx-tutorials/trl_interop.py137# Step 5: nested keysCOMMENT
LOWtutorials/sphinx-tutorials/trl_interop.py181# Step 1: define a stand-in reward modelCOMMENT
LOWtutorials/sphinx-tutorials/trl_interop.py216# Step 2: wrap with default TorchRL token keysCOMMENT
LOWtutorials/sphinx-tutorials/trl_interop.py234# Step 3: run a batch through the wrapperCOMMENT
LOWtutorials/sphinx-tutorials/trl_interop.py256# Step 4: custom keys and nested reward keyCOMMENT
LOWknowledge_base/FLAKY_TESTS.md42## Step 1: Gather Flaky Test InformationCOMMENT
LOWknowledge_base/FLAKY_TESTS.md96## Step 2: Identify Non-Deterministic Failure CausesCOMMENT
LOWknowledge_base/FLAKY_TESTS.md131## Step 3: Implement the FixCOMMENT
LOWknowledge_base/FLAKY_TESTS.md184## Step 4: Create a PR with the Fix AND Test ValidationCOMMENT
LOWknowledge_base/FLAKY_TESTS.md274## Step 5: Monitor the CI RunCOMMENT
LOWknowledge_base/FLAKY_TESTS.md302## Step 6: Verify the FixCOMMENT
LOWknowledge_base/FLAKY_TESTS.md328## Step 7: Cleanup Before MergingCOMMENT
AI Slop Vocabulary44 hits · 101 pts
SeverityFileLineSnippetContext
LOWtest/llm/test_llm_collectors.py547 # We have the tokens, let's just use themCOMMENT
LOWsota-implementations/expert-iteration/ei_utils.py88 # we can just use 0 here.COMMENT
LOW…lementations/expert-iteration/expert-iteration-sync.py433 # we can just set a big number, the buffer will be emptied anywayCOMMENT
MEDIUMexamples/agents/recurrent_actor.py182# its recurrent connections to maintain state across time steps. This mode may utilize CuDNN to accelerate the processinCOMMENT
MEDIUM.github/scripts/compare_pr_benchmarks.py45 """Return a rate based on the robust per-round duration statistic."""STRING
LOWtorchrl/weight_update/_shared.py909 # If no shared transport, just return the fresh weightsCOMMENT
MEDIUMtorchrl/collectors/_single.py1790 # this way of checking cuda is robust to lazy stacks with mismatching shapesCOMMENT
MEDIUMtorchrl/objectives/common.py492 # To make it robust to device casting, we must register list ofCOMMENT
LOWtorchrl/objectives/llm/grpo.py605 # TODO: eventually, we want to always use `get_dist` and just pass the key of the maskCOMMENT
MEDIUMtorchrl/objectives/llm/grpo.py1512 # Cat is the most robust way to combine the trajsCOMMENT
MEDIUMtorchrl/trainers/algorithms/on_policy.py318 # Set up comprehensive logging for on-policy trainingCOMMENT
MEDIUMtorchrl/trainers/algorithms/sac.py258 # Set up comprehensive logging for SAC trainingCOMMENT
LOWtorchrl/modules/llm/policies/common.py747 # For log-prob distributions, we just return the pre-computed log-probsCOMMENT
MEDIUMtorchrl/modules/llm/policies/transformers_wrapper.py1042 # We are going to map this tokens_in to a tensordict to facilitate the padding in case we need itCOMMENT
MEDIUMtorchrl/modules/llm/policies/transformers_wrapper.py1465 # We are going to map this tokens_in to a tensordict to facilitate the padding in case we need itCOMMENT
LOWtorchrl/modules/mcts/scores.py425 # Don't update weights for zero probability - just returnCOMMENT
LOWtorchrl/envs/utils.py1489 # case we just return the dataCOMMENT
MEDIUMtorchrl/envs/utils.py200 """Represents the keys as a tree to facilitate iteration."""STRING
LOWtorchrl/envs/libs/dm_control.py318 # just use a common EGL_DEVICE_ID environment variable for all processes.COMMENT
MEDIUMtorchrl/envs/transforms/_normalization.py711 # to facilitate the computation of the stats using TD internals.COMMENT
MEDIUMtorchrl/envs/transforms/_misc.py75 """Calls pin_memory on the tensordict to facilitate writing on CUDA devices."""STRING
MEDIUMtorchrl/data/llm/topk.py122 # Cat is the most robust way to combine the trajsCOMMENT
MEDIUMtorchrl/data/replay_buffers/utils.py1200 # We currently ignore out in this call but we should leverage thatCOMMENT
LOWtorchrl/data/replay_buffers/utils.py1379 # if Tensor, we just create a MemoryMappedTensor of the desired shape, device and dtypeCOMMENT
LOWtorchrl/data/replay_buffers/utils.py1396 # if Tensor, we just create a MemoryMappedTensor of the desired shape, device and dtypeCOMMENT
LOWtorchrl/data/replay_buffers/storages/tensor.py1097 # if Tensor, we just create a MemoryMappedTensor of the desired shape, device and dtypeCOMMENT
MEDIUMtutorials/sphinx-tutorials/dqn_with_rnn.py222# values for these attributes to facilitate its construction.COMMENT
MEDIUMtutorials/sphinx-tutorials/torchrl_envs.py652# One can therefore think carefully about the transform design to leverage theCOMMENT
LOWtutorials/sphinx-tutorials/torchrl_envs.py341# To compose transforms, simply use the ``Compose`` class:COMMENT
MEDIUMtutorials/sphinx-tutorials/getting-started-1.py26# Accommodating all these scenarios can be quite intricate. In this succinctCOMMENT
MEDIUMtutorials/sphinx-tutorials/getting-started-1.py27# tutorial, we will delve into the core functionality of TorchRL in terms ofCOMMENT
MEDIUM…orials/sphinx-tutorials/multiagent_competitive_ddpg.py337# Essentially we just say that theCOMMENT
LOW…orials/sphinx-tutorials/multiagent_competitive_ddpg.py612# **From this point on, the multi-agent-specific components have been instantiated, and we will simply use the sameCOMMENT
MEDIUMtutorials/sphinx-tutorials/getting-started-0.py79# Essentially, :class:`~tensordict.TensorDict` is a generic key-based dataCOMMENT
MEDIUMtutorials/sphinx-tutorials/getting-started-3.py144# Data collectors are very useful when it comes to coding state-of-the-artCOMMENT
MEDIUMtutorials/sphinx-tutorials/multiagent_ppo.py200# This allows leveraging the Single Instruction Multiple Data (SIMD) paradigm of GPUs and significantlyCOMMENT
MEDIUMtutorials/sphinx-tutorials/multiagent_ppo.py224# We will also use ``num_vmas_envs`` vectorized environments, to leverage batch simulation.COMMENT
LOWtutorials/sphinx-tutorials/multiagent_ppo.py525# **From this point on, the multi-agent-specific components have been instantiated, and we will simply use the sameCOMMENT
LOWtutorials/sphinx-tutorials/rb_tutorial.py387# To enable multithreaded sampling, just pass a positive integer to theCOMMENT
MEDIUMtutorials/sphinx-tutorials/coding_ddpg.py574# To leverage the vectorization capabilities of PyTorch, we adoptCOMMENT
LOWtutorials/sphinx-tutorials/coding_ddpg.py181# accessible but this will just return a **detached** version of theCOMMENT
LOWtutorials/sphinx-tutorials/coding_ddpg.py427# are collected by :func:`env.step()`, simply pass the ``from_pixels=True``COMMENT
MEDIUMtutorials/sphinx-tutorials/pendulum.py167# To facilitate the reading and writing from that ``tensordict`` and to make sureCOMMENT
MEDIUMtutorials/sphinx-tutorials/coding_dqn.py67# past, we can still pass it in conjunction with the various actions availableCOMMENT
Fake / Example Data73 hits · 88 pts
SeverityFileLineSnippetContext
LOWREADME.md217processes, weight updaters, evaluator loops, profiling hooks, and fake-dataCODE
LOWtest/llm/test_llm_objectives.py43 "Lorem ipsum dolor sit amet,",CODE
LOWtest/llm/test_llm_objectives.py43 "Lorem ipsum dolor sit amet,",CODE
LOWtest/objectives/test_dreamer.py421 loss_td, fake_data = loss_module(tensordict.reshape(-1))CODE
LOWtest/objectives/test_dreamer.py422 assert not fake_data.requires_gradCODE
LOWtest/objectives/test_dreamer.py423 assert fake_data.shape == torch.Size([tensordict.numel(), imagination_horizon])CODE
LOWtest/objectives/test_dreamer.py450 loss_td, fake_data = loss_module(tensordict)CODE
LOWtest/objectives/test_dreamer.py452 assert not fake_data.requires_gradCODE
LOWtest/objectives/test_dreamer_v3.py677 loss_td, fake_data = loss_module(CODE
LOWtest/objectives/test_dreamer_v3.py683 fake_data["discount_weight"][0, :, 0], expected_weightCODE
LOWtest/objectives/test_dreamer_v3.py686 fake_data["next", "continuation"],CODE
LOWtest/objectives/test_dreamer_v3.py687 torch.full_like(fake_data["next", "continuation"], 0.5),CODE
LOWtest/objectives/test_dreamer_v3.py689 assert not fake_data["discount_weight"].requires_gradCODE
LOWtest/objectives/test_dreamer_v3.py695 actor_inputs = fake_data.select(*actor_model.in_keys, strict=False).detach()CODE
LOWtest/objectives/test_dreamer_v3.py697 log_prob = distribution.log_prob(fake_data["action"].detach())CODE
LOWtest/objectives/test_dreamer_v3.py698 log_prob = _match_trailing_dim(log_prob, fake_data["lambda_target"])CODE
LOWtest/objectives/test_dreamer_v3.py699 baseline_td = fake_data.select(*value_model.in_keys, strict=False)CODE
LOWtest/objectives/test_dreamer_v3.py701 advantage = (fake_data["lambda_target"] - baseline_td["state_value"]).detach()CODE
LOWtest/objectives/test_dreamer_v3.py702 expected_loss = -(fake_data["discount_weight"] * log_prob * advantage).mean()CODE
LOWtest/objectives/test_dreamer_v3.py712 value_loss(fake_data.detach())CODE
LOWtest/objectives/test_dreamer_v3.py1481 loss_td, fake_data = loss_module(CODE
LOWtest/objectives/test_dreamer_v3.py1484 baseline_td = fake_data.select(*value_model.in_keys, strict=False)CODE
LOWtest/objectives/test_dreamer_v3.py1486 advantage = (fake_data["lambda_target"] - baseline_td["state_value"]).detach()CODE
LOWtest/objectives/test_dreamer_v3.py1488 fake_data["action_log_prob"], fake_data["lambda_target"]CODE
LOWtest/objectives/test_dreamer_v3.py1498 compiled_scale(fake_data["lambda_target"]),CODE
LOWtest/objectives/test_dreamer_v3.py633 loss_td, fake_data = loss_module(tensordict.reshape(-1))CODE
LOWtest/objectives/test_dreamer_v3.py851 loss_td, fake_data = actor_loss(CODE
LOWtest/objectives/test_dreamer_v3.py855 assert fake_data["lambda_target"].shape[-1] == 1CODE
LOWtest/objectives/test_dreamer_v3.py1521 loss_td, fake_data = loss_module(CODE
LOWtest/objectives/test_dreamer_v3.py1524 expected = -(fake_data["lambda_target"] / 10.0).mean()CODE
LOWtest/objectives/test_dreamer_v3.py1543 loss_td, fake_data = loss_module(CODE
LOWtest/objectives/test_dreamer_v3.py1547 fake_data["lambda_target"].detach(),CODE
LOWtest/objectives/test_dreamer_v3.py1568 loss_td, fake_data = loss_module(CODE
LOWtest/objectives/test_dreamer_v3.py1572 fake_data["lambda_target"].detach(),CODE
LOWtest/transforms/test_module_transforms.py210 dummy_data = TensorDict(observation=torch.zeros(2, 3), batch_size=[2])CODE
LOWtest/transforms/test_module_transforms.py213 assert (module(dummy_data)["action"] == 2).all()CODE
LOWtest/transforms/test_module_transforms.py221 assert (module(dummy_data)["action"] == 1).all()CODE
LOWsota-implementations/dreamer_v3/train.py542 actor_loss_td, fake_data = actor_loss(actor_input)CODE
LOWsota-implementations/dreamer_v3/train.py543 value_loss_td, _ = value_loss(fake_data.detach())CODE
LOWsota-implementations/dreamer_v3/train.py549 "bootstrap": fake_data.get("lambda_target")[..., 0, 0].reshape(CODE
LOWbenchmarks/test_llm.py64 "Lorem ipsum dolor sit amet",CODE
LOWbenchmarks/test_llm.py64 "Lorem ipsum dolor sit amet",CODE
LOWbenchmarks/test_llm.py72 "Lorem ipsum dolor sit amet",CODE
LOWbenchmarks/test_llm.py72 "Lorem ipsum dolor sit amet",CODE
LOWtorchrl/objectives/dreamer.py299 fake_data = self.model_based_env.rollout(CODE
LOWtorchrl/objectives/dreamer.py305 next_tensordict = step_mdp(fake_data, keep_other=True)CODE
LOWtorchrl/objectives/dreamer.py309 reward = fake_data.get(("next", self.tensor_keys.reward))CODE
LOWtorchrl/objectives/dreamer.py312 fake_data.set("lambda_target", lambda_target)CODE
LOWtorchrl/objectives/dreamer.py325 return loss_tensordict, fake_data.dataCODE
LOWtorchrl/objectives/dreamer.py427 def forward(self, fake_data) -> torch.Tensor:CODE
LOWtorchrl/objectives/dreamer.py428 lambda_target = fake_data.get("lambda_target")CODE
LOWtorchrl/objectives/dreamer.py430 tensordict_select = fake_data.select(*self.value_model.in_keys, strict=False)CODE
LOWtorchrl/objectives/dreamer.py463 self._clear_weakrefs(fake_data, loss_tensordict)CODE
LOWtorchrl/objectives/dreamer.py465 return loss_tensordict, fake_dataCODE
LOWtorchrl/objectives/dreamer_v3.py755 fake_data = self.model_based_env.rollout(CODE
LOWtorchrl/objectives/dreamer_v3.py761 next_tensordict = step_mdp(fake_data, keep_other=True)CODE
LOWtorchrl/objectives/dreamer_v3.py766 reward = fake_data.get(("next", self.tensor_keys.reward))CODE
LOWtorchrl/objectives/dreamer_v3.py772 first_td = fake_data[..., :1].select(CODE
LOWtorchrl/objectives/dreamer_v3.py789 fake_data.set(self.tensor_keys.continuation, root_continuation)CODE
LOWtorchrl/objectives/dreamer_v3.py790 fake_data.set(("next", self.tensor_keys.continuation), continuation)CODE
13 more matches not shown…
Verbosity Indicators44 hits · 85 pts
SeverityFileLineSnippetContext
LOWtest/llm/test_wrapper.py2389 # Step 1: Generate the canonical response tokens with vLLM.COMMENT
LOWtest/llm/test_wrapper.py2395 # Step 2: Extract generated tokens and create new input for log-probs computationCOMMENT
LOWtest/llm/test_wrapper.py2438 # Step 3: Create log-probs only wrappersCOMMENT
LOWtest/llm/test_wrapper.py2457 # Step 4: Compute log-probs for the full sequence (original + generated)COMMENT
LOWbenchmarks/test_storage_write_benchmark.py142 # Step 1: Stack to contiguous (this allocates new memory)COMMENT
LOWbenchmarks/test_storage_write_benchmark.py144 # Step 2: Write to storageCOMMENT
LOWbenchmarks/test_storage_write_benchmark.py176 # Step 1: Create lazy stack (no allocation, just wrapping)COMMENT
LOWbenchmarks/test_storage_write_benchmark.py178 # Step 2: Write to storage (storage handles the lazy stack)COMMENT
LOWtorchrl/weight_update/_rpc.py181 # Step 1: Signal the remote collector via RPC to start receiving (async)COMMENT
LOWtorchrl/weight_update/_rpc.py185 # Step 2: Send weights via torch.distributed (blocks until receiver calls recv())COMMENT
LOWtorchrl/weight_update/_rpc.py188 # Step 3: Wait for RPC to complete (receiver has applied weights)COMMENT
LOWtorchrl/weight_update/_rpc.py207 # Step 1: Signal the remote collector via RPC to start receiving (async)COMMENT
LOWtorchrl/weight_update/_rpc.py213 # Step 2: Send weights asynchronously via torch.distributedCOMMENT
LOWtorchrl/weight_update/_ray.py206 # Step 1: Signal the remote actor via Ray to start receiving (async)COMMENT
LOWtorchrl/weight_update/_ray.py214 # Step 2: Send weights via torch.distributed (async)COMMENT
LOWtorchrl/weight_update/_ray.py218 # Step 3: Wait for the Ray call to complete (receiver has applied weights)COMMENT
LOWtorchrl/weight_update/_ray.py232 # Step 1: Signal the actor via Ray to start receiving (async)COMMENT
LOWtorchrl/weight_update/_ray.py242 # Step 2: Send weights via torch.distributed (async)COMMENT
LOWtorchrl/weight_update/llm/sglang_nccl.py604 # Step 1: Send a single HTTP request with all weight metadata.COMMENT
LOWtorchrl/weight_update/llm/sglang_nccl.py614 # Step 2: Broadcast each weight tensor via NCCL in the same order.COMMENT
LOWtorchrl/weight_update/llm/sglang_nccl.py623 # Step 3: Wait for the HTTP response confirming server received all weightsCOMMENT
LOWtorchrl/modules/llm/backends/vllm/vllm_async.py1190 # Step 1: Start trainer NCCL group in a background thread — it blocksCOMMENT
LOWtorchrl/modules/llm/backends/vllm/vllm_async.py1204 # Step 2: Dispatch init_weight_transfer_engine to all vLLM actorsCOMMENT
LOWtorchrl/modules/llm/backends/vllm/vllm_async.py1220 # Step 3: Wait for both sides to completeCOMMENT
LOWtorchrl/modules/llm/backends/vllm/vllm_async.py1293 # Step 1: Tell all actors to start receiving weightsCOMMENT
LOWtorchrl/modules/llm/backends/vllm/vllm_async.py1298 # Step 2: Send weights from trainer sideCOMMENT
LOWtorchrl/modules/llm/backends/vllm/vllm_async.py1317 # Step 3: Wait for all actors to finish receivingCOMMENT
LOWtorchrl/modules/llm/backends/sglang/sglang_server.py707 # Step 1: Signal server to expect this weightCOMMENT
LOWtorchrl/modules/llm/backends/sglang/sglang_server.py712 # Step 2: Broadcast the weight via NCCLCOMMENT
LOWtorchrl/modules/distributions/discrete.py844 # For token-level masking, we need to check if specific tokens are maskedCOMMENT
LOWtutorials/sphinx-tutorials/llm_browser.py81# Step 1: Basic Environment ConfigurationCOMMENT
LOWtutorials/sphinx-tutorials/llm_browser.py189# Step 2: Tool Execution HelperCOMMENT
LOWtutorials/sphinx-tutorials/llm_browser.py262# Step 3: Starting the InteractionCOMMENT
LOWtutorials/sphinx-tutorials/llm_browser.py292# Step 4: Performing the SearchCOMMENT
LOWtutorials/sphinx-tutorials/llm_browser.py321# Step 5: Providing the AnswerCOMMENT
LOWtutorials/sphinx-tutorials/trl_interop.py50# Step 1: build and populate a replay bufferCOMMENT
LOWtutorials/sphinx-tutorials/trl_interop.py77# Step 2: wrap the buffer as an IterableDatasetCOMMENT
LOWtutorials/sphinx-tutorials/trl_interop.py109# Step 3: key filteringCOMMENT
LOWtutorials/sphinx-tutorials/trl_interop.py124# Step 4: device placementCOMMENT
LOWtutorials/sphinx-tutorials/trl_interop.py137# Step 5: nested keysCOMMENT
LOWtutorials/sphinx-tutorials/trl_interop.py181# Step 1: define a stand-in reward modelCOMMENT
LOWtutorials/sphinx-tutorials/trl_interop.py216# Step 2: wrap with default TorchRL token keysCOMMENT
LOWtutorials/sphinx-tutorials/trl_interop.py234# Step 3: run a batch through the wrapperCOMMENT
LOWtutorials/sphinx-tutorials/trl_interop.py256# Step 4: custom keys and nested reward keyCOMMENT
Slop Phrases18 hits · 43 pts
SeverityFileLineSnippetContext
LOWtorchrl/envs/transforms/_base.py211 - Don't forget to edits the specs if needed: top level: :meth:`~torchrl.envs.Transform.transform_output_spec`,STRING
MEDIUMtorchrl/data/llm/history.py316 >>> # Now you can use it with auto-detectionCODE
MEDIUMtutorials/sphinx-tutorials/dqn_with_rnn.py259# As mentioned earlier, we have one more optional transform to add to ourCOMMENT
LOWtutorials/sphinx-tutorials/dqn_with_rnn.py61# If you are running this in Google Colab, make sure you install the following dependencies:COMMENT
LOWtutorials/sphinx-tutorials/torchrl_envs.py277# To run this part of the tutorial, make sure you have installed dm_control:COMMENT
MEDIUMtutorials/sphinx-tutorials/getting-started-1.py310# - Have a look at how you can use an RNN within the policy (aCOMMENT
MEDIUM…orials/sphinx-tutorials/multiagent_competitive_ddpg.py948# Finally, you can modify the parameters of this tutorial to try many other configurations and scenariosCOMMENT
MEDIUM…orials/sphinx-tutorials/multiagent_competitive_ddpg.py952# Here are a few videos of some possible scenarios you can try in VMAS.COMMENT
MEDIUM…orials/sphinx-tutorials/multiagent_competitive_ddpg.py663# To store your buffer on the GPU, you can use :class:`~torchrl.data.replay_buffers.LazyTensorStorage`, passing the desiCOMMENT
LOW…orials/sphinx-tutorials/multiagent_competitive_ddpg.py43# If you are running this in Google Colab, make sure you install the following dependencies:COMMENT
MEDIUMtutorials/sphinx-tutorials/getting-started-4.py31# portable CSV logger (:class:`~torchrl.record.loggers.csv.CSVLogger`) that you can useCOMMENT
MEDIUMtutorials/sphinx-tutorials/export.py335# Here's an example of how you can use AOTInductor to export your policy, inspired by theCOMMENT
MEDIUMtutorials/sphinx-tutorials/multiagent_ppo.py798# Finally, you can modify the parameters of this tutorial to try many other configurations and scenariosCOMMENT
MEDIUMtutorials/sphinx-tutorials/multiagent_ppo.py800# Here are a few videos of some possible scenarios you can try in VMAS.COMMENT
LOWtutorials/sphinx-tutorials/multiagent_ppo.py43# If you are running this in Google Colab, make sure you install the following dependencies:COMMENT
LOWtutorials/sphinx-tutorials/coding_ddpg.py283# When computing this value, we must make sure to take the value parameters outCOMMENT
LOWtutorials/sphinx-tutorials/getting-started-2.py111# loss. If you want to make sure you're fully in control of what is happening,COMMENT
LOWtutorials/sphinx-tutorials/coding_ppo.py39# If you are running this in Google Colab, make sure you install the following dependencies:COMMENT
Hallucination Indicators3 hits · 40 pts
SeverityFileLineSnippetContext
CRITICALtest/test_render.py1304 env.base_env.unwrapped.data.qpos.copy(),CODE
CRITICALtest/test_render.py1310 env.base_env.unwrapped.data.qpos.copy(),CODE
CRITICALtorchrl/envs/libs/gym.py800 return gym.envs.registration.registry.env_specs.keys()CODE
Dead Code18 hits · 36 pts
SeverityFileLineSnippetContext
MEDIUMtest/llm/test_data.py889CODE
MEDIUMtest/llm/test_data.py892CODE
MEDIUMtest/objectives/test_bc.py41CODE
MEDIUMtest/objectives/test_bc.py42CODE
MEDIUMtorchrl/envs/common.py1069CODE
MEDIUMtorchrl/envs/transforms/_normalization.py912CODE
MEDIUMtorchrl/envs/transforms/_normalization.py913CODE
MEDIUMtorchrl/envs/transforms/_normalization.py915CODE
MEDIUMtorchrl/envs/transforms/_normalization.py916CODE
MEDIUMtorchrl/envs/transforms/_normalization.py917CODE
MEDIUMtorchrl/envs/transforms/_normalization.py918CODE
MEDIUMtorchrl/envs/transforms/_normalization.py919CODE
MEDIUMtorchrl/envs/transforms/_normalization.py924CODE
MEDIUMtorchrl/envs/transforms/_normalization.py925CODE
MEDIUMtorchrl/envs/transforms/_normalization.py937CODE
MEDIUMtorchrl/envs/transforms/_normalization.py938CODE
MEDIUMtorchrl/envs/transforms/_normalization.py939CODE
MEDIUMtorchrl/envs/transforms/_normalization.py941CODE
AI Response Leakage3 hits · 22 pts
SeverityFileLineSnippetContext
HIGHtutorials/sphinx-tutorials/rb_tutorial.py807# ``("collector", "traj_ids")``. In this example, we construct dataCOMMENT
HIGHtutorials/sphinx-tutorials/pendulum.py304# In this example, we do not pass a done state as this is not mandatoryCOMMENT
HIGHtutorials/sphinx-tutorials/pendulum.py850# In this example, we will train a simple policy using the reward as aCOMMENT
Example Usage Blocks5 hits · 8 pts
SeverityFileLineSnippetContext
LOWdocs/build_local.sh4# Usage:COMMENT
LOW…b/unittest/helpers/assert_torch_tensordict_versions.sh4# Usage:COMMENT
LOW.github/unittest/helpers/assert_torch_version.sh4# Usage:COMMENT
LOW.github/workflows/auto-tag.yml3# Usage:COMMENT
LOW.github/workflows/assign.yml3# Usage:COMMENT
TODO Padding3 hits · 4 pts
SeverityFileLineSnippetContext
LOWtorchrl/envs/llm/libs/mlgym.py228 # TODO: implement add commands method in environmentCOMMENT
LOWtorchrl/data/map/tree.py228 # TODO: implement specsCOMMENT
LOWtorchrl/data/map/tree.py245 # TODO: implement specsCOMMENT
Overly Generic Function Names5 hits · 2 pts
SeverityFileLineSnippetContext
LOWtest/test_docstring_args_checker.py31def helper(first, second):STRING
LOWtest/test_docstring_args_checker.py71def helper(first, second, *, mode="strict", retries=0):STRING
LOWtest/test_docstring_args_checker.py93def helper(first, second, *, mode="strict", retries=0):STRING
LOWtorchrl/_utils.py246 >>> def my_function():STRING
LOWtorchrl/_utils.py1319 ... def my_function():STRING