fairseq/modules/lightweight_convolution.py

Killed 0 out of 11 mutants

Survived

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

Mutant 2457

--- 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 2458

--- 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 2459

--- 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 2460

--- 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 2461

--- 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 2462

--- 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 2463

--- 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 2464

--- 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 2465

--- 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 2466

--- 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 2467

--- 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)