fairseq/modules/lightweight_convolution.py

Killed 0 out of 11 mutants

Survived

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

Mutant 1349

--- fairseq/modules/lightweight_convolution.py
+++ fairseq/modules/lightweight_convolution.py
@@ -14,7 +14,7 @@
 
 
 def LightweightConv(input_size, kernel_size=1, padding_l=None, num_heads=1,
-                    weight_dropout=0., weight_softmax=False, bias=False):
+                    weight_dropout=1.0, weight_softmax=False, bias=False):
     if torch.cuda.is_available():
         try:
             from fairseq.modules.lightconv_layer import LightconvLayer

Mutant 1350

--- fairseq/modules/lightweight_convolution.py
+++ fairseq/modules/lightweight_convolution.py
@@ -14,7 +14,7 @@
 
 
 def LightweightConv(input_size, kernel_size=1, padding_l=None, num_heads=1,
-                    weight_dropout=0., weight_softmax=False, bias=False):
+                    weight_dropout=0., weight_softmax=True, bias=False):
     if torch.cuda.is_available():
         try:
             from fairseq.modules.lightconv_layer import LightconvLayer

Mutant 1351

--- fairseq/modules/lightweight_convolution.py
+++ fairseq/modules/lightweight_convolution.py
@@ -14,7 +14,7 @@
 
 
 def LightweightConv(input_size, kernel_size=1, padding_l=None, num_heads=1,
-                    weight_dropout=0., weight_softmax=False, bias=False):
+                    weight_dropout=0., weight_softmax=False, bias=True):
     if torch.cuda.is_available():
         try:
             from fairseq.modules.lightconv_layer import LightconvLayer

Mutant 1352

--- fairseq/modules/lightweight_convolution.py
+++ fairseq/modules/lightweight_convolution.py
@@ -54,7 +54,7 @@
     '''
 
     def __init__(self, input_size, kernel_size=1, padding=0, num_heads=1,
-                 weight_softmax=False, bias=False, weight_dropout=0.):
+                 weight_softmax=True, bias=False, weight_dropout=0.):
         super().__init__()
         self.input_size = input_size
         self.kernel_size = kernel_size

Mutant 1353

--- fairseq/modules/lightweight_convolution.py
+++ fairseq/modules/lightweight_convolution.py
@@ -54,7 +54,7 @@
     '''
 
     def __init__(self, input_size, kernel_size=1, padding=0, num_heads=1,
-                 weight_softmax=False, bias=False, weight_dropout=0.):
+                 weight_softmax=False, bias=True, weight_dropout=0.):
         super().__init__()
         self.input_size = input_size
         self.kernel_size = kernel_size

Mutant 1354

--- fairseq/modules/lightweight_convolution.py
+++ fairseq/modules/lightweight_convolution.py
@@ -54,7 +54,7 @@
     '''
 
     def __init__(self, input_size, kernel_size=1, padding=0, num_heads=1,
-                 weight_softmax=False, bias=False, weight_dropout=0.):
+                 weight_softmax=False, bias=False, weight_dropout=1.0):
         super().__init__()
         self.input_size = input_size
         self.kernel_size = kernel_size

Mutant 1355

--- fairseq/modules/lightweight_convolution.py
+++ fairseq/modules/lightweight_convolution.py
@@ -100,8 +100,6 @@
 
         return output
 
-
-@with_incremental_state
 class LightweightConv1dTBC(nn.Module):
     '''Lightweight Convolution assuming the input is TxBxC
     Args:

Mutant 1356

--- fairseq/modules/lightweight_convolution.py
+++ fairseq/modules/lightweight_convolution.py
@@ -123,7 +123,7 @@
         bias:   the learnable bias of the module of shape `(input_size)`
     '''
     def __init__(self, input_size, kernel_size=1, padding_l=None, num_heads=1,
-                 weight_dropout=0., weight_softmax=False, bias=False):
+                 weight_dropout=1.0, weight_softmax=False, bias=False):
         super().__init__()
         self.input_size = input_size
         self.kernel_size = kernel_size

Mutant 1357

--- fairseq/modules/lightweight_convolution.py
+++ fairseq/modules/lightweight_convolution.py
@@ -123,7 +123,7 @@
         bias:   the learnable bias of the module of shape `(input_size)`
     '''
     def __init__(self, input_size, kernel_size=1, padding_l=None, num_heads=1,
-                 weight_dropout=0., weight_softmax=False, bias=False):
+                 weight_dropout=0., weight_softmax=True, bias=False):
         super().__init__()
         self.input_size = input_size
         self.kernel_size = kernel_size

Mutant 1358

--- fairseq/modules/lightweight_convolution.py
+++ fairseq/modules/lightweight_convolution.py
@@ -123,7 +123,7 @@
         bias:   the learnable bias of the module of shape `(input_size)`
     '''
     def __init__(self, input_size, kernel_size=1, padding_l=None, num_heads=1,
-                 weight_dropout=0., weight_softmax=False, bias=False):
+                 weight_dropout=0., weight_softmax=False, bias=True):
         super().__init__()
         self.input_size = input_size
         self.kernel_size = kernel_size

Mutant 1359

--- fairseq/modules/lightweight_convolution.py
+++ fairseq/modules/lightweight_convolution.py
@@ -146,7 +146,7 @@
         if self.bias is not None:
             nn.init.constant_(self.bias, 0.)
 
-    def forward(self, x, incremental_state=None, unfold=False):
+    def forward(self, x, incremental_state=None, unfold=True):
         '''Assuming the input, x, of the shape T x B x C and producing an output in the shape T x B x C
         args:
             x: Input of shape T x B x C, i.e. (timesteps, batch_size, input_size)