fairseq/tasks/fairseq_task.py

Killed 1 out of 19 mutants

Survived

Survived mutation testing. These mutants show holes in your test suite.

Mutant 717

--- fairseq/tasks/fairseq_task.py
+++ fairseq/tasks/fairseq_task.py
@@ -17,7 +17,6 @@
     Datasets, initializing the Model/Criterion and calculating the loss.
     """
 
-    @staticmethod
     def add_args(parser):
         """Add task-specific arguments to the parser."""
         pass

Mutant 718

--- fairseq/tasks/fairseq_task.py
+++ fairseq/tasks/fairseq_task.py
@@ -22,7 +22,6 @@
         """Add task-specific arguments to the parser."""
         pass
 
-    @staticmethod
     def logging_outputs_can_be_summed(criterion) -> bool:
         """
         Whether the logging outputs returned by `train_step` and `valid_step` can

Mutant 719

--- fairseq/tasks/fairseq_task.py
+++ fairseq/tasks/fairseq_task.py
@@ -32,7 +32,7 @@
         return criterion.logging_outputs_can_be_summed()
 
     def __init__(self, args):
-        self.args = args
+        self.args = None
         self.datasets = {}
         self.dataset_to_epoch_iter = {}
 

Mutant 720

--- fairseq/tasks/fairseq_task.py
+++ fairseq/tasks/fairseq_task.py
@@ -33,7 +33,7 @@
 
     def __init__(self, args):
         self.args = args
-        self.datasets = {}
+        self.datasets = None
         self.dataset_to_epoch_iter = {}
 
     @classmethod

Mutant 721

--- fairseq/tasks/fairseq_task.py
+++ fairseq/tasks/fairseq_task.py
@@ -34,7 +34,7 @@
     def __init__(self, args):
         self.args = args
         self.datasets = {}
-        self.dataset_to_epoch_iter = {}
+        self.dataset_to_epoch_iter = None
 
     @classmethod
     def load_dictionary(cls, filename):

Mutant 722

--- fairseq/tasks/fairseq_task.py
+++ fairseq/tasks/fairseq_task.py
@@ -36,7 +36,6 @@
         self.datasets = {}
         self.dataset_to_epoch_iter = {}
 
-    @classmethod
     def load_dictionary(cls, filename):
         """Load the dictionary from the filename
 

Mutant 723

--- fairseq/tasks/fairseq_task.py
+++ fairseq/tasks/fairseq_task.py
@@ -45,7 +45,6 @@
         """
         return Dictionary.load(filename)
 
-    @classmethod
     def build_dictionary(
         cls, filenames, workers=1, threshold=-1, nwords=-1, padding_factor=8
     ):

Mutant 724

--- fairseq/tasks/fairseq_task.py
+++ fairseq/tasks/fairseq_task.py
@@ -47,7 +47,7 @@
 
     @classmethod
     def build_dictionary(
-        cls, filenames, workers=1, threshold=-1, nwords=-1, padding_factor=8
+        cls, filenames, workers=2, threshold=-1, nwords=-1, padding_factor=8
     ):
         """Build the dictionary
 

Mutant 725

--- fairseq/tasks/fairseq_task.py
+++ fairseq/tasks/fairseq_task.py
@@ -47,7 +47,7 @@
 
     @classmethod
     def build_dictionary(
-        cls, filenames, workers=1, threshold=-1, nwords=-1, padding_factor=8
+        cls, filenames, workers=1, threshold=+1, nwords=-1, padding_factor=8
     ):
         """Build the dictionary
 

Mutant 726

--- fairseq/tasks/fairseq_task.py
+++ fairseq/tasks/fairseq_task.py
@@ -47,7 +47,7 @@
 
     @classmethod
     def build_dictionary(
-        cls, filenames, workers=1, threshold=-1, nwords=-1, padding_factor=8
+        cls, filenames, workers=1, threshold=-2, nwords=-1, padding_factor=8
     ):
         """Build the dictionary
 

Mutant 727

--- fairseq/tasks/fairseq_task.py
+++ fairseq/tasks/fairseq_task.py
@@ -47,7 +47,7 @@
 
     @classmethod
     def build_dictionary(
-        cls, filenames, workers=1, threshold=-1, nwords=-1, padding_factor=8
+        cls, filenames, workers=1, threshold=-1, nwords=+1, padding_factor=8
     ):
         """Build the dictionary
 

Mutant 728

--- fairseq/tasks/fairseq_task.py
+++ fairseq/tasks/fairseq_task.py
@@ -47,7 +47,7 @@
 
     @classmethod
     def build_dictionary(
-        cls, filenames, workers=1, threshold=-1, nwords=-1, padding_factor=8
+        cls, filenames, workers=1, threshold=-1, nwords=-2, padding_factor=8
     ):
         """Build the dictionary
 

Mutant 729

--- fairseq/tasks/fairseq_task.py
+++ fairseq/tasks/fairseq_task.py
@@ -47,7 +47,7 @@
 
     @classmethod
     def build_dictionary(
-        cls, filenames, workers=1, threshold=-1, nwords=-1, padding_factor=8
+        cls, filenames, workers=1, threshold=-1, nwords=-1, padding_factor=9
     ):
         """Build the dictionary
 

Mutant 731

--- fairseq/tasks/fairseq_task.py
+++ fairseq/tasks/fairseq_task.py
@@ -78,7 +78,7 @@
         """
         return cls(args, **kwargs)
 
-    def load_dataset(self, split, combine=False, **kwargs):
+    def load_dataset(self, split, combine=True, **kwargs):
         """Load a given dataset split.
 
         Args:

Mutant 732

--- fairseq/tasks/fairseq_task.py
+++ fairseq/tasks/fairseq_task.py
@@ -116,7 +116,7 @@
         num_shards=1,
         shard_id=0,
         num_workers=0,
-        epoch=1
+        epoch=2
     ):
         """
         Get an iterator that yields batches of data from the given dataset.

Mutant 733

--- fairseq/tasks/fairseq_task.py
+++ fairseq/tasks/fairseq_task.py
@@ -314,7 +314,7 @@
         )
 
     def train_step(
-        self, sample, model, criterion, optimizer, update_num, ignore_grad=False
+        self, sample, model, criterion, optimizer, update_num, ignore_grad=True
     ):
         """
         Do forward and backward, and return the loss as computed by *criterion*

Mutant 734

--- fairseq/tasks/fairseq_task.py
+++ fairseq/tasks/fairseq_task.py
@@ -410,7 +410,6 @@
         """Return the max input length allowed by the task."""
         return None
 
-    @property
     def source_dictionary(self):
         """Return the source :class:`~fairseq.data.Dictionary` (if applicable
         for this task)."""

Mutant 735

--- fairseq/tasks/fairseq_task.py
+++ fairseq/tasks/fairseq_task.py
@@ -416,7 +416,6 @@
         for this task)."""
         raise NotImplementedError
 
-    @property
     def target_dictionary(self):
         """Return the target :class:`~fairseq.data.Dictionary` (if applicable
         for this task)."""