tensorflow/models

View on GitHub
official/nlp/modeling/models/t5_test.py

Summary

Maintainability
F
6 days
Test Coverage

File t5_test.py has 714 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright 2024 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Severity: Major
Found in official/nlp/modeling/models/t5_test.py - About 1 day to fix

    Function test_transformer_with_lw_relpos has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      def test_transformer_with_lw_relpos(self, ffn_activations,
    Severity: Major
    Found in official/nlp/modeling/models/t5_test.py - About 50 mins to fix

      Function test_transformer_with_dense has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        def test_transformer_with_dense(self, ffn_activations, logits_via_embedding,
      Severity: Minor
      Found in official/nlp/modeling/models/t5_test.py - About 35 mins to fix

        Function test_transformer_with_dense_only has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          def test_transformer_with_dense_only(self, ffn_activations,
        Severity: Minor
        Found in official/nlp/modeling/models/t5_test.py - About 35 mins to fix

          Function test_transformer_different_num_decoder_layers has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

            def test_transformer_different_num_decoder_layers(self, ffn_activations,
          Severity: Minor
          Found in official/nlp/modeling/models/t5_test.py - About 35 mins to fix

            Function test_transformer has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

              def test_transformer(self, ffn_activations, logits_via_embedding,
            Severity: Minor
            Found in official/nlp/modeling/models/t5_test.py - About 35 mins to fix

              Function _create_cache has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def _create_cache(batch_size,
              Severity: Minor
              Found in official/nlp/modeling/models/t5_test.py - About 35 mins to fix

                Identical blocks of code found in 2 locations. Consider refactoring.
                Open

                    outputs = transformer.decode(
                        encoder_input_tokens=inputs,
                        encoder_dense_inputs=dense_inputs,
                        encoded=outputs["encoded"],
                        decoder_target_tokens=tf.ones((batch_size, 1), dtype=tf.int32),
                Severity: Major
                Found in official/nlp/modeling/models/t5_test.py and 1 other location - About 2 hrs to fix
                official/nlp/modeling/models/t5_test.py on lines 602..606

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 55.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 2 locations. Consider refactoring.
                Open

                    outputs = transformer.decode(
                        encoder_input_tokens=inputs,
                        encoder_dense_inputs=dense_inputs,
                        encoded=outputs["encoded"],
                        decoder_target_tokens=tf.ones((batch_size, 1), dtype=tf.int32),
                Severity: Major
                Found in official/nlp/modeling/models/t5_test.py and 1 other location - About 2 hrs to fix
                official/nlp/modeling/models/t5_test.py on lines 670..674

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 55.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 4 locations. Consider refactoring.
                Open

                    outputs = transformer.decode(
                        encoder_input_tokens=inputs,
                        encoded=outputs["encoded"],
                        decoder_target_tokens=tf.ones((batch_size, 1), dtype=tf.int32),
                Severity: Major
                Found in official/nlp/modeling/models/t5_test.py and 3 other locations - About 2 hrs to fix
                official/nlp/modeling/models/t5_test.py on lines 495..498
                official/nlp/modeling/models/t5_test.py on lines 722..725
                official/nlp/modeling/models/t5_test.py on lines 776..779

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 52.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 4 locations. Consider refactoring.
                Open

                    outputs = transformer.decode(
                        encoder_input_tokens=inputs,
                        encoded=outputs["encoded"],
                        decoder_target_tokens=tf.ones((batch_size, 1), dtype=tf.int32),
                Severity: Major
                Found in official/nlp/modeling/models/t5_test.py and 3 other locations - About 2 hrs to fix
                official/nlp/modeling/models/t5_test.py on lines 495..498
                official/nlp/modeling/models/t5_test.py on lines 551..554
                official/nlp/modeling/models/t5_test.py on lines 722..725

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 52.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 4 locations. Consider refactoring.
                Open

                    outputs = transformer.decode(
                        encoder_dense_inputs=dense_inputs,
                        encoded=outputs["encoded"],
                        decoder_target_tokens=tf.ones((batch_size, 1), dtype=tf.int32),
                Severity: Major
                Found in official/nlp/modeling/models/t5_test.py and 3 other locations - About 2 hrs to fix
                official/nlp/modeling/models/t5_test.py on lines 495..498
                official/nlp/modeling/models/t5_test.py on lines 551..554
                official/nlp/modeling/models/t5_test.py on lines 776..779

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 52.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 4 locations. Consider refactoring.
                Open

                    outputs = transformer.decode(
                        encoder_input_tokens=inputs,
                        encoded=outputs["encoded"],
                        decoder_target_tokens=tf.ones((batch_size, 1), dtype=tf.int32),
                Severity: Major
                Found in official/nlp/modeling/models/t5_test.py and 3 other locations - About 2 hrs to fix
                official/nlp/modeling/models/t5_test.py on lines 551..554
                official/nlp/modeling/models/t5_test.py on lines 722..725
                official/nlp/modeling/models/t5_test.py on lines 776..779

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 52.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 4 locations. Consider refactoring.
                Open

                    config = t5.T5TransformerParams(
                        num_layers=2,
                        d_model=4,
                        d_kv=3,
                        num_heads=4,
                Severity: Major
                Found in official/nlp/modeling/models/t5_test.py and 3 other locations - About 1 hr to fix
                official/nlp/modeling/models/t5_test.py on lines 344..352
                official/nlp/modeling/models/t5_test.py on lines 402..410
                official/nlp/modeling/models/t5_test.py on lines 417..425

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 46.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 4 locations. Consider refactoring.
                Open

                    config = t5.T5TransformerParams(
                        num_layers=2,
                        d_model=4,
                        d_kv=3,
                        num_heads=4,
                Severity: Major
                Found in official/nlp/modeling/models/t5_test.py and 3 other locations - About 1 hr to fix
                official/nlp/modeling/models/t5_test.py on lines 384..392
                official/nlp/modeling/models/t5_test.py on lines 402..410
                official/nlp/modeling/models/t5_test.py on lines 417..425

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 46.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 4 locations. Consider refactoring.
                Open

                    config = t5.T5TransformerParams(
                        num_layers=2,
                        d_model=4,
                        d_kv=3,
                        num_heads=4,
                Severity: Major
                Found in official/nlp/modeling/models/t5_test.py and 3 other locations - About 1 hr to fix
                official/nlp/modeling/models/t5_test.py on lines 344..352
                official/nlp/modeling/models/t5_test.py on lines 384..392
                official/nlp/modeling/models/t5_test.py on lines 417..425

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 46.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 4 locations. Consider refactoring.
                Open

                    config = t5.T5TransformerParams(
                        num_layers=2,
                        d_model=4,
                        d_kv=3,
                        num_heads=4,
                Severity: Major
                Found in official/nlp/modeling/models/t5_test.py and 3 other locations - About 1 hr to fix
                official/nlp/modeling/models/t5_test.py on lines 344..352
                official/nlp/modeling/models/t5_test.py on lines 384..392
                official/nlp/modeling/models/t5_test.py on lines 402..410

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 46.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 3 locations. Consider refactoring.
                Open

                    config = t5.T5TransformerParams(
                Severity: Major
                Found in official/nlp/modeling/models/t5_test.py and 2 other locations - About 1 hr to fix
                official/nlp/modeling/models/t5_test.py on lines 569..569
                official/nlp/modeling/models/t5_test.py on lines 691..691

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 40.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 3 locations. Consider refactoring.
                Open

                    config = t5.T5TransformerParams(
                Severity: Major
                Found in official/nlp/modeling/models/t5_test.py and 2 other locations - About 1 hr to fix
                official/nlp/modeling/models/t5_test.py on lines 467..467
                official/nlp/modeling/models/t5_test.py on lines 569..569

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 40.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 3 locations. Consider refactoring.
                Open

                    config = t5.T5TransformerParams(
                Severity: Major
                Found in official/nlp/modeling/models/t5_test.py and 2 other locations - About 1 hr to fix
                official/nlp/modeling/models/t5_test.py on lines 467..467
                official/nlp/modeling/models/t5_test.py on lines 691..691

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 40.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 2 locations. Consider refactoring.
                Open

                    for i in range(num_decoder_layers):
                      cache[i] = _create_cache(
                          batch_size,
                          max_decode_len,
                          config.num_heads,
                Severity: Minor
                Found in official/nlp/modeling/models/t5_test.py and 1 other location - About 50 mins to fix
                official/nlp/modeling/models/t5_test.py on lines 769..774

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 36.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 2 locations. Consider refactoring.
                Open

                    for i in range(num_decoder_layers):
                      cache[i] = _create_cache(
                          batch_size,
                          max_decode_len,
                          config.num_heads,
                Severity: Minor
                Found in official/nlp/modeling/models/t5_test.py and 1 other location - About 50 mins to fix
                official/nlp/modeling/models/t5_test.py on lines 663..668

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 36.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 12 locations. Consider refactoring.
                Open

                    inputs = tf.convert_to_tensor(
                        np.array([[2, 2, 1, 3, 1, 0], [3, 3, 1, 2, 2, 1]])
                Severity: Major
                Found in official/nlp/modeling/models/t5_test.py and 11 other locations - About 40 mins to fix
                official/nlp/modeling/models/t5_test.py on lines 480..481
                official/nlp/modeling/models/t5_test.py on lines 482..483
                official/nlp/modeling/models/t5_test.py on lines 528..529
                official/nlp/modeling/models/t5_test.py on lines 583..584
                official/nlp/modeling/models/t5_test.py on lines 585..586
                official/nlp/modeling/models/t5_test.py on lines 646..647
                official/nlp/modeling/models/t5_test.py on lines 648..649
                official/nlp/modeling/models/t5_test.py on lines 705..706
                official/nlp/modeling/models/t5_test.py on lines 707..708
                official/nlp/modeling/models/t5_test.py on lines 756..757
                official/nlp/modeling/models/t5_test.py on lines 758..759

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 34.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 12 locations. Consider refactoring.
                Open

                    segments = tf.convert_to_tensor(
                        np.array([[1, 1, 1, 2, 2, 0], [1, 1, 1, 2, 2, 2]])
                Severity: Major
                Found in official/nlp/modeling/models/t5_test.py and 11 other locations - About 40 mins to fix
                official/nlp/modeling/models/t5_test.py on lines 480..481
                official/nlp/modeling/models/t5_test.py on lines 482..483
                official/nlp/modeling/models/t5_test.py on lines 525..526
                official/nlp/modeling/models/t5_test.py on lines 583..584
                official/nlp/modeling/models/t5_test.py on lines 585..586
                official/nlp/modeling/models/t5_test.py on lines 646..647
                official/nlp/modeling/models/t5_test.py on lines 648..649
                official/nlp/modeling/models/t5_test.py on lines 705..706
                official/nlp/modeling/models/t5_test.py on lines 707..708
                official/nlp/modeling/models/t5_test.py on lines 756..757
                official/nlp/modeling/models/t5_test.py on lines 758..759

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 34.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 12 locations. Consider refactoring.
                Open

                    segments = tf.convert_to_tensor(
                        np.array([[1, 1, 1, 2, 2, 0], [1, 1, 1, 2, 2, 2]]))
                Severity: Major
                Found in official/nlp/modeling/models/t5_test.py and 11 other locations - About 40 mins to fix
                official/nlp/modeling/models/t5_test.py on lines 480..481
                official/nlp/modeling/models/t5_test.py on lines 482..483
                official/nlp/modeling/models/t5_test.py on lines 525..526
                official/nlp/modeling/models/t5_test.py on lines 528..529
                official/nlp/modeling/models/t5_test.py on lines 583..584
                official/nlp/modeling/models/t5_test.py on lines 585..586
                official/nlp/modeling/models/t5_test.py on lines 646..647
                official/nlp/modeling/models/t5_test.py on lines 705..706
                official/nlp/modeling/models/t5_test.py on lines 707..708
                official/nlp/modeling/models/t5_test.py on lines 756..757
                official/nlp/modeling/models/t5_test.py on lines 758..759

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 34.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 12 locations. Consider refactoring.
                Open

                    inputs = tf.convert_to_tensor(
                        np.array([[2, 2, 1, 3, 1, 0], [3, 3, 1, 2, 2, 1]]))
                Severity: Major
                Found in official/nlp/modeling/models/t5_test.py and 11 other locations - About 40 mins to fix
                official/nlp/modeling/models/t5_test.py on lines 480..481
                official/nlp/modeling/models/t5_test.py on lines 482..483
                official/nlp/modeling/models/t5_test.py on lines 525..526
                official/nlp/modeling/models/t5_test.py on lines 528..529
                official/nlp/modeling/models/t5_test.py on lines 583..584
                official/nlp/modeling/models/t5_test.py on lines 585..586
                official/nlp/modeling/models/t5_test.py on lines 646..647
                official/nlp/modeling/models/t5_test.py on lines 648..649
                official/nlp/modeling/models/t5_test.py on lines 705..706
                official/nlp/modeling/models/t5_test.py on lines 707..708
                official/nlp/modeling/models/t5_test.py on lines 758..759

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 34.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 12 locations. Consider refactoring.
                Open

                    inputs = tf.convert_to_tensor(
                        np.array([[2, 2, 1, 3, 1, 0], [3, 3, 1, 2, 2, 1]]))
                Severity: Major
                Found in official/nlp/modeling/models/t5_test.py and 11 other locations - About 40 mins to fix
                official/nlp/modeling/models/t5_test.py on lines 480..481
                official/nlp/modeling/models/t5_test.py on lines 482..483
                official/nlp/modeling/models/t5_test.py on lines 525..526
                official/nlp/modeling/models/t5_test.py on lines 528..529
                official/nlp/modeling/models/t5_test.py on lines 583..584
                official/nlp/modeling/models/t5_test.py on lines 585..586
                official/nlp/modeling/models/t5_test.py on lines 648..649
                official/nlp/modeling/models/t5_test.py on lines 705..706
                official/nlp/modeling/models/t5_test.py on lines 707..708
                official/nlp/modeling/models/t5_test.py on lines 756..757
                official/nlp/modeling/models/t5_test.py on lines 758..759

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 34.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 12 locations. Consider refactoring.
                Open

                    decoder_segments = tf.convert_to_tensor(
                        np.array([[1, 1, 1, 2, 2, 0], [1, 1, 1, 2, 2, 2]]))
                Severity: Major
                Found in official/nlp/modeling/models/t5_test.py and 11 other locations - About 40 mins to fix
                official/nlp/modeling/models/t5_test.py on lines 480..481
                official/nlp/modeling/models/t5_test.py on lines 482..483
                official/nlp/modeling/models/t5_test.py on lines 525..526
                official/nlp/modeling/models/t5_test.py on lines 528..529
                official/nlp/modeling/models/t5_test.py on lines 583..584
                official/nlp/modeling/models/t5_test.py on lines 585..586
                official/nlp/modeling/models/t5_test.py on lines 646..647
                official/nlp/modeling/models/t5_test.py on lines 648..649
                official/nlp/modeling/models/t5_test.py on lines 705..706
                official/nlp/modeling/models/t5_test.py on lines 756..757
                official/nlp/modeling/models/t5_test.py on lines 758..759

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 34.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 12 locations. Consider refactoring.
                Open

                    segments = tf.convert_to_tensor(
                        np.array([[1, 1, 1, 2, 2, 0], [1, 1, 1, 2, 2, 2]]))
                Severity: Major
                Found in official/nlp/modeling/models/t5_test.py and 11 other locations - About 40 mins to fix
                official/nlp/modeling/models/t5_test.py on lines 480..481
                official/nlp/modeling/models/t5_test.py on lines 482..483
                official/nlp/modeling/models/t5_test.py on lines 525..526
                official/nlp/modeling/models/t5_test.py on lines 528..529
                official/nlp/modeling/models/t5_test.py on lines 583..584
                official/nlp/modeling/models/t5_test.py on lines 646..647
                official/nlp/modeling/models/t5_test.py on lines 648..649
                official/nlp/modeling/models/t5_test.py on lines 705..706
                official/nlp/modeling/models/t5_test.py on lines 707..708
                official/nlp/modeling/models/t5_test.py on lines 756..757
                official/nlp/modeling/models/t5_test.py on lines 758..759

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 34.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 12 locations. Consider refactoring.
                Open

                    inputs = tf.convert_to_tensor(
                        np.array([[2, 2, 1, 3, 1, 0], [3, 3, 1, 2, 2, 1]]))
                Severity: Major
                Found in official/nlp/modeling/models/t5_test.py and 11 other locations - About 40 mins to fix
                official/nlp/modeling/models/t5_test.py on lines 482..483
                official/nlp/modeling/models/t5_test.py on lines 525..526
                official/nlp/modeling/models/t5_test.py on lines 528..529
                official/nlp/modeling/models/t5_test.py on lines 583..584
                official/nlp/modeling/models/t5_test.py on lines 585..586
                official/nlp/modeling/models/t5_test.py on lines 646..647
                official/nlp/modeling/models/t5_test.py on lines 648..649
                official/nlp/modeling/models/t5_test.py on lines 705..706
                official/nlp/modeling/models/t5_test.py on lines 707..708
                official/nlp/modeling/models/t5_test.py on lines 756..757
                official/nlp/modeling/models/t5_test.py on lines 758..759

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 34.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 12 locations. Consider refactoring.
                Open

                    segments = tf.convert_to_tensor(
                        np.array([[1, 1, 1, 2, 2, 0], [1, 1, 1, 2, 2, 2]]))
                Severity: Major
                Found in official/nlp/modeling/models/t5_test.py and 11 other locations - About 40 mins to fix
                official/nlp/modeling/models/t5_test.py on lines 480..481
                official/nlp/modeling/models/t5_test.py on lines 525..526
                official/nlp/modeling/models/t5_test.py on lines 528..529
                official/nlp/modeling/models/t5_test.py on lines 583..584
                official/nlp/modeling/models/t5_test.py on lines 585..586
                official/nlp/modeling/models/t5_test.py on lines 646..647
                official/nlp/modeling/models/t5_test.py on lines 648..649
                official/nlp/modeling/models/t5_test.py on lines 705..706
                official/nlp/modeling/models/t5_test.py on lines 707..708
                official/nlp/modeling/models/t5_test.py on lines 756..757
                official/nlp/modeling/models/t5_test.py on lines 758..759

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 34.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 12 locations. Consider refactoring.
                Open

                    decoder_inputs = tf.convert_to_tensor(
                        np.array([[2, 2, 1, 3, 1, 0], [3, 3, 1, 2, 2, 1]]))
                Severity: Major
                Found in official/nlp/modeling/models/t5_test.py and 11 other locations - About 40 mins to fix
                official/nlp/modeling/models/t5_test.py on lines 480..481
                official/nlp/modeling/models/t5_test.py on lines 482..483
                official/nlp/modeling/models/t5_test.py on lines 525..526
                official/nlp/modeling/models/t5_test.py on lines 528..529
                official/nlp/modeling/models/t5_test.py on lines 583..584
                official/nlp/modeling/models/t5_test.py on lines 585..586
                official/nlp/modeling/models/t5_test.py on lines 646..647
                official/nlp/modeling/models/t5_test.py on lines 648..649
                official/nlp/modeling/models/t5_test.py on lines 707..708
                official/nlp/modeling/models/t5_test.py on lines 756..757
                official/nlp/modeling/models/t5_test.py on lines 758..759

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 34.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 12 locations. Consider refactoring.
                Open

                    inputs = tf.convert_to_tensor(
                        np.array([[2, 2, 1, 3, 1, 0], [3, 3, 1, 2, 2, 1]]))
                Severity: Major
                Found in official/nlp/modeling/models/t5_test.py and 11 other locations - About 40 mins to fix
                official/nlp/modeling/models/t5_test.py on lines 480..481
                official/nlp/modeling/models/t5_test.py on lines 482..483
                official/nlp/modeling/models/t5_test.py on lines 525..526
                official/nlp/modeling/models/t5_test.py on lines 528..529
                official/nlp/modeling/models/t5_test.py on lines 585..586
                official/nlp/modeling/models/t5_test.py on lines 646..647
                official/nlp/modeling/models/t5_test.py on lines 648..649
                official/nlp/modeling/models/t5_test.py on lines 705..706
                official/nlp/modeling/models/t5_test.py on lines 707..708
                official/nlp/modeling/models/t5_test.py on lines 756..757
                official/nlp/modeling/models/t5_test.py on lines 758..759

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 34.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 12 locations. Consider refactoring.
                Open

                    segments = tf.convert_to_tensor(
                        np.array([[1, 1, 1, 2, 2, 0], [1, 1, 1, 2, 2, 2]]))
                Severity: Major
                Found in official/nlp/modeling/models/t5_test.py and 11 other locations - About 40 mins to fix
                official/nlp/modeling/models/t5_test.py on lines 480..481
                official/nlp/modeling/models/t5_test.py on lines 482..483
                official/nlp/modeling/models/t5_test.py on lines 525..526
                official/nlp/modeling/models/t5_test.py on lines 528..529
                official/nlp/modeling/models/t5_test.py on lines 583..584
                official/nlp/modeling/models/t5_test.py on lines 585..586
                official/nlp/modeling/models/t5_test.py on lines 646..647
                official/nlp/modeling/models/t5_test.py on lines 648..649
                official/nlp/modeling/models/t5_test.py on lines 705..706
                official/nlp/modeling/models/t5_test.py on lines 707..708
                official/nlp/modeling/models/t5_test.py on lines 756..757

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 34.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                    l = t5.Linear3D(
                        in_features=4,
                        out_features=4,
                        num_heads=2,
                        to_3d=True,
                Severity: Minor
                Found in official/nlp/modeling/models/t5_test.py and 1 other location - About 40 mins to fix
                official/nlp/modeling/models/t5_test.py on lines 105..110

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 34.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                    l = t5.Linear3D(
                        in_features=2,
                        out_features=4,
                        num_heads=2,
                        to_3d=False,
                Severity: Minor
                Found in official/nlp/modeling/models/t5_test.py and 1 other location - About 40 mins to fix
                official/nlp/modeling/models/t5_test.py on lines 95..100

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 34.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                There are no issues that match your filters.

                Category
                Status