tensorflow/models

View on GitHub

Showing 11,634 of 11,634 total issues

Function call has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

  def call(self, x, enc, cache, mask_self, mask_cross, training):
Severity: Minor
Found in official/projects/pix2seq/modeling/transformer.py - About 45 mins to fix

    Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      def __init__(
    Severity: Minor
    Found in official/projects/detr/modeling/detr.py - About 45 mins to fix

      Function initialize has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

        def initialize(self, model: tf_keras.Model):
          """Loading pretrained checkpoint."""
          if not self._task_config.init_checkpoint:
            return
      
      
      Severity: Minor
      Found in official/projects/pix2seq/tasks/pix2seq_task.py - About 45 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function build_response_seq_from_bbox has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        def build_response_seq_from_bbox(
      Severity: Minor
      Found in official/projects/pix2seq/dataloaders/pix2seq_input.py - About 45 mins to fix

        Function single_stage_hourglass has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def single_stage_hourglass(input_channel_dims, channel_dims_per_stage,
        Severity: Minor
        Found in official/projects/deepmac_maskrcnn/modeling/heads/hourglass_network.py - About 45 mins to fix

          Function call has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

            def call(self,
                     target,
                     memory,
                     self_attention_mask=None,
                     cross_attention_mask=None,
          Severity: Minor
          Found in official/projects/detr/modeling/transformer.py - About 45 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function true_fn has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

            def true_fn(box, label, weight,
          Severity: Minor
          Found in official/projects/videoglue/datasets/common/utils.py - About 45 mins to fix

            Function test_network_creation has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

              def test_network_creation(self, input_size, model_id, endpoint_filter_scale,
            Severity: Minor
            Found in official/projects/const_cl/modeling/backbones/resnet_3d_test.py - About 45 mins to fix

              Function resize_and_pad has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def resize_and_pad(
              Severity: Minor
              Found in official/projects/videoglue/datasets/common/processors.py - About 45 mins to fix

                Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                  def __init__(
                Severity: Minor
                Found in official/projects/pix2seq/modeling/transformer.py - About 45 mins to fix

                  Function __init__ has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def __init__(
                        self,
                        dim,
                        mlp_ratio,
                        num_heads,
                  Severity: Minor
                  Found in official/projects/pix2seq/modeling/transformer.py - About 45 mins to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                    def __init__(self,
                  Severity: Minor
                  Found in official/projects/const_cl/modeling/heads/transformer_decoder.py - About 45 mins to fix

                    Function resize has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    def resize(feat,
                    Severity: Minor
                    Found in official/projects/edgetpu/vision/modeling/heads/bifpn_head.py - About 45 mins to fix

                      Function test_creation has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def test_creation(self, input_shape, filters, strides,
                                          use_transpose_conv):
                          kernel_size = 3
                          n, h, w, _ = input_shape
                          inputs = tf_keras.Input(shape=input_shape[1:], batch_size=n)
                      Severity: Minor
                      Found in official/projects/pointpillars/modeling/layers_test.py - About 45 mins to fix

                      Cognitive Complexity

                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                      A method's cognitive complexity is based on a few simple rules:

                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                      • Code is considered more complex for each "break in the linear flow of the code"
                      • Code is considered more complex when "flow breaking structures are nested"

                      Further reading

                      Function _get_video_matrix has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      def _get_video_matrix(features, feature_size, dtype, max_frames,
                      Severity: Minor
                      Found in official/projects/yt8m/dataloaders/yt8m_input.py - About 45 mins to fix

                        Function fit has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def fit(model,
                                strategy,
                                train_dataset,
                                model_dir,
                                init_checkpoint_path=None,
                        Severity: Minor
                        Found in official/projects/triviaqa/train.py - About 45 mins to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Function _pad_to_multiple has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        def _pad_to_multiple(tensor: tf.Tensor,
                        Severity: Minor
                        Found in official/projects/triviaqa/inputs.py - About 45 mins to fix

                          Function sample_k_from_softmax has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def sample_k_from_softmax(logits, k, disallow=None, use_topk=False):
                            """Implement softmax sampling using gumbel softmax trick to select k items.
                          
                            Args:
                              logits: A [batch_size, num_token_predictions, vocab_size] tensor indicating
                          Severity: Minor
                          Found in official/projects/teams/teams_pretrainer.py - About 45 mins to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Function apply_transform has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def apply_transform(i, x, brightness, contrast, saturation, hue):
                          Severity: Minor
                          Found in official/projects/simclr/dataloaders/preprocess_ops.py - About 45 mins to fix

                            Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                              def __init__(
                            Severity: Minor
                            Found in official/projects/simclr/heads/simclr_head.py - About 45 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language