PyTorch tutorials.
This report summarizes scanner evidence for pytorch/tutorials, a Python project with 9,362 GitHub stars. SynthScan examined 57,254 lines of code across 239 source files, recording 2069 pattern matches distributed across 19 syntactic categories. The legacy adjusted pattern signal is 62.1 (High pattern signal); it is not an authorship estimate.
Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.
Use each vector to guide manual verification of the underlying findings.
Can maintainers explain intent, assumptions, and trade-offs? 1382 finding(s).
Are imports declared and package/API names verified? 64 finding(s).
Are wrappers, guards, and repeated structures necessary? 656 finding(s).
Which changes need focused human review? 2069 finding(s).
This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.
Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.
This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.
The scanner identified 2069 distinct pattern matches across 19 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. 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 configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | recipes_source/foreach_map.py | 23 | # ------------- | COMMENT |
| MEDIUM | recipes_source/regional_compilation.py | 172 | # ----------- | COMMENT |
| MEDIUM⚡ | recipes_source/torch_export_aoti_python.py | 37 | # ------------- | COMMENT |
| MEDIUM⚡ | recipes_source/torch_export_aoti_python.py | 44 | # ---------------------- | COMMENT |
| MEDIUM⚡ | recipes_source/torch_export_aoti_python.py | 52 | # ----------------- | COMMENT |
| MEDIUM | recipes_source/torch_export_aoti_python.py | 167 | # ------------------------- | COMMENT |
| MEDIUM | recipes_source/torch_export_aoti_python.py | 187 | # --------------------------------------------- | COMMENT |
| MEDIUM | recipes_source/torch_export_aoti_python.py | 270 | # ---------- | COMMENT |
| MEDIUM | recipes_source/torch_compiler_set_stance_tutorial.py | 21 | # --------------- | COMMENT |
| MEDIUM | recipes_source/torch_compiler_set_stance_tutorial.py | 27 | # ----------- | COMMENT |
| MEDIUM | recipes_source/torch_compiler_set_stance_tutorial.py | 174 | # =========================== | COMMENT |
| MEDIUM | recipes_source/torch_compiler_set_stance_tutorial.py | 215 | # =============== | COMMENT |
| MEDIUM | recipes_source/torch_compiler_set_stance_tutorial.py | 236 | # -------------- | COMMENT |
| MEDIUM | recipes_source/regional_aot.py | 52 | # --------------------------- | COMMENT |
| MEDIUM | recipes_source/regional_aot.py | 95 | # --------------------------------- | COMMENT |
| MEDIUM | recipes_source/regional_aot.py | 125 | # ---------------------------------------------- | COMMENT |
| MEDIUM | recipes_source/regional_aot.py | 174 | # -------------------------- | COMMENT |
| MEDIUM | recipes_source/regional_aot.py | 235 | # ----------- | COMMENT |
| MEDIUM | …e/torch_compile_user_defined_triton_kernel_tutorial.py | 19 | # ------------------- | COMMENT |
| MEDIUM | …e/torch_compile_user_defined_triton_kernel_tutorial.py | 38 | # -------------------- | COMMENT |
| MEDIUM | …e/torch_compile_user_defined_triton_kernel_tutorial.py | 83 | # ------------------------------------------------------------------- | COMMENT |
| MEDIUM | …e/torch_compile_user_defined_triton_kernel_tutorial.py | 144 | # ------------------------------------------------------------------- | COMMENT |
| MEDIUM | …e/torch_compile_user_defined_triton_kernel_tutorial.py | 344 | # -------------------------------------------------------------------- | COMMENT |
| MEDIUM | …e/torch_compile_user_defined_triton_kernel_tutorial.py | 361 | # ----------- | COMMENT |
| MEDIUM | recipes_source/debug_mode_tutorial.py | 50 | # ----------- | COMMENT |
| MEDIUM | recipes_source/debug_mode_tutorial.py | 72 | # ----------- | COMMENT |
| MEDIUM | recipes_source/debug_mode_tutorial.py | 108 | # ------------------ | COMMENT |
| MEDIUM | recipes_source/debug_mode_tutorial.py | 133 | # -------------------------------------- | COMMENT |
| MEDIUM | recipes_source/debug_mode_tutorial.py | 215 | # --------------------- | COMMENT |
| MEDIUM | recipes_source/debug_mode_tutorial.py | 239 | # ---------------------------------- | COMMENT |
| MEDIUM | recipes_source/debug_mode_tutorial.py | 273 | # ---------- | COMMENT |
| MEDIUM | recipes_source/recipes/tensorboard_with_pytorch.py | 23 | # ----------------------------- | COMMENT |
| MEDIUM | recipes_source/recipes/tensorboard_with_pytorch.py | 40 | # ----------- | COMMENT |
| MEDIUM | recipes_source/recipes/tensorboard_with_pytorch.py | 86 | # ---------------- | COMMENT |
| MEDIUM | recipes_source/recipes/tensorboard_with_pytorch.py | 118 | # ---------------------------- | COMMENT |
| MEDIUM | recipes_source/recipes/swap_tensors.py | 19 | # ---------------------------- | COMMENT |
| MEDIUM | recipes_source/recipes/swap_tensors.py | 37 | # ---------------------------- | COMMENT |
| MEDIUM | recipes_source/recipes/swap_tensors.py | 56 | # -------------------------------------- | COMMENT |
| MEDIUM | recipes_source/recipes/swap_tensors.py | 146 | # -------------------------------- | COMMENT |
| MEDIUM | recipes_source/recipes/swap_tensors.py | 237 | # ---------- | COMMENT |
| MEDIUM | recipes_source/recipes/benchmark.py | 883 | # ---------- | COMMENT |
| MEDIUM | recipes_source/recipes/profiler_recipe.py | 12 | # ------------ | COMMENT |
| MEDIUM | recipes_source/recipes/profiler_recipe.py | 20 | # --------------- | COMMENT |
| MEDIUM | recipes_source/recipes/profiler_recipe.py | 477 | # ---------- | COMMENT |
| MEDIUM | recipes_source/recipes/defining_a_neural_network.py | 178 | # ---------- | COMMENT |
| MEDIUM | recipes_source/recipes/zeroing_out_gradients.py | 188 | # ---------- | COMMENT |
| MEDIUM | recipes_source/recipes/tuning_guide.py | 212 | # -------------------------- | COMMENT |
| MEDIUM | recipes_source/recipes/tuning_guide.py | 289 | # -------------------------- | COMMENT |
| MEDIUM | recipes_source/recipes/tuning_guide.py | 434 | # ------------------------- | COMMENT |
| MEDIUM | recipes_source/recipes/tuning_guide.py | 510 | # ---------- | COMMENT |
| MEDIUM | recipes_source/recipes/tuning_guide.py | 528 | # --------------- | COMMENT |
| MEDIUM | recipes_source/recipes/Captum_Recipe.py | 26 | # ---------------- | COMMENT |
| MEDIUM | recipes_source/recipes/Captum_Recipe.py | 72 | # --------------------- | COMMENT |
| MEDIUM | recipes_source/recipes/Captum_Recipe.py | 123 | # ----------------------- | COMMENT |
| MEDIUM | recipes_source/recipes/Captum_Recipe.py | 173 | # ----------- | COMMENT |
| MEDIUM | recipes_source/recipes/what_is_state_dict.py | 128 | # ---------- | COMMENT |
| MEDIUM | …rting_model_using_parameters_from_a_different_model.py | 137 | # ---------- | COMMENT |
| MEDIUM | recipes_source/recipes/amp_recipe.py | 52 | # ---------------- | COMMENT |
| MEDIUM | recipes_source/recipes/amp_recipe.py | 92 | # ----------------- | COMMENT |
| MEDIUM | recipes_source/recipes/amp_recipe.py | 110 | # ------------------------- | COMMENT |
| 532 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | conf.py | 1 | #!/usr/bin/env python3 | COMMENT |
| LOW | conf.py | 301 | COMMENT | |
| LOW | conf.py | 341 | # If true, `todo` and `todoList` produce output, else they produce nothing. | COMMENT |
| LOW | conf.py | 361 | # 'sidebar_includehidden': True | COMMENT |
| LOW | conf.py | 381 | COMMENT | |
| LOW | recipes_source/foreach_map.py | 1 | """ | COMMENT |
| LOW | recipes_source/foreach_map.py | 21 | # | COMMENT |
| LOW | recipes_source/foreach_map.py | 141 | # Setting up and running the compiled kernel | COMMENT |
| LOW | recipes_source/foreach_map.py | 201 | # See also: | COMMENT |
| LOW | recipes_source/regional_compilation.py | 41 | # 1. Import all necessary libraries. | COMMENT |
| LOW | recipes_source/regional_compilation.py | 101 | #################################################### | COMMENT |
| LOW | recipes_source/regional_compilation.py | 121 | # | COMMENT |
| LOW | recipes_source/torch_export_aoti_python.py | 21 | # runtime. | COMMENT |
| LOW | recipes_source/torch_export_aoti_python.py | 41 | COMMENT | |
| LOW | recipes_source/torch_export_aoti_python.py | 61 | # Once we have exported the PyTorch model and obtained an ``ExportedProgram``, | COMMENT |
| LOW | recipes_source/torch_export_aoti_python.py | 101 | ) | COMMENT |
| LOW | recipes_source/torch_export_aoti_python.py | 121 | # │ │ ├── xxx.cpp # AOTInductor generated cpp file | COMMENT |
| LOW | recipes_source/torch_export_aoti_python.py | 141 | # Length Date Time Name | COMMENT |
| LOW | recipes_source/torch_export_aoti_python.py | 181 | with torch.inference_mode(): | COMMENT |
| LOW | recipes_source/torch_export_aoti_python.py | 261 | _, time_taken = timed(lambda: model(example_inputs)) | COMMENT |
| LOW | recipes_source/torch_compiler_set_stance_tutorial.py | 1 | # -*- coding: utf-8 -*- | COMMENT |
| LOW | recipes_source/torch_compiler_set_stance_tutorial.py | 21 | # --------------- | COMMENT |
| LOW | recipes_source/torch_compiler_set_stance_tutorial.py | 241 | # to control compilation stances like ``force_eager``, ``default``, | COMMENT |
| LOW | recipes_source/regional_aot.py | 41 | # | COMMENT |
| LOW | recipes_source/regional_aot.py | 161 | COMMENT | |
| LOW | recipes_source/regional_aot.py | 221 | regional_compilation_latency = measure_compile_time(input, regional=True) | COMMENT |
| LOW | recipes_source/torch_compile_torch_function_modes.py | 1 | """ | COMMENT |
| LOW | recipes_source/compiling_optimizer_lr_scheduler.py | 1 | """ | COMMENT |
| LOW | recipes_source/compiling_optimizer_lr_scheduler.py | 41 | # | COMMENT |
| LOW | recipes_source/compiling_optimizer_lr_scheduler.py | 101 | ###################################################################### | COMMENT |
| LOW | recipes_source/torch_logs.py | 21 | ###################################################################### | COMMENT |
| LOW | recipes_source/torch_logs.py | 81 | ###################################################################### | COMMENT |
| LOW | …e/torch_compile_user_defined_triton_kernel_tutorial.py | 1 | # -*- coding: utf-8 -*- | COMMENT |
| LOW | …e/torch_compile_user_defined_triton_kernel_tutorial.py | 21 | # Before starting this recipe, make sure that you have the following: | COMMENT |
| LOW | …e/torch_compile_user_defined_triton_kernel_tutorial.py | 81 | ###################################################################### | COMMENT |
| LOW | …e/torch_compile_user_defined_triton_kernel_tutorial.py | 141 | COMMENT | |
| LOW | …e/torch_compile_user_defined_triton_kernel_tutorial.py | 161 | # Here’s a chart of which API to use when integrating Triton kernels with PyTorch. | COMMENT |
| LOW | …e/torch_compile_user_defined_triton_kernel_tutorial.py | 181 | # - Yes | COMMENT |
| LOW | …e/torch_compile_user_defined_triton_kernel_tutorial.py | 341 | COMMENT | |
| LOW | …e/torch_compile_user_defined_triton_kernel_tutorial.py | 361 | # ----------- | COMMENT |
| LOW | recipes_source/debug_mode_tutorial.py | 21 | COMMENT | |
| LOW | recipes_source/debug_mode_tutorial.py | 41 | # | COMMENT |
| LOW | recipes_source/debug_mode_tutorial.py | 61 | return torch.mm(torch.relu(x), y) | COMMENT |
| LOW | recipes_source/debug_mode_tutorial.py | 101 | ###################################################################### | COMMENT |
| LOW | recipes_source/recipes/tensorboard_with_pytorch.py | 21 | ###################################################################### | COMMENT |
| LOW | recipes_source/recipes/tensorboard_with_pytorch.py | 81 | COMMENT | |
| LOW | recipes_source/recipes/tensorboard_with_pytorch.py | 101 | # | COMMENT |
| LOW | recipes_source/recipes/tensorboard_with_pytorch.py | 121 | # - `Visualizing models, data, and training with TensorBoard <https://pytorch.org/tutorials/intermediate/tensorboard_tu | COMMENT |
| LOW | recipes_source/recipes/swap_tensors.py | 21 | # utility function that takes in two Python tensors and swaps them. | COMMENT |
| LOW | recipes_source/recipes/swap_tensors.py | 41 | # the parameters will not see the change. A classic example of this is the | COMMENT |
| LOW | recipes_source/recipes/swap_tensors.py | 61 | # | COMMENT |
| LOW | recipes_source/recipes/swap_tensors.py | 141 | print(f"m.bias.dtype: {m.bias.dtype}") | COMMENT |
| LOW | recipes_source/recipes/swap_tensors.py | 161 | # | COMMENT |
| LOW | recipes_source/recipes/swap_tensors.py | 221 | print(f"m.state_dict() before load_state_dict():\n {m.state_dict()}") | COMMENT |
| LOW | recipes_source/recipes/benchmark.py | 41 | # 3. Benchmarking with ``torch.utils.benchmark.Timer`` | COMMENT |
| LOW | recipes_source/recipes/benchmark.py | 101 | print(f'bmm(x, x): {t1.timeit(100) / 100 * 1e6:>5.1f} us') | COMMENT |
| LOW | recipes_source/recipes/benchmark.py | 141 | # <torch.utils.benchmark.utils.common.Measurement object at 0x7fb10400d0f0> | COMMENT |
| LOW | recipes_source/recipes/benchmark.py | 201 | # 1 measurement, 100 runs , 40 threads | COMMENT |
| LOW | recipes_source/recipes/benchmark.py | 261 | # .. code-block:: none | COMMENT |
| LOW | recipes_source/recipes/benchmark.py | 281 | # it's important to do a warm-up run before benchmarking, luckily for | COMMENT |
| 1048 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | conf.py | 7 | # This file is execfile()d with the current directory set to its | COMMENT |
| MEDIUM | recipes_source/regional_aot.py | 51 | # Defining the Neural Network | COMMENT |
| MEDIUM | recipes_source/recipes/zeroing_out_gradients.py | 107 | # Defining a Neural Network recipe. | COMMENT |
| MEDIUM | advanced_source/pendulum.py | 517 | # The following code will just put together the pieces we have coded above. | COMMENT |
| MEDIUM | unstable_source/maskedtensor_adagrad.py | 162 | # Create an entirely new set of parameters to avoid errors | COMMENT |
| MEDIUM | intermediate_source/reinforcement_ppo.py | 203 | # Define an environment | COMMENT |
| MEDIUM | …ermediate_source/intermediate_data_loading_tutorial.py | 54 | # Creating a Sample Dataset | COMMENT |
| MEDIUM | intermediate_source/char_rnn_generation_tutorial.py | 129 | # Creating the Network | COMMENT |
| MEDIUM | intermediate_source/char_rnn_classification_tutorial.py | 222 | # Creating the Network | COMMENT |
| MEDIUM | intermediate_source/fx_profiling_tutorial.py | 82 | # Creating a Profiling Interpreter | COMMENT |
| MEDIUM | intermediate_source/pinmem_nonblock.py | 289 | # Create a figure with the results | COMMENT |
| MEDIUM | intermediate_source/pinmem_nonblock.py | 363 | # Create a list of tensors | COMMENT |
| MEDIUM | intermediate_source/pinmem_nonblock.py | 531 | # Create a tensor in pin-memory | COMMENT |
| MEDIUM | intermediate_source/pinmem_nonblock.py | 550 | # Create a tensor in pageable memory | COMMENT |
| MEDIUM | intermediate_source/pinmem_nonblock.py | 647 | # Create the dataset | COMMENT |
| MEDIUM | intermediate_source/neural_tangent_kernels.py | 59 | # Create a function version of the model | COMMENT |
| MEDIUM | intermediate_source/pruning_tutorial.py | 35 | # Create a model | COMMENT |
| MEDIUM | intermediate_source/torch_compile_tutorial.py | 53 | # The following code will print out the PyTorch ops that ``torch.compile`` traced. | COMMENT |
| MEDIUM | intermediate_source/ax_multiobjective_nas_tutorial.py | 45 | # Defining the TorchX App | COMMENT |
| MEDIUM | intermediate_source/ax_multiobjective_nas_tutorial.py | 314 | # Creating the Ax Experiment | COMMENT |
| MEDIUM | intermediate_source/mnist_train_nas.py | 74 | # Create a PyTorch model | COMMENT |
| MEDIUM | intermediate_source/torchvision_tutorial.py | 25 | # Defining the Dataset | COMMENT |
| MEDIUM | intermediate_source/torch_compile_conv_bn_fuser.py | 141 | # Define the pattern we want to match: conv2d followed by batch_norm | COMMENT |
| MEDIUM | intermediate_source/torch_compile_conv_bn_fuser.py | 179 | # Create a pattern matcher pass and register our pattern | COMMENT |
| MEDIUM⚡ | intermediate_source/torch_compile_conv_bn_fuser.py | 190 | # Create a custom pass function that applies our patterns | COMMENT |
| MEDIUM | intermediate_source/torch_compile_conv_bn_fuser.py | 231 | # Create a model with different shapes than our example_inputs | COMMENT |
| MEDIUM | …ermediate_source/variable_length_attention_tutorial.py | 271 | # Creating a Transformer | COMMENT |
| MEDIUM | intermediate_source/visualizing_gradients_tutorial.py | 137 | # The following code defines our hooks and gathers descriptive names for | COMMENT |
| MEDIUM | beginner_source/chatbot_tutorial.py | 160 | # The following functions facilitate the parsing of the raw | COMMENT |
| MEDIUM | beginner_source/mosaic_memory_profiling_tutorial.py | 1018 | # Create a reusable function for analyzing training memory snapshots. | COMMENT |
| MEDIUM | beginner_source/transfer_learning_tutorial.py | 152 | # Create a temporary directory to save training checkpoints | COMMENT |
| MEDIUM | beginner_source/fgsm_tutorial.py | 219 | # Create the perturbed image by adjusting each pixel of the input image | COMMENT |
| MEDIUM | beginner_source/dcgan_faces_tutorial.py | 247 | # Create the dataset | COMMENT |
| MEDIUM | beginner_source/dcgan_faces_tutorial.py | 255 | # Create the dataloader | COMMENT |
| MEDIUM | beginner_source/dcgan_faces_tutorial.py | 368 | # Create the generator | COMMENT |
| MEDIUM | beginner_source/dcgan_faces_tutorial.py | 439 | # Create the Discriminator | COMMENT |
| MEDIUM | beginner_source/saving_loading_models.py | 242 | # # Create a sample input | COMMENT |
| MEDIUM | beginner_source/hyperparameter_tuning_tutorial.py | 127 | # Define the search space | COMMENT |
| MEDIUM | beginner_source/hyperparameter_tuning_tutorial.py | 454 | # Creating the Tuner | COMMENT |
| MEDIUM | …inner_source/distributed_training_with_ray_tutorial.py | 241 | # Define the transformer model | COMMENT |
| MEDIUM | …inner_source/distributed_training_with_ray_tutorial.py | 276 | # Define the distributed training function | COMMENT |
| MEDIUM⚡ | beginner_source/serving_tutorial.py | 66 | # Define a PyTorch model | COMMENT |
| MEDIUM⚡ | beginner_source/serving_tutorial.py | 69 | # Define a simple convolutional neural network for the MNIST digit | COMMENT |
| MEDIUM | beginner_source/serving_tutorial.py | 97 | # Define the Ray Serve deployment | COMMENT |
| MEDIUM | beginner_source/serving_tutorial.py | 120 | # Define the transformation pipeline for the input images. | COMMENT |
| MEDIUM | beginner_source/knowledge_distillation_tutorial.py | 416 | # Create a similar student class where we return a tuple. We do not apply pooling after flattening. | COMMENT |
| MEDIUM | beginner_source/knowledge_distillation_tutorial.py | 458 | # Create a sample input tensor | COMMENT |
| MEDIUM⚡ | beginner_source/basics/buildmodel_tutorial.py | 42 | # Define the Class | COMMENT |
| MEDIUM⚡ | beginner_source/basics/data_tutorial.py | 111 | # Creating a Custom Dataset for your files | COMMENT |
| MEDIUM | beginner_source/introyt/trainingyt.py | 119 | # Create a grid from the images and show them | COMMENT |
| MEDIUM | beginner_source/introyt/autogradyt_tutorial.py | 465 | # The following code cell throws a runtime error. This is expected. | COMMENT |
| MEDIUM | beginner_source/introyt/tensorboardyt_tutorial.py | 117 | # Create a grid from the images and show them | COMMENT |
| MEDIUM | beginner_source/onnx/onnx_registry_tutorial.py | 78 | # Create a model that uses the operator torch.ops.aten.add.Tensor | COMMENT |
| MEDIUM | beginner_source/onnx/onnx_registry_tutorial.py | 143 | # Create a namespace for the custom operator using ONNX Script | COMMENT |
| MEDIUM | …rce/onnx/export_control_flow_model_to_onnx_tutorial.py | 41 | # Define the Models | COMMENT |
| MEDIUM | beginner_source/blitz/autograd_tutorial.py | 84 | # The below sections detail the workings of autograd - feel free to skip them. | COMMENT |
| MEDIUM | beginner_source/nlp/deep_learning_tutorial.py | 266 | # Define the parameters that you will need. In this case, we need A and b, | STRING |
| MEDIUM | beginner_source/nlp/sequence_models_tutorial.py | 152 | # Create the model: | STRING |
| MEDIUM | beginner_source/nlp/advanced_tutorial.py | 237 | # Initialize the viterbi variables in log space | STRING |
| MEDIUM | beginner_source/nlp/pytorch_tutorial.py | 39 | # Create a 3D tensor of size 2x2x2. | STRING |
| 3 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | recipes_source/foreach_map.py | 197 | # optimizer that can be used in various machine learning applications. This tutorial provides a comprehensive guide | COMMENT |
| MEDIUM | recipes_source/torch_export_aoti_python.py | 70 | # CUDA graphs and leverage Triton based matrix multiplications and | COMMENT |
| MEDIUM | recipes_source/torch_compile_torch_function_modes.py | 73 | # using torch function modes from within ``torch.compile``. This enables users to utilize | COMMENT |
| MEDIUM | …e/torch_compile_user_defined_triton_kernel_tutorial.py | 362 | # In this recipe, we explored how to utilize user-defined Triton kernels | COMMENT |
| MEDIUM | recipes_source/recipes/tuning_guide.py | 161 | # convolutional networks. This format is meant to be used in conjunction with | COMMENT |
| MEDIUM | recipes_source/recipes/tuning_guide.py | 512 | # This tutorial covered a comprehensive set of performance optimization techniques | COMMENT |
| MEDIUM | recipes_source/recipes/Captum_Recipe.py | 13 | # Using Captum, you can apply a wide range of state-of-the-art feature | COMMENT |
| MEDIUM | advanced_source/coding_ddpg.py | 572 | # To leverage the vectorization capabilities of PyTorch, we adopt | COMMENT |
| LOW | advanced_source/coding_ddpg.py | 179 | # accessible but this will just return a **detached** version of the | COMMENT |
| LOW | advanced_source/coding_ddpg.py | 425 | # are collected by :func:`env.step()`, simply pass the ``from_pixels=True`` | COMMENT |
| MEDIUM | advanced_source/semi_structured_sparse.py | 129 | # that a simple paradigm of magnitude pruning once to be 2:4 sparse and | COMMENT |
| MEDIUM | advanced_source/usb_semisup_learn.py | 54 | # USB is easy to use and extend, affordable to small groups, and comprehensive | COMMENT |
| MEDIUM | advanced_source/pendulum.py | 169 | # To facilitate the reading and writing from that ``tensordict`` and to make sure | COMMENT |
| MEDIUM | unstable_source/gpu_direct_storage.py | 131 | # in conjunction with ``torch.save`` and ``torch.load`` on local filesystem. Please | COMMENT |
| LOW | unstable_source/vmap_recipe.py | 55 | # shenanigins), we can simply call `vmap`. `vmap` batches over ALL | COMMENT |
| MEDIUM | unstable_source/nestedtensor.py | 161 | # The primary objective of nested tensor is to facilitate operations on ragged | COMMENT |
| MEDIUM | unstable_source/maskedtensor_advanced_semantics.py | 99 | # Fundamentally, :class:`MaskedTensor`s perform the same reduction operation while ignoring the masked out | COMMENT |
| MEDIUM⚡ | …ermediate_source/intermediate_data_loading_tutorial.py | 821 | # improvement in throughput. These should be considered best practices | COMMENT |
| LOW | …ermediate_source/intermediate_data_loading_tutorial.py | 270 | # Since batch size is model-dependent (not a "just add it" optimization), | COMMENT |
| MEDIUM | intermediate_source/inductor_debug_cpu.py | 22 | # comprehensive `troubleshooting <https://pytorch.org/docs/stable/torch.compiler_troubleshooting.html>`_ | COMMENT |
| MEDIUM | intermediate_source/inductor_debug_cpu.py | 633 | # We demonstrate step by step the way to delve deeper the issue and find the root cause of failures, with the help of de | COMMENT |
| LOW | intermediate_source/char_rnn_generation_tutorial.py | 286 | loss = torch.Tensor([0]) # you can also just simply use ``loss = 0`` | CODE |
| MEDIUM | intermediate_source/torch_export_tutorial.py | 659 | # While these options are valid, they have their pitfalls. Option 1 sometimes requires drastic, invasive rewrites of the | COMMENT |
| MEDIUM⚡ | intermediate_source/transformer_building_blocks.py | 563 | # aforementioned building blocks, including the following: | COMMENT |
| MEDIUM | intermediate_source/forward_ad_usage.py | 105 | # Another way to use ``nn.Module`` with forward AD is to utilize | COMMENT |
| MEDIUM | intermediate_source/dqn_with_rnn_tutorial.py | 220 | # values for these attributes to facilitate its construction. | COMMENT |
| LOW | intermediate_source/reinforcement_q_learning.py | 186 | # approximators, we can simply create one and train it to resemble | COMMENT |
| MEDIUM | intermediate_source/reinforcement_q_learning.py | 202 | # absolute error when the error is large - this makes it more robust to | COMMENT |
| MEDIUM | intermediate_source/torchrec_intro_tutorial.py | 93 | # * The **embeddings are used in conjunction with the rest of the model to | COMMENT |
| MEDIUM | intermediate_source/torchrec_intro_tutorial.py | 797 | # TorchRec modules provide a seamless API to fuse the | COMMENT |
| MEDIUM | beginner_source/chatbot_tutorial.py | 22 | # not robust enough for more general use-cases. Teaching a machine to | COMMENT |
| MEDIUM | beginner_source/chatbot_tutorial.py | 135 | # diversity makes our model robust to many forms of inputs and queries. | COMMENT |
| MEDIUM | beginner_source/chatbot_tutorial.py | 160 | # The following functions facilitate the parsing of the raw | COMMENT |
| MEDIUM | beginner_source/chatbot_tutorial.py | 454 | # to leverage GPU parallelization capabilities, you will need to train | COMMENT |
| MEDIUM | beginner_source/chatbot_tutorial.py | 489 | # and target tensors using the aforementioned functions. | COMMENT |
| MEDIUM | beginner_source/chatbot_tutorial.py | 1102 | # To facilitate the greedy decoding operation, we define a | COMMENT |
| MEDIUM | beginner_source/fgsm_tutorial.py | 435 | # more *robust* in general, to both naturally perturbed and adversarially | COMMENT |
| MEDIUM | beginner_source/nn_tutorial.py | 18 | # In order to fully utilize their power and customize | COMMENT |
| LOW | beginner_source/nn_tutorial.py | 162 | # (again, we can just use standard Python): | COMMENT |
| MEDIUM | …inner_source/distributed_training_with_ray_tutorial.py | 495 | # your training jobs robust to unexpected failures. Checkpointing | COMMENT |
| MEDIUM | beginner_source/knowledge_distillation_tutorial.py | 385 | # Now, the forward function returns not only the logits of the network but also the flattened hidden representation afte | COMMENT |
| MEDIUM | beginner_source/knowledge_distillation_tutorial.py | 570 | # However, this time, we will introduce a regressor between the networks to facilitate the matching process. | COMMENT |
| MEDIUM | beginner_source/basics/optimization_tutorial.py | 156 | # Unnecessary in this situation but added for best practices | COMMENT |
| MEDIUM | beginner_source/basics/optimization_tutorial.py | 175 | # Unnecessary in this situation but added for best practices | COMMENT |
| LOW | beginner_source/introyt/autogradyt_tutorial.py | 291 | # loss function, we’ll just use the square of the Euclidean distance | COMMENT |
| MEDIUM | beginner_source/introyt/tensors_deeper_tutorial.py | 637 | # One of the major advantages of PyTorch is its robust acceleration on an | COMMENT |
| LOW | beginner_source/introyt/tensors_deeper_tutorial.py | 875 | # lets us cheat and just use a series of integers. Here, we had to add the | COMMENT |
| MEDIUM | beginner_source/introyt/introyt1_tutorial.py | 628 | # accurate at this point. That’s not exactly state-of-the-art, but it’s | COMMENT |
| MEDIUM⚡ | beginner_source/onnx/onnx_registry_tutorial.py | 56 | # Because we don't actually have an unsupported PyTorch operator to use in this tutorial, we are going to leverage | COMMENT |
| MEDIUM⚡ | beginner_source/onnx/onnx_registry_tutorial.py | 256 | # providing us with a comprehensive understanding of handling unsupported | COMMENT |
| LOW | beginner_source/blitz/neural_networks_tutorial.py | 127 | # If you have a single sample, just use ``input.unsqueeze(0)`` to add | COMMENT |
| MEDIUM⚡ | beginner_source/blitz/cifar10_tutorial.py | 351 | # - `Train a state-of-the-art ResNet network on imagenet`_ | COMMENT |
| MEDIUM⚡ | beginner_source/blitz/cifar10_tutorial.py | 359 | # .. _Train a state-of-the-art ResNet network on imagenet: https://github.com/pytorch/examples/tree/main/imagenet | COMMENT |
| LOW | beginner_source/nlp/deep_learning_tutorial.py | 329 | # functions in torch.optim. Here, we will just use SGD. | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | recipes_source/regional_compilation.py | 105 | # most users take with ``torch.compile``. In this example, we apply ``torch.compile`` to | COMMENT |
| HIGH | recipes_source/compiling_optimizer_lr_scheduler.py | 10 | # In this example, we will show how to pair the optimizer, which has been compiled using ``torch.compile``, | COMMENT |
| HIGH | recipes_source/torch_logs.py | 24 | # In this example, we'll set up a simple Python function which performs an elementwise | COMMENT |
| HIGH | …e/torch_compile_user_defined_triton_kernel_tutorial.py | 40 | # In this example, we will use a simple vector addition kernel from the Triton documentation | COMMENT |
| HIGH | advanced_source/pendulum.py | 306 | # In this example, we do not pass a done state as this is not mandatory | COMMENT |
| HIGH | advanced_source/pendulum.py | 813 | # In this example, we will train a simple policy using the reward as a | COMMENT |
| HIGH | …ediate_source/autograd_saved_tensors_hooks_tutorial.py | 71 | # In this example, PyTorch saves intermediary values :math:`a` and | COMMENT |
| HIGH | intermediate_source/mario_rl_tutorial.py | 735 | # In this example we run the training loop for 40 episodes, but for Mario to truly learn the ways of | COMMENT |
| HIGH | intermediate_source/pinmem_nonblock.py | 684 | # In this example, we are transferring many large tensors from the CPU to the GPU. | COMMENT |
| HIGH | intermediate_source/pruning_tutorial.py | 91 | # In this example, we will prune at random 30% of the connections in | COMMENT |
| HIGH | beginner_source/hyperparameter_tuning_tutorial.py | 151 | # sampled from. In this example, the ``l1`` and ``l2`` parameter values | COMMENT |
| HIGH | beginner_source/hyperparameter_tuning_tutorial.py | 276 | # each trial. In this example, the model architecture and optimizer | COMMENT |
| HIGH | beginner_source/profiler.py | 41 | # models. In this example, we build a custom module that performs two | COMMENT |
| HIGH⚡ | beginner_source/basics/buildmodel_tutorial.py | 178 | # In this example, we iterate over each parameter, and print its size and a preview of its values. | COMMENT |
| HIGH | beginner_source/nlp/sequence_models_tutorial.py | 98 | # used after you have seen what is going on. In this example, we also refer | STRING |
| HIGH | beginner_source/nlp/word_embeddings_tutorial.py | 188 | # In this example, we will compute the loss function on some training | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | …e/torch_compile_user_defined_triton_kernel_tutorial.py | 16 | # This recipes demonstrates how you can use user-defined Triton kernels with ``torch.compile``. | COMMENT |
| LOW | …e/torch_compile_user_defined_triton_kernel_tutorial.py | 336 | # Before running the code below, make sure you have ``tabulate`` installed or install by | COMMENT |
| MEDIUM | recipes_source/debug_mode_tutorial.py | 135 | # If you have numerical divergence between modes, you can use DebugMode to find where the | COMMENT |
| LOW | advanced_source/coding_ddpg.py | 281 | # When computing this value, we must make sure to take the value parameters out | COMMENT |
| MEDIUM | unstable_source/gpu_direct_storage.py | 70 | # be saved or loaded to repeatedly you can use the ``torch.cuda.gds.gds_register_buffer`` which wraps | COMMENT |
| MEDIUM | unstable_source/gpu_direct_storage.py | 102 | # The loading flow is the inverse: you can use ``torch.load`` with the ``torch.serialization.skip_data`` context | COMMENT |
| LOW | unstable_source/maskedtensor_advanced_semantics.py | 14 | # Before working on this tutorial, please make sure to review our | COMMENT |
| MEDIUM | unstable_source/gpu_quantization_torchao_tutorial.py | 38 | # 1. Go to the `segment-anything repo checkpoint <https://github.com/facebookresearch/segment-anything/tree/main#model-c | COMMENT |
| MEDIUM | unstable_source/gpu_quantization_torchao_tutorial.py | 170 | # into an issue, you can use ``apply_dynamic_quant`` and | COMMENT |
| LOW | unstable_source/maskedtensor_sparsity.py | 9 | # Before working on this tutorial, please make sure to review our | COMMENT |
| MEDIUM | intermediate_source/reinforcement_ppo.py | 482 | # it is an iterator that you can use to get batches of data of a given length, and | COMMENT |
| LOW | intermediate_source/reinforcement_ppo.py | 38 | # If you are running this in Google Colab, make sure you install the following dependencies: | COMMENT |
| MEDIUM | intermediate_source/inductor_debug_cpu.py | 40 | # Here is a simple example to run the ``torch.compile`` using Inductor and compare its result with eager mode: | COMMENT |
| MEDIUM | intermediate_source/inductor_debug_cpu.py | 273 | # Otherwise, if the model runs with other errors or accuracy problem, you can use the PyTorch debugging tool called `Min | COMMENT |
| MEDIUM | intermediate_source/fx_profiling_tutorial.py | 19 | # for demonstration purposes. | COMMENT |
| LOW | intermediate_source/fx_profiling_tutorial.py | 59 | # make sure you've installed it from your favorite Python package source. | COMMENT |
| MEDIUM | intermediate_source/pinmem_nonblock.py | 76 | # can live anywhere in the virtual memory (both in RAM or on disk). As mentioned earlier, this has the advantage that | COMMENT |
| MEDIUM | intermediate_source/pinmem_nonblock.py | 336 | # As mentioned earlier, many PyTorch operations have the option of being executed asynchronously with respect to the hos | COMMENT |
| MEDIUM | intermediate_source/dqn_with_rnn_tutorial.py | 257 | # As mentioned earlier, we have one more optional transform to add to our | COMMENT |
| LOW | intermediate_source/dqn_with_rnn_tutorial.py | 61 | # If you are running this in Google Colab, make sure you install the following dependencies: | COMMENT |
| MEDIUM | …ediate_source/scaled_dot_product_attention_tutorial.py | 278 | # PyTorch comes with an amazing built-in profiler that you can use to | COMMENT |
| MEDIUM | intermediate_source/seq2seq_translation_tutorial.py | 870 | # (``I am test \t I am test``), you can use this as an autoencoder. Try | COMMENT |
| MEDIUM⚡ | intermediate_source/torch_compile_conv_bn_fuser.py | 200 | # We make some simplifications here for demonstration purposes, such as only | COMMENT |
| MEDIUM | intermediate_source/torchrec_intro_tutorial.py | 837 | # ``CombinedOptimizer`` that you can use in your training loop to | COMMENT |
| LOW | intermediate_source/torchrec_intro_tutorial.py | 33 | # Before running this tutorial in Google Colab, make sure to install the | COMMENT |
| LOW | intermediate_source/torchrec_intro_tutorial.py | 44 | # If you are running this in Google Colab, make sure to switch to a GPU runtime type. | COMMENT |
| MEDIUM | beginner_source/chatbot_tutorial.py | 1365 | # interested, you can try tailoring the chatbot’s behavior by tweaking the | COMMENT |
| LOW | beginner_source/mosaic_memory_profiling_tutorial.py | 367 | # Google Colab, make sure to select a GPU runtime: | COMMENT |
| MEDIUM | beginner_source/nn_tutorial.py | 870 | # We now have a general data pipeline and training loop which you can use for | COMMENT |
| MEDIUM | beginner_source/hyperparameter_tuning_tutorial.py | 78 | # dataset across different trials. In a cluster environment, you can use | COMMENT |
| MEDIUM | …inner_source/distributed_training_with_ray_tutorial.py | 564 | # low GPU use because workers are waiting on data, you can add | COMMENT |
| MEDIUM | beginner_source/basics/autogradqs_tutorial.py | 168 | # you can change the shape, size and operations at every iteration if | COMMENT |
| LOW⚡ | beginner_source/onnx/onnx_registry_tutorial.py | 37 | # Before starting this tutorial, make sure you have completed the following prerequisites: | COMMENT |
| MEDIUM⚡ | beginner_source/onnx/onnx_registry_tutorial.py | 50 | # might not be supported yet. In this section, we will demonstrate how you can add | COMMENT |
| MEDIUM | beginner_source/blitz/data_parallel_tutorial.py | 91 | # gives an output. However, you can use ``DataParallel`` on any model (CNN, RNN, | COMMENT |
| MEDIUM | beginner_source/blitz/autograd_tutorial.py | 248 | # you can change the shape, size and operations at every iteration if | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | conf.py | 40 | CODE | |
| LOW | conf.py | 41 | CODE | |
| LOW | conf.py | 43 | CODE | |
| LOW | conf.py | 46 | CODE | |
| LOW | conf.py | 48 | CODE | |
| LOW | conf.py | 56 | CODE | |
| LOW | conf.py | 108 | CODE | |
| LOW | …e/torch_compile_user_defined_triton_kernel_tutorial.py | 323 | CODE | |
| LOW | recipes_source/debug_mode_tutorial.py | 54 | CODE | |
| LOW | recipes_source/recipes/benchmark.py | 556 | CODE | |
| LOW | recipes_source/recipes/tuning_guide.py | 41 | CODE | |
| LOW | recipes_source/recipes/timer_quick_start.py | 138 | CODE | |
| LOW | recipes_source/recipes/what_is_state_dict.py | 53 | CODE | |
| LOW | …rting_model_using_parameters_from_a_different_model.py | 50 | CODE | |
| LOW | advanced_source/numpy_extensions_tutorial.py | 80 | CODE | |
| LOW | advanced_source/neural_style_tutorial.py | 61 | CODE | |
| LOW | advanced_source/semi_structured_sparse.py | 55 | CODE | |
| LOW | advanced_source/semi_structured_sparse.py | 206 | CODE | |
| LOW | advanced_source/usb_semisup_learn.py | 87 | CODE | |
| LOW | intermediate_source/mario_rl_tutorial.py | 42 | CODE | |
| LOW | intermediate_source/mario_rl_tutorial.py | 45 | CODE | |
| LOW | intermediate_source/mario_rl_tutorial.py | 46 | CODE | |
| LOW | intermediate_source/char_rnn_classification_tutorial.py | 239 | CODE | |
| LOW | intermediate_source/ax_multiobjective_nas_tutorial.py | 480 | CODE | |
| LOW | intermediate_source/ax_multiobjective_nas_tutorial.py | 480 | CODE | |
| LOW | intermediate_source/mnist_train_nas.py | 8 | CODE | |
| LOW | intermediate_source/seq2seq_translation_tutorial.py | 85 | CODE | |
| LOW | intermediate_source/seq2seq_translation_tutorial.py | 85 | CODE | |
| LOW | intermediate_source/seq2seq_translation_tutorial.py | 85 | CODE | |
| LOW | intermediate_source/torch_compile_conv_bn_fuser.py | 31 | CODE | |
| LOW | intermediate_source/torch_compile_conv_bn_fuser.py | 31 | CODE | |
| LOW | intermediate_source/torch_compile_conv_bn_fuser.py | 31 | CODE | |
| LOW | intermediate_source/torch_compile_conv_bn_fuser.py | 31 | CODE | |
| LOW | intermediate_source/torch_compile_conv_bn_fuser.py | 31 | CODE | |
| LOW | beginner_source/chatbot_tutorial.py | 95 | CODE | |
| LOW | beginner_source/chatbot_tutorial.py | 95 | CODE | |
| LOW | beginner_source/chatbot_tutorial.py | 107 | CODE | |
| LOW | beginner_source/fgsm_tutorial.py | 96 | CODE | |
| LOW | beginner_source/dcgan_faces_tutorial.py | 116 | CODE | |
| LOW | beginner_source/dcgan_faces_tutorial.py | 117 | CODE | |
| LOW | beginner_source/nn_tutorial.py | 219 | CODE | |
| LOW | beginner_source/nn_tutorial.py | 80 | CODE | |
| LOW | …inner_source/distributed_training_with_ray_tutorial.py | 64 | CODE | |
| LOW | beginner_source/basics/buildmodel_tutorial.py | 25 | CODE | |
| LOW | beginner_source/basics/buildmodel_tutorial.py | 28 | CODE | |
| LOW | beginner_source/basics/buildmodel_tutorial.py | 29 | CODE | |
| LOW | beginner_source/basics/buildmodel_tutorial.py | 29 | CODE | |
| LOW | beginner_source/introyt/autogradyt_tutorial.py | 119 | CODE | |
| LOW | beginner_source/introyt/captumyt.py | 127 | CODE | |
| LOW | beginner_source/introyt/captumyt.py | 131 | CODE | |
| LOW | beginner_source/introyt/captumyt.py | 131 | CODE | |
| LOW | beginner_source/introyt/introyt1_tutorial.py | 420 | CODE | |
| LOW | beginner_source/nlp/advanced_tutorial.py | 120 | CODE | |
| LOW | …ginner_source/examples_autograd/polynomial_autograd.py | 17 | CODE | |
| LOW | .jenkins/custom_pandoc_filter.py | 1 | CODE | |
| LOW | .jenkins/custom_pandoc_filter.py | 1 | CODE | |
| LOW | .jenkins/custom_pandoc_filter.py | 1 | CODE | |
| LOW | .jenkins/get_sphinx_filenames.py | 1 | CODE | |
| LOW | .jenkins/remove_invisible_code_block_from_rst_txt.py | 2 | CODE | |
| LOW | .jenkins/remove_invisible_code_block_from_ipynb.py | 2 | CODE | |
| 1 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | .claude/skills/pr-review/SKILL.md | 145 | ### Step 1: Fetch PR Information | COMMENT |
| LOW⚡ | .claude/skills/pr-review/SKILL.md | 153 | ### Step 2: Analyze Changes | COMMENT |
| LOW⚡ | .claude/skills/pr-review/SKILL.md | 160 | ### Step 3: Deep Review | COMMENT |
| LOW⚡ | .claude/skills/pr-review/SKILL.md | 169 | ### Step 4: Formulate Review | COMMENT |
| LOW⚡ | .jenkins/build.sh | 61 | # Step 2: Keep certain tutorials based on file count, and remove runnable code in all other tutorials | COMMENT |
| LOW⚡ | .jenkins/build.sh | 68 | # Step 3: Run `make docs` to generate HTML files and static files for these tutorialis | COMMENT |
| LOW⚡ | .jenkins/build.sh | 74 | # Step 4: If any of the generated files are not related the tutorial files we want to run, | COMMENT |
| LOW⚡ | .jenkins/build.sh | 121 | # Step 5: Remove INVISIBLE_CODE_BLOCK from .html/.rst.txt/.ipynb/.py files | COMMENT |
| LOW⚡ | .jenkins/build.sh | 125 | # Step 6: Copy generated files to S3, tag with commit ID | COMMENT |
| LOW⚡ | .jenkins/build.sh | 131 | # Step 1: Generate no-plot HTML pages for all tutorials | COMMENT |
| LOW⚡ | .jenkins/build.sh | 135 | # Step 2: Wait for all workers to finish | COMMENT |
| LOW⚡ | .jenkins/build.sh | 138 | # Step 3: Download generated with-plot HTML files and static files from S3, merge into one folder | COMMENT |
| LOW⚡ | .jenkins/build.sh | 146 | # Step 4: Copy all generated files into docs | COMMENT |
| LOW⚡ | .jenkins/build.sh | 149 | # Step 5: Remove INVISIBLE_CODE_BLOCK from .html/.rst.txt/.ipynb/.py files | COMMENT |
| LOW⚡ | .jenkins/build.sh | 156 | # Step 6: Copy generated HTML files and static files to S3 | COMMENT |
| LOW⚡ | .jenkins/build.sh | 160 | # Step 7: push new HTML files and static files to gh-pages | COMMENT |
| LOW | .jenkins/build.sh | 50 | # Step 1: Remove runnable code from tutorials that are not supposed to be run | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | conf.py | 443 | # Check if the page is in gallery directories | STRING |
| LOW | advanced_source/cuda_graph_annotations_tutorial.py | 341 | # Check if annotation support is available | COMMENT |
| LOW | intermediate_source/mario_rl_tutorial.py | 775 | # Check if end of game | COMMENT |
| LOW⚡ | intermediate_source/char_rnn_classification_tutorial.py | 61 | # Check if CUDA is available | COMMENT |
| LOW | intermediate_source/mnist_train_nas.py | 166 | # Print outputs | COMMENT |
| LOW | intermediate_source/seq2seq_translation_tutorial.py | 208 | # Read the file and split into lines | COMMENT |
| LOW⚡ | .github/scripts/check_redirects.sh | 11 | # Check if any deleted or renamed files were found | COMMENT |
| LOW⚡ | .github/scripts/check_redirects.sh | 20 | # Check if redirects.py has been updated | COMMENT |
| LOW⚡ | .github/scripts/check_redirects.sh | 28 | # Check if each deleted file has a redirect entry | COMMENT |
| LOW⚡ | .github/scripts/check_redirects.sh | 34 | # Check if this path exists in redirects.py as a key. We don't check for values. | COMMENT |
| LOW | beginner_source/chatbot_tutorial.py | 350 | # Read the file and split into lines | COMMENT |
| LOW | beginner_source/chatbot_tutorial.py | 1208 | # Check if it is quit case | COMMENT |
| LOW | beginner_source/chatbot_tutorial.py | 1247 | # Set checkpoint to load from; set to None if starting from scratch | COMMENT |
| LOW | beginner_source/mosaic_memory_profiling_tutorial.py | 384 | # Check if Mosaic CLI is available | COMMENT |
| LOW⚡ | beginner_source/transfer_learning_tutorial.py | 166 | model.train() # Set model to training mode | CODE |
| LOW⚡ | beginner_source/transfer_learning_tutorial.py | 168 | model.eval() # Set model to evaluate mode | CODE |
| LOW⚡ | beginner_source/transfer_learning_tutorial.py | 173 | # Iterate over data. | COMMENT |
| LOW | beginner_source/knowledge_distillation_tutorial.py | 40 | # Check if the current `accelerator <https://pytorch.org/docs/stable/torch.html#accelerators>`__ | COMMENT |
| LOW | .jenkins/insert_last_verified.py | 118 | # Check if the <p> tag with class "date-info-last-verified" already exists | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | conf.py | 75 | except Exception as e: | CODE |
| MEDIUM | conf.py | 71 | def call_fn(func, args, kwargs, result_queue): | CODE |
| LOW | recipes_source/torch_compiler_set_stance_tutorial.py | 91 | except Exception as e: | CODE |
| LOW | recipes_source/torch_compiler_set_stance_tutorial.py | 108 | except Exception as e: | CODE |
| LOW | recipes_source/torch_compiler_set_stance_tutorial.py | 145 | except Exception as e: | CODE |
| LOW | recipes_source/torch_compiler_set_stance_tutorial.py | 231 | except Exception as e: | CODE |
| LOW | advanced_source/python_custom_ops_functional.py | 144 | except Exception as exc: | CODE |
| LOW | unstable_source/gpu_quantization_torchao_tutorial.py | 99 | except Exception as e: | CODE |
| LOW | unstable_source/gpu_quantization_torchao_tutorial.py | 301 | except Exception as e: | CODE |
| LOW | intermediate_source/torch_export_tutorial.py | 123 | except Exception: | CODE |
| LOW | intermediate_source/torch_export_tutorial.py | 136 | except Exception: | CODE |
| LOW | intermediate_source/torch_export_tutorial.py | 149 | except Exception: | CODE |
| LOW | intermediate_source/torch_export_tutorial.py | 287 | except Exception: | CODE |
| LOW | intermediate_source/torch_export_tutorial.py | 419 | except Exception: | CODE |
| LOW | intermediate_source/torch_export_tutorial.py | 432 | except Exception: | CODE |
| LOW | intermediate_source/torch_export_tutorial.py | 469 | except Exception: | CODE |
| LOW | intermediate_source/torch_export_tutorial.py | 501 | except Exception: | CODE |
| LOW | intermediate_source/torch_export_tutorial.py | 565 | except Exception: | CODE |
| LOW | intermediate_source/torch_export_tutorial.py | 710 | except Exception: | CODE |
| LOW | intermediate_source/torch_export_tutorial.py | 757 | except Exception: | CODE |
| LOW | intermediate_source/memory_format_tutorial.py | 333 | except Exception as e: | CODE |
| LOW | intermediate_source/memory_format_tutorial.py | 371 | except Exception as e: | CODE |
| MEDIUM | beginner_source/chatbot_tutorial.py | 1219 | print("Error: Encountered unknown word.") | CODE |
| LOW | …rce/onnx/export_control_flow_model_to_onnx_tutorial.py | 95 | except Exception as e: | CODE |
| LOW | .jenkins/download_data.py | 109 | except Exception as e: | CODE |
| MEDIUM | .jenkins/insert_last_verified.py | 147 | print("Error: Build directory not provided. Exiting.") | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | beginner_source/blitz/cifar10_tutorial.py | 206 | # But we need to check if the network has learnt anything at all. | COMMENT |
| LOW⚡ | .jenkins/build.sh | 61 | # Step 2: Keep certain tutorials based on file count, and remove runnable code in all other tutorials | COMMENT |
| LOW⚡ | .jenkins/build.sh | 68 | # Step 3: Run `make docs` to generate HTML files and static files for these tutorialis | COMMENT |
| LOW⚡ | .jenkins/build.sh | 74 | # Step 4: If any of the generated files are not related the tutorial files we want to run, | COMMENT |
| LOW⚡ | .jenkins/build.sh | 121 | # Step 5: Remove INVISIBLE_CODE_BLOCK from .html/.rst.txt/.ipynb/.py files | COMMENT |
| LOW⚡ | .jenkins/build.sh | 125 | # Step 6: Copy generated files to S3, tag with commit ID | COMMENT |
| LOW⚡ | .jenkins/build.sh | 131 | # Step 1: Generate no-plot HTML pages for all tutorials | COMMENT |
| LOW⚡ | .jenkins/build.sh | 135 | # Step 2: Wait for all workers to finish | COMMENT |
| LOW⚡ | .jenkins/build.sh | 138 | # Step 3: Download generated with-plot HTML files and static files from S3, merge into one folder | COMMENT |
| LOW⚡ | .jenkins/build.sh | 146 | # Step 4: Copy all generated files into docs | COMMENT |
| LOW⚡ | .jenkins/build.sh | 149 | # Step 5: Remove INVISIBLE_CODE_BLOCK from .html/.rst.txt/.ipynb/.py files | COMMENT |
| LOW⚡ | .jenkins/build.sh | 156 | # Step 6: Copy generated HTML files and static files to S3 | COMMENT |
| LOW⚡ | .jenkins/build.sh | 160 | # Step 7: push new HTML files and static files to gh-pages | COMMENT |
| LOW | .jenkins/build.sh | 50 | # Step 1: Remove runnable code from tutorials that are not supposed to be run | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | advanced_source/coding_ddpg.py | 77 | except RuntimeError: | CODE |
| HIGH | advanced_source/pendulum.py | 88 | except RuntimeError: | CODE |
| HIGH | intermediate_source/reinforcement_ppo.py | 118 | except RuntimeError: | CODE |
| HIGH | intermediate_source/dqn_with_rnn_tutorial.py | 84 | except RuntimeError: | CODE |
| HIGH | .jenkins/insert_last_verified.py | 45 | except subprocess.CalledProcessError: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | recipes_source/foreach_map.py | 176 | def benchmark_torch_function_in_microseconds(f, *args, **kwargs): | CODE |
| LOW | advanced_source/neural_style_tutorial.py | 307 | def get_style_model_and_losses(cnn, normalization_mean, normalization_std, | CODE |
| LOW | advanced_source/semi_structured_sparse.py | 223 | def preprocess_validation_function(examples, tokenizer): | CODE |
| LOW | advanced_source/semi_structured_sparse.py | 249 | def preprocess_train_function(examples, tokenizer): | CODE |
| LOW | advanced_source/cuda_graph_annotations_tutorial.py | 208 | def capture_graph_with_annotations(model_fn): | CODE |
| LOW | advanced_source/pendulum.py | 689 | def transform_observation_spec(self, observation_spec): | CODE |
| LOW | advanced_source/pendulum.py | 713 | def transform_observation_spec(self, observation_spec): | CODE |
| LOW | intermediate_source/jacobians_hessians.py | 290 | def predict_with_output_summed(weight, bias, x): | CODE |
| LOW | intermediate_source/pinmem_nonblock.py | 354 | def copy_to_device_nonblocking(*tensors): | CODE |
| LOW | intermediate_source/pinmem_nonblock.py | 448 | def pin_copy_to_device_nonblocking(*tensors): | CODE |
| LOW | intermediate_source/neural_tangent_kernels.py | 103 | def empirical_ntk_jacobian_contraction(fnet_single, params, x1, x2): | CODE |
| LOW | intermediate_source/neural_tangent_kernels.py | 128 | def empirical_ntk_jacobian_contraction(fnet_single, params, x1, x2, compute='full'): | CODE |
| LOW | intermediate_source/ax_multiobjective_nas_tutorial.py | 244 | def _get_event_multiplexer_for_trial(self, trial): | CODE |
| LOW | intermediate_source/ax_multiobjective_nas_tutorial.py | 255 | def is_available_while_running(cls): | CODE |
| LOW | intermediate_source/torchvision_tutorial.py | 318 | def get_model_instance_segmentation(num_classes): | CODE |
| LOW | …ediate_source/scaled_dot_product_attention_tutorial.py | 68 | def benchmark_torch_function_in_microseconds(f, *args, **kwargs): | CODE |
| LOW | beginner_source/mosaic_memory_profiling_tutorial.py | 936 | def run_training_with_memory_capture( | CODE |
| LOW | beginner_source/mosaic_memory_profiling_tutorial.py | 1070 | def training_pipeline_with_memory_monitoring( | CODE |
| LOW | beginner_source/transfer_learning_tutorial.py | 354 | def visualize_model_predictions(model,img_path): | CODE |
| LOW | beginner_source/knowledge_distillation_tutorial.py | 303 | def train_knowledge_distillation(teacher, student, train_loader, epochs, learning_rate, T, soft_target_loss_weight, ce_l | CODE |
| LOW | .jenkins/download_data.py | 72 | def download_hymenoptera_data(): | CODE |
| LOW | .jenkins/download_data.py | 118 | def download_gpu_quantization_torchao() -> None: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | advanced_source/semi_structured_sparse.py | 541 | # zero-shot pruning, or pruning without fine-tuning / retraining. | COMMENT |
| MEDIUM | advanced_source/pendulum.py | 291 | # it (for example, in multi-agent settings we may want to indicate which agents need | COMMENT |
| MEDIUM | beginner_source/serving_tutorial.py | 184 | # number of CPUs or GPUs. Ray Serve handles the orchestration of these | COMMENT |
| MEDIUM | beginner_source/serving_tutorial.py | 340 | # to orchestrate multiple deployments into a single app. | COMMENT |
| MEDIUM | beginner_source/nlp/word_embeddings_tutorial.py | 295 | # :math:`N` context window on each side, :math:`w_{i-1}, \dots, w_{i-N}` | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | …rce/custom_classes/custom_class_project/custom_test.py | 19 | s.push("pushed") | CODE |
| HIGH | …rce/custom_classes/custom_class_project/custom_test.py | 23 | s.push("pushed") | CODE |
| HIGH | intermediate_source/reinforcement_q_learning.py | 447 | memory.push(state, action, next_state, reward) | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | advanced_source/neural_style_tutorial.py | 307 | CODE | |
| LOW | advanced_source/coding_ddpg.py | 247 | CODE | |
| LOW | advanced_source/semi_structured_sparse.py | 299 | CODE | |
| LOW | advanced_source/cuda_graph_annotations_tutorial.py | 597 | CODE | |
| LOW | intermediate_source/memory_format_tutorial.py | 304 | CODE | |
| LOW | beginner_source/transfer_learning_tutorial.py | 149 | CODE | |
| LOW | beginner_source/transfer_learning_tutorial.py | 227 | CODE | |
| LOW | beginner_source/nn_tutorial.py | 355 | CODE | |
| LOW | …inner_source/distributed_training_with_ray_tutorial.py | 295 | CODE | |
| LOW | .jenkins/custom_pandoc_filter.py | 5 | CODE | |
| LOW | .jenkins/custom_pandoc_filter.py | 29 | CODE | |
| LOW | .jenkins/custom_pandoc_filter.py | 101 | CODE | |
| LOW | .jenkins/remove_runnable_code.py | 8 | CODE | |
| LOW | .jenkins/insert_last_verified.py | 66 | CODE | |
| LOW | .jenkins/post_process_notebooks.py | 18 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | recipes_source/recipes/defining_a_neural_network.py | 151 | CODE | |
| LOW | advanced_source/pendulum.py | 273 | CODE | |
| LOW | advanced_source/pendulum.py | 345 | CODE | |
| LOW | intermediate_source/char_rnn_classification_tutorial.py | 254 | CODE | |
| LOW | intermediate_source/per_sample_grads.py | 45 | CODE | |
| LOW | intermediate_source/neural_tangent_kernels.py | 117 | CODE | |
| LOW | intermediate_source/neural_tangent_kernels.py | 152 | CODE | |
| LOW | beginner_source/fgsm_tutorial.py | 172 | CODE | |
| LOW | beginner_source/serving_tutorial.py | 166 | CODE | |
| LOW | …rce/onnx/export_control_flow_model_to_onnx_tutorial.py | 71 | CODE | |
| LOW | beginner_source/blitz/neural_networks_tutorial.py | 84 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | intermediate_source/pruning_tutorial.py | 372 | Prunes tensor corresponding to parameter called `name` in `module` by removing every other entry in the tensors. | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | beginner_source/serving_tutorial.py | 155 | async def handle_request(self, request: ImageRequest): | CODE |