diff --git a/GPy/kern/linear.py b/GPy/kern/linear.py
index <HASH>..<HASH> 100644
--- a/GPy/kern/linear.py
+++ b/GPy/kern/linear.py
@@ -100,6 +100,9 @@ class linear(Kernpart):
     def dK_dX(self, dL_dK, X, X2, target):
         target += (((X2[:, None, :] * self.variances)) * dL_dK[:, :, None]).sum(0)
 
+    def dKdiag_dX(self,dL_dKdiag,X,target):
+        target += 2.*self.variances*dL_dKdiag[:,None]*X
+
     #---------------------------------------#
     #             PSI statistics            #
     #---------------------------------------#
diff --git a/GPy/util/__init__.py b/GPy/util/__init__.py
index <HASH>..<HASH> 100644
--- a/GPy/util/__init__.py
+++ b/GPy/util/__init__.py
@@ -11,6 +11,6 @@ import misc
 import warping_functions
 import datasets
 import mocap
-import visualize
+#import visualize
 import decorators
 import classification
removed visualize dependencies and added dKdiag_dX for linear