Showing 11,634 of 11,634 total issues
Function _word_span_mask
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Function train_and_eval
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
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.')
Function construct_model
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def construct_model(user_input: tf.Tensor, item_input: tf.Tensor,
params: Dict[Text, Any]) -> tf_keras.Model:
"""Initialize NeuMF model.
Args:
Function test_keras_model_checkpoint_forward_compatible
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def test_keras_model_checkpoint_forward_compatible(self):
batch_size = 3
hidden_size = 32
sequence_length = 21
Function get_boxes
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def get_boxes(self,
y_indices: tf.Tensor,
x_indices: tf.Tensor,
channel_indices: tf.Tensor,
height_width_predictions: tf.Tensor,
Function __init__
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def __init__(
self,
vocab_size: int,
hidden_size: int = 768,
num_layers: int = 12,
Function build_response_seq_from_bbox
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def build_response_seq_from_bbox(
self,
bbox,
label,
coord_vocab_shift,
Function __init__
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def __init__(
self,
variant: str = 'native',
mlp_dim: int = 3072,
num_heads: int = 12,
Function compute_losses
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def compute_losses(
self,
outputs: Mapping[str, Any],
labels: Mapping[str, Any],
aux_losses: Optional[Any] = None) -> Mapping[str, float]:
Function test_export_file_manager_with_suffix
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Function test_task
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
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(
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, config, is_token_level, words, original_tags,
Function CreateDataset
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def CreateDataset(mode, data_root, imsize=None, num_negatives=5,
Function ExtractLocalAndGlobalFeatures
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def ExtractLocalAndGlobalFeatures(image, image_scales, max_feature_num,
Function ExtractBoxesAndFeaturesToFiles
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def ExtractBoxesAndFeaturesToFiles(image_names, image_paths, delf_config_path,
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, mode, data_root, imsize=None, num_negatives=5,
Function _xception_small
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _xception_small(self,
Function bottleneck
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def bottleneck(inputs,
Function _panoptic_quality_helper
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _panoptic_quality_helper(
Function _resnet_small
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _resnet_small(self,