tensorflow/models

View on GitHub

Showing 11,634 of 11,634 total issues

Function _word_span_mask has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def _word_span_mask(inputs, tgt_len, num_predict, min_num_words, max_num_words,
                    boundary):
  """Sample whole word spans as prediction targets."""
  # Note: 1.2 is the token-to-word ratio
  mask_alpha = tgt_len / num_predict / 1.2
Severity: Minor
Found in official/legacy/xlnet/data_utils.py - About 1 hr to fix

    Function train_and_eval has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def train_and_eval(
        params: base_configs.ExperimentConfig,
        strategy_override: tf.distribute.Strategy) -> Mapping[str, Any]:
      """Runs the train and eval path using compile/fit."""
      logging.info('Running train and eval.')
    Severity: Minor
    Found in official/legacy/image_classification/classifier_trainer.py - About 1 hr to fix

      Function construct_model has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def construct_model(user_input: tf.Tensor, item_input: tf.Tensor,
                          params: Dict[Text, Any]) -> tf_keras.Model:
        """Initialize NeuMF model.
      
        Args:
      Severity: Minor
      Found in official/recommendation/neumf_model.py - About 1 hr to fix

        Function test_keras_model_checkpoint_forward_compatible has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def test_keras_model_checkpoint_forward_compatible(self):
            batch_size = 3
        
            hidden_size = 32
            sequence_length = 21
        Severity: Minor
        Found in official/projects/token_dropping/encoder_test.py - About 1 hr to fix

          Function get_boxes has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def get_boxes(self,
                          y_indices: tf.Tensor,
                          x_indices: tf.Tensor,
                          channel_indices: tf.Tensor,
                          height_width_predictions: tf.Tensor,
          Severity: Minor
          Found in official/projects/centernet/modeling/layers/detection_generator.py - About 1 hr to fix

            Function __init__ has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def __init__(
                  self,
                  vocab_size: int,
                  hidden_size: int = 768,
                  num_layers: int = 12,
            Severity: Minor
            Found in official/projects/fffner/fffner_encoder.py - About 1 hr to fix

              Function build_response_seq_from_bbox has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def build_response_seq_from_bbox(
                    self,
                    bbox,
                    label,
                    coord_vocab_shift,
              Severity: Minor
              Found in official/projects/pix2seq/dataloaders/pix2seq_input.py - About 1 hr to fix

                Function __init__ has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def __init__(
                      self,
                      variant: str = 'native',
                      mlp_dim: int = 3072,
                      num_heads: int = 12,
                Severity: Minor
                Found in official/projects/videoglue/modeling/backbones/vit_3d.py - About 1 hr to fix

                  Function compute_losses has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def compute_losses(
                        self,
                        outputs: Mapping[str, Any],
                        labels: Mapping[str, Any],
                        aux_losses: Optional[Any] = None) -> Mapping[str, float]:
                  Severity: Minor
                  Found in official/projects/pointpillars/tasks/pointpillars.py - About 1 hr to fix

                    Function test_export_file_manager_with_suffix has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def test_export_file_manager_with_suffix(self):
                        directory = self.create_tempdir()
                        base_name = os.path.join(directory.full_path, 'basename')
                    
                        id_num = 0
                    Severity: Minor
                    Found in orbit/actions/export_saved_model_test.py - About 1 hr to fix

                      Function test_task has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def test_task(self, config_name):
                          input_image_size = [224, 224]
                          test_tfrecord_file = os.path.join(self.get_temp_dir(), 'cls_test.tfrecord')
                          example = tf.train.Example.FromString(
                              tfexample_utils.create_classification_example(
                      Severity: Minor
                      Found in official/projects/qat/vision/tasks/image_classification_test.py - About 1 hr to fix

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

                          def __init__(self, config, is_token_level, words, original_tags,
                        Severity: Major
                        Found in research/cvt_text/task_specific/word_level/word_level_data.py - About 1 hr to fix

                          Function CreateDataset has 8 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          def CreateDataset(mode, data_root, imsize=None, num_negatives=5,
                          Severity: Major
                          Found in research/delf/delf/python/datasets/sfm120k/sfm120k.py - About 1 hr to fix

                            Function ExtractLocalAndGlobalFeatures has 8 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                            def ExtractLocalAndGlobalFeatures(image, image_scales, max_feature_num,
                            Severity: Major
                            Found in research/delf/delf/python/training/model/export_model_utils.py - About 1 hr to fix

                              Function ExtractBoxesAndFeaturesToFiles has 8 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                              def ExtractBoxesAndFeaturesToFiles(image_names, image_paths, delf_config_path,

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

                                  def __init__(self, mode, data_root, imsize=None, num_negatives=5,
                                Severity: Major
                                Found in research/delf/delf/python/datasets/sfm120k/sfm120k.py - About 1 hr to fix

                                  Function _xception_small has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                    def _xception_small(self,
                                  Severity: Major
                                  Found in research/deeplab/core/xception_test.py - About 1 hr to fix

                                    Function bottleneck has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                    def bottleneck(inputs,
                                    Severity: Major
                                    Found in research/deeplab/core/resnet_v1_beta.py - About 1 hr to fix

                                      Function _panoptic_quality_helper has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                      def _panoptic_quality_helper(
                                      Severity: Major
                                      Found in research/deeplab/evaluation/streaming_metrics.py - About 1 hr to fix

                                        Function _resnet_small has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                        Open

                                          def _resnet_small(self,
                                        Severity: Major
                                        Found in research/deeplab/core/resnet_v1_beta_test.py - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language