tensorflow/models

View on GitHub

Showing 11,634 of 11,634 total issues

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

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

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

      def _instantiate_sub_tasks(self) -> Dict[Text, tf_keras.Model]:
        tasks = {}
    
        for model_config in self._config.heads:
          # Build supervised head
    Severity: Minor
    Found in official/projects/simclr/modeling/multitask_model.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 _process_segment_and_label has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    def _process_segment_and_label(video_matrix, num_frames, contexts,
                                   segment_labels, segment_size,
                                   num_classes) -> Dict[str, tf.Tensor]:
      """Processes a batched Tensor of frames.
    
    
    Severity: Minor
    Found in official/projects/yt8m/dataloaders/yt8m_input.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 call has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

      def call(
          self, inputs: tf.Tensor, num_frames: Any = None,
      ) -> tf.Tensor:
        # L2 normalize input features
        activation = tf.nn.l2_normalize(inputs, -1)
    Severity: Minor
    Found in official/projects/yt8m/modeling/backbones/dbof.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/teams/teams_pretrainer.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/pointpillars/tasks/pointpillars.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 call has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        def call(self,  # pytype: disable=signature-mismatch  # overriding-parameter-count-checks
      Severity: Minor
      Found in official/projects/pointpillars/modeling/models.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/yt8m/modeling/yt8m_model.py - About 45 mins to fix

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

            def call(self, inputs, training=None, **kwargs):  # pytype: disable=signature-mismatch  # overriding-parameter-count-checks
              model_outputs = {}
          
              if training and self._mode == PRETRAIN:
                num_transforms = 2
          Severity: Minor
          Found in official/projects/simclr/modeling/simclr_model.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 initialize has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

            def initialize(self, model: tf_keras.Model):
              """Loads pretrained checkpoint."""
              if not self.task_config.init_checkpoint:
                return
          
          
          Severity: Minor
          Found in official/projects/basnet/tasks/basnet.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 has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

            def build(self, input_specs: Mapping[str, tf.TensorShape]):
              self._decoder_output_level = int(min(input_specs.keys()))
              if self._config_dict['min_level'] < self._decoder_output_level:
                raise ValueError('The min_level should be >= decoder output '
                                 'level, but {} < {}'.format(
          Severity: Minor
          Found in official/projects/pointpillars/modeling/heads.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 _make_features has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

            def _make_features(self, stride_index: int, paragraph_texts: List[Text],
          Severity: Minor
          Found in official/projects/triviaqa/preprocess.py - About 45 mins to fix

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

            def _process_segment_and_label(video_matrix, num_frames, contexts,
            Severity: Minor
            Found in official/projects/yt8m/dataloaders/yt8m_input.py - About 45 mins to fix

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

              def color_jitter_nonrand(image,
              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__(self,
                Severity: Minor
                Found in official/projects/triviaqa/dataset.py - About 45 mins to fix

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

                    def generate_outputs(
                        self,
                        raw_scores: Dict[str, tf.Tensor],
                        raw_boxes: Dict[str, tf.Tensor],
                        raw_attributes: Dict[str, Dict[str, tf.Tensor]],
                  Severity: Minor
                  Found in official/projects/pointpillars/modeling/models.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 _parse_range_image_and_top_pose has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def _parse_range_image_and_top_pose(
                        self, frame: dataset_pb2.Frame
                    ) -> Tuple[Mapping[int, List[dataset_pb2.MatrixFloat]],
                               Optional[dataset_pb2.MatrixFloat]]:
                      """Parse range images and top pose given a frame.
                  Severity: Minor
                  Found in official/projects/pointpillars/utils/wod_processor.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_metrics has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def build_metrics(self, training: bool = True) -> List[tf.metrics.Metric]:
                      """Define metrics and how to calculate them."""
                      # train/validation loss metrics
                      loss_names = [
                          'class_loss', 'box_loss', 'attribute_loss', 'model_loss', 'total_loss'
                  Severity: Minor
                  Found in official/projects/pointpillars/tasks/pointpillars.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 generate_outputs has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                    def generate_outputs(
                  Severity: Minor
                  Found in official/projects/pointpillars/modeling/models.py - About 45 mins to fix

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

                    def color_jitter_rand(image,
                    Severity: Minor
                    Found in official/projects/simclr/dataloaders/preprocess_ops.py - About 45 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language