pytorch / tutorials
Duplication

Places in code with 6 or more lines that are exactly the same.

Intro
  • For duplication, we look at places in code where there are 6 or more lines of code that are exactly the same.
  • Before duplication is calculated, the code is cleaned to remove empty lines, comments, and frequently duplicated constructs such as imports.
  • You should aim at having as little as possible (<5%) of duplicated code as high-level of duplication can lead to maintenance difficulties, poor factoring, and logical contradictions.
Learn more...
Duplication Overall
  • 16% duplication:
    • 14,426 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 2,339 duplicated lines
  • 211 duplicates
system16% (2,339 lines)
Duplication per Extension
py20% (2,327 lines)
js<1% (12 lines)
Duplication per Component (primary)
beginner_source24% (792 lines)
intermediate_source9% (297 lines)
recipes_source/recipes34% (295 lines)
advanced_source40% (241 lines)
beginner_source/introyt20% (180 lines)
prototype_source42% (164 lines)
beginner_source/basics40% (156 lines)
beginner_source/blitz34% (85 lines)
beginner_source/examples_nn30% (30 lines)
beginner_source/examples_autograd43% (26 lines)
beginner_source/examples_tensor47% (22 lines)
ROOT7% (21 lines)
beginner_source/nlp4% (18 lines)
_static<1% (12 lines)
advanced_source/dispatcher0% (0 lines)
advanced_source/torch_script_custom_classes0% (0 lines)
advanced_source/torch_script_custom_ops0% (0 lines)
advanced_source/transformer__timeseries_cpp_tutorial0% (0 lines)
advanced_source/rpc_ddp_tutorial0% (0 lines)
_templates0% (0 lines)
_static/css0% (0 lines)
beginner_source/former_torchies0% (0 lines)
beginner_source/hybrid_frontend0% (0 lines)

Duplication Between Components (50+ lines)

G advanced_source advanced_source intermediate_source intermediate_source advanced_source--intermediate_source 250 prototype_source prototype_source advanced_source--prototype_source 246 beginner_source/introyt beginner_source/introyt recipes_source/recipes recipes_source/recipes beginner_source/introyt--recipes_source/recipes 234 beginner_source/blitz beginner_source/blitz beginner_source/blitz--beginner_source/introyt 106 beginner_source/blitz--recipes_source/recipes 147 beginner_source beginner_source beginner_source--intermediate_source 72 beginner_source--recipes_source/recipes 84 beginner_source/basics beginner_source/basics beginner_source/basics--beginner_source/blitz 56

Download: SVG DOT (open online Graphviz editor)

Open 3D force graph...

Show more details on duplication between components...
Longest Duplicates
The list of 20 longest duplicates.
See data for all 211 duplicates...
Size#FoldersFilesLinesCode
58 x 2 beginner_source
beginner_source
chatbot_tutorial.py
deploy_seq2seq_hybrid_frontend_tutori...
689:873 (12%)
309:437 (27%)
view
39 x 2 beginner_source
beginner_source
chatbot_tutorial.py
deploy_seq2seq_hybrid_frontend_tutori...
280:329 (8%)
123:236 (18%)
view
35 x 2 beginner_source/introyt
recipes_source/recipes
introyt1_tutorial.py
zeroing_out_gradients.py
463:533 (22%)
110:177 (72%)
view
34 x 2 advanced_source
prototype_source
dynamic_quantization_tutorial.py
fx_graph_mode_ptq_dynamic.py
105:159 (23%)
133:178 (24%)
view
26 x 2 advanced_source
intermediate_source
ddp_pipeline.py
pipeline_tutorial.py
87:120 (13%)
54:87 (14%)
view
26 x 2 beginner_source
beginner_source
audio_feature_augmentation_tutorial.py
audio_feature_extractions_tutorial.py
15:70 (35%)
33:90 (10%)
view
24 x 2 beginner_source
beginner_source
audio_data_augmentation_tutorial.py
audio_datasets_tutorial.py
128:155 (12%)
53:80 (58%)
view
24 x 2 beginner_source
beginner_source
audio_datasets_tutorial.py
audio_io_tutorial.py
53:80 (58%)
118:145 (13%)
view
24 x 2 beginner_source
beginner_source
audio_data_augmentation_tutorial.py
audio_io_tutorial.py
128:155 (12%)
118:145 (13%)
view
21 x 2 advanced_source
prototype_source
dynamic_quantization_tutorial.py
fx_graph_mode_ptq_dynamic.py
40:66 (14%)
68:94 (15%)
view
21 x 2 advanced_source
prototype_source
dynamic_quantization_tutorial.py
fx_graph_mode_ptq_dynamic.py
197:230 (14%)
180:213 (15%)
view
20 x 2 recipes_source/recipes
recipes_source/recipes
saving_and_loading_models_for_inferen...
what_is_state_dict.py
72:102 (68%)
66:96 (74%)
view
20 x 2 recipes_source/recipes
recipes_source/recipes
saving_and_loading_a_general_checkpoi...
what_is_state_dict.py
70:100 (52%)
66:96 (74%)
view
20 x 2 recipes_source/recipes
recipes_source/recipes
saving_and_loading_a_general_checkpoi...
saving_and_loading_models_for_inferen...
70:100 (52%)
72:102 (68%)
view
19 x 2 recipes_source/recipes
recipes_source/recipes
save_load_across_devices.py
what_is_state_dict.py
60:80 (54%)
66:86 (70%)
view
19 x 2 recipes_source/recipes
recipes_source/recipes
save_load_across_devices.py
saving_and_loading_a_general_checkpoi...
60:80 (54%)
70:90 (50%)
view
19 x 2 recipes_source/recipes
recipes_source/recipes
benchmark.py
benchmark.py
574:593 (8%)
629:648 (8%)
view
19 x 2 recipes_source/recipes
recipes_source/recipes
save_load_across_devices.py
saving_and_loading_models_for_inferen...
60:80 (54%)
72:92 (65%)
view
18 x 2 recipes_source/recipes
recipes_source/recipes
what_is_state_dict.py
zeroing_out_gradients.py
66:85 (66%)
110:137 (37%)
view
18 x 2 beginner_source/introyt
recipes_source/recipes
introyt1_tutorial.py
saving_and_loading_models_for_inferen...
463:483 (11%)
72:91 (62%)
view
Duplicated Units
The list of top 20 duplicated units.
See data for all 26 unit duplicates...
Size#FoldersFilesLinesCode
17 x 3 beginner_source
beginner_source
beginner_source
audio_io_tutorial.py
audio_feature_extractions_tutorial.py
audio_data_augmentation_tutorial.py
0:0 
0:0 
0:0 
view
19 x 2 advanced_source
prototype_source
dynamic_quantization_tutorial.py
fx_graph_mode_ptq_dynamic.py
0:0 
0:0 
view
17 x 2 beginner_source
beginner_source
chatbot_tutorial.py
deploy_seq2seq_hybrid_frontend_tutori...
0:0 
0:0 
view
15 x 3 beginner_source
beginner_source
beginner_source
audio_io_tutorial.py
audio_feature_extractions_tutorial.py
audio_data_augmentation_tutorial.py
0:0 
0:0 
0:0 
view
14 x 4 beginner_source
beginner_source
beginner_source
beginner_source
audio_resampling_tutorial.py
audio_io_tutorial.py
audio_datasets_tutorial.py
audio_data_augmentation_tutorial.py
0:0 
0:0 
0:0 
0:0 
view
14 x 2 beginner_source
beginner_source
chatbot_tutorial.py
deploy_seq2seq_hybrid_frontend_tutori...
0:0 
0:0 
view
20 x 2 beginner_source
beginner_source
chatbot_tutorial.py
deploy_seq2seq_hybrid_frontend_tutori...
0:0 
0:0 
view
10 x 2 beginner_source
beginner_source
chatbot_tutorial.py
deploy_seq2seq_hybrid_frontend_tutori...
0:0 
0:0 
view
9 x 2 advanced_source
intermediate_source
ddp_pipeline.py
pipeline_tutorial.py
0:0 
0:0 
view
9 x 2 beginner_source/basics
beginner_source/basics
buildmodel_tutorial.py
optimization_tutorial.py
0:0 
0:0 
view
9 x 4 beginner_source
beginner_source
beginner_source
beginner_source
audio_io_tutorial.py
audio_feature_augmentation_tutorial.py
audio_feature_extractions_tutorial.py
audio_data_augmentation_tutorial.py
0:0 
0:0 
0:0 
0:0 
view
9 x 2 beginner_source
beginner_source
audio_feature_augmentation_tutorial.py
audio_feature_extractions_tutorial.py
0:0 
0:0 
view
8 x 2 advanced_source
prototype_source
dynamic_quantization_tutorial.py
fx_graph_mode_ptq_dynamic.py
0:0 
0:0 
view
8 x 2 beginner_source/basics
beginner_source/basics
data_tutorial.py
data_tutorial.py
0:0 
0:0 
view
8 x 2 beginner_source/introyt
beginner_source/introyt
trainingyt.py
tensorboardyt_tutorial.py
0:0 
0:0 
view
11 x 2 beginner_source
beginner_source
chatbot_tutorial.py
deploy_seq2seq_hybrid_frontend_tutori...
0:0 
0:0 
view
8 x 5 beginner_source
beginner_source
beginner_source
beginner_source
beginner_source
audio_resampling_tutorial.py
audio_io_tutorial.py
audio_feature_extractions_tutorial.py
audio_datasets_tutorial.py
audio_data_augmentation_tutorial.py
0:0 
0:0 
0:0 
0:0 
0:0 
view
7 x 7 recipes_source/recipes
recipes_source/recipes
recipes_source/recipes
recipes_source/recipes
recipes_source/recipes
recipes_source/recipes
beginner_source/introyt
saving_and_loading_models_for_inferen...
zeroing_out_gradients.py
saving_and_loading_a_general_checkpoi...
saving_multiple_models_in_one_file.py
what_is_state_dict.py
save_load_across_devices.py
introyt1_tutorial.py
0:0 
0:0 
0:0 
0:0 
0:0 
0:0 
0:0 
view
7 x 9 recipes_source/recipes
recipes_source/recipes
recipes_source/recipes
recipes_source/recipes
recipes_source/recipes
recipes_source/recipes
recipes_source/recipes
beginner_source/introyt
beginner_source
saving_and_loading_models_for_inferen...
zeroing_out_gradients.py
saving_and_loading_a_general_checkpoi...
saving_multiple_models_in_one_file.py
what_is_state_dict.py
save_load_across_devices.py
warmstarting_model_using_parameters_f...
introyt1_tutorial.py
hyperparameter_tuning_tutorial.py
0:0 
0:0 
0:0 
0:0 
0:0 
0:0 
0:0 
0:0 
0:0 
view
9 x 2 beginner_source/introyt
beginner_source/introyt
modelsyt_tutorial.py
introyt1_tutorial.py
0:0 
0:0 
view