diff --git a/tensorflow/python/kernel_tests/conv_ops_3d_test.py b/tensorflow/python/kernel_tests/conv_ops_3d_test.py index bdb8bc514c9..deb465a0474 100644 --- a/tensorflow/python/kernel_tests/conv_ops_3d_test.py +++ b/tensorflow/python/kernel_tests/conv_ops_3d_test.py @@ -32,6 +32,7 @@ from tensorflow.python.ops import gradients_impl from tensorflow.python.ops import nn_ops import tensorflow.python.ops.nn_grad # pylint: disable=unused-import from tensorflow.python.platform import test +from tensorflow.python.framework import test_util def GetTestConfigs(): @@ -220,12 +221,13 @@ class Conv3DTest(test.TestCase): expected=expected_output) def testConv3D1x1x1Filter2x1x1Dilation(self): - self._VerifyDilatedConvValues( - tensor_in_sizes=[1, 3, 6, 1, 1], - filter_in_sizes=[1, 1, 1, 1, 1], - stride=1, - padding="VALID", - dilations=[2, 1, 1]) + if test.is_gpu_available(cuda_only=True) or test_util.IsMklEnabled(): + self._VerifyDilatedConvValues( + tensor_in_sizes=[1, 3, 6, 1, 1], + filter_in_sizes=[1, 1, 1, 1, 1], + stride=1, + padding="VALID", + dilations=[2, 1, 1]) # Expected values computed using scipy's correlate function. def testConv3D2x2x2Filter(self): @@ -244,12 +246,13 @@ class Conv3DTest(test.TestCase): expected=expected_output) def testConv3D2x2x2Filter1x2x1Dilation(self): - self._VerifyDilatedConvValues( - tensor_in_sizes=[1, 4, 6, 3, 1], - filter_in_sizes=[2, 2, 2, 1, 1], - stride=1, - padding="VALID", - dilations=[1, 2, 1]) + if test.is_gpu_available(cuda_only=True) or test_util.IsMklEnabled(): + self._VerifyDilatedConvValues( + tensor_in_sizes=[1, 4, 6, 3, 1], + filter_in_sizes=[2, 2, 2, 1, 1], + stride=1, + padding="VALID", + dilations=[1, 2, 1]) def testConv3DStrides(self): expected_output = [