def test_Add_dims(self):
        k = GPy.kern.Matern32(2, active_dims=[2,self.D]) + GPy.kern.RBF(2, active_dims=[0,4]) + GPy.kern.Linear(self.D)
        k.randomize()
        self.assertRaises(IndexError, k.K, self.X)
        k = GPy.kern.Matern32(2, active_dims=[2,self.D-1]) + GPy.kern.RBF(2, active_dims=[0,4]) + GPy.kern.Linear(self.D)
        k.randomize()
        # assert it runs:
        try:
            k.K(self.X)
        except __HOLE__:
            raise AssertionError("k.K(X) should run on self.D-1 dimension")
dataset/ETHPy150Open SheffieldML/GPy/GPy/testing/kernel_tests.py/KernelGradientTestsContinuous.test_Add_dims