Repository: cornellius-gp/gpytorch

Issue:
Travis CI doesn't actually run Python 2.7 tests
See https://travis-ci.org/cornellius-gp/gpytorch/jobs/382926170 for an example (0 tests ran).

The Python 3 tests still work fine, but this explains why the Python 2 tests have never failed in recent memory even when the Python 3 tests do :-).

Considering a couple of us develop on Python 3, this could theoretically mean we have some undetected backward compatibility issues. I doubt it, though.



Discussion:
Interesting. Wonder why that is...

Anyone has an idea when pytorch is going to cut py2 support? numpy/scipy/pandas are doing it for new releases starting the end of this year...

Resolving patch:
diff --git a/gpytorch/kernels/white_noise_kernel.py b/gpytorch/kernels/white_noise_kernel.py
--- a/gpytorch/kernels/white_noise_kernel.py
+++ b/gpytorch/kernels/white_noise_kernel.py
@@ -14,4 +14,4 @@ def forward(self, x1, x2):
         elif x1.size(-2) == x2.size(-2) and x1.size(-2) == self.variances.size(-1) and torch.equal(x1, x2):
             return DiagLazyVariable(self.variances.unsqueeze(0))
         else:
-            return ZeroLazyVariable(x1.size(-3), x1.size(-2), x2.size(-2), device=x1.device)
+            return ZeroLazyVariable(x1.size(-3), x1.size(-2), x2.size(-2))
diff --git a/gpytorch/lazy/interpolated_lazy_variable.py b/gpytorch/lazy/interpolated_lazy_variable.py
--- a/gpytorch/lazy/interpolated_lazy_variable.py
+++ b/gpytorch/lazy/interpolated_lazy_variable.py
@@ -202,7 +202,7 @@ def _transpose_nonbatch(self):
             self.right_interp_values,
             self.left_interp_indices,
             self.left_interp_values,
-            **self._kwargs,
+            **self._kwargs
         )
         return res
 
@@ -546,7 +546,7 @@ def repeat(self, *sizes):
             self.left_interp_values.repeat(*sizes),
             self.right_interp_indices.repeat(*sizes),
             self.right_interp_values.repeat(*sizes),
-            **self._kwargs,
+            **self._kwargs
         )
 
     def sum_batch(self, sum_batch_size=None):
@@ -657,7 +657,7 @@ def __getitem__(self, index):
             left_interp_values,
             right_interp_indices,
             right_interp_values,
-            **self._kwargs,
+            **self._kwargs
         )
 
         if squeeze_left or squeeze_right:
diff --git a/gpytorch/lazy/zero_lazy_variable.py b/gpytorch/lazy/zero_lazy_variable.py
--- a/gpytorch/lazy/zero_lazy_variable.py
+++ b/gpytorch/lazy/zero_lazy_variable.py
@@ -12,10 +12,9 @@ class ZeroLazyVariable(LazyVariable):
     Special LazyVariable representing zero.
     """
 
-    def __init__(self, *sizes, device):
+    def __init__(self, *sizes):
         super(ZeroLazyVariable, self).__init__(*sizes)
         self.sizes = list(sizes)
-        self.device = device
 
     def _matmul(self, rhs):
         rhs_size_ind = -2 if rhs.ndimension() > 1 else -1
@@ -60,7 +59,7 @@ def diag(self):
             return torch.zeros(size[-2])
 
     def evaluate(self):
-        return torch.zeros(*self.sizes, device=self.device)
+        return torch.zeros(*self.sizes)
 
     def inv_matmul(self, tensor):
         raise RuntimeError("ZeroLazyVariables are not invertible!")
@@ -84,7 +83,7 @@ def mul(self, other):
         return self
 
     def mul_batch(self, mul_batch_size=None):
-        return ZeroLazyVariable(*self.sizes[-2:], self.device)
+        return ZeroLazyVariable(*self.sizes[-2:])
 
     def root_decomposition(self):
         raise RuntimeError("ZeroLazyVariables are not positive definite!")
@@ -115,7 +114,7 @@ def transpose(self, dim1, dim2):
         sizes[dim1] = sizes[dim2]
         sizes[dim2] = tmp
 
-        return ZeroLazyVariable(*sizes, device=self.device)
+        return ZeroLazyVariable(*sizes)
 
     def __add__(self, other):
         return other


Test patch: