Merge pull request #30340 from Intel-tensorflow:bugfix/wenxizhu/dilated-conv3d

PiperOrigin-RevId: 257214782
This commit is contained in:
TensorFlower Gardener 2019-07-09 10:13:30 -07:00
commit 4bb0f6e87f
2 changed files with 15 additions and 11 deletions

View File

@ -411,15 +411,18 @@ class MklDnnConvUtil {
input_cols, filter_cols, dilation_cols, stride_cols,
padding_type, &out_cols, &pad_left, &pad_right));
} else {
OP_REQUIRES_OK(context_, GetWindowedOutputSizeVerbose(
input_planes, filter_planes, stride_planes,
padding_, &out_planes, &pad_D1, &pad_D2));
OP_REQUIRES_OK(context_, GetWindowedOutputSizeVerbose(
input_rows, filter_rows, stride_rows,
padding_, &out_rows, &pad_top, &pad_bottom));
OP_REQUIRES_OK(context_, GetWindowedOutputSizeVerbose(
input_cols, filter_cols, stride_cols,
padding_, &out_cols, &pad_left, &pad_right));
OP_REQUIRES_OK(context_, GetWindowedOutputSizeVerboseV2(
input_planes, filter_planes, dilation_planes,
stride_planes, padding_, &out_planes,
&pad_D1, &pad_D2));
OP_REQUIRES_OK(context_,
GetWindowedOutputSizeVerboseV2(
input_rows, filter_rows, dilation_rows, stride_rows,
padding_, &out_rows, &pad_top, &pad_bottom));
OP_REQUIRES_OK(context_,
GetWindowedOutputSizeVerboseV2(
input_cols, filter_cols, dilation_cols, stride_cols,
padding_, &out_cols, &pad_left, &pad_right));
}
if (is_conv2d) {

View File

@ -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,7 +221,7 @@ class Conv3DTest(test.TestCase):
expected=expected_output)
def testConv3D1x1x1Filter2x1x1Dilation(self):
if test.is_gpu_available(cuda_only=True):
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],
@ -245,7 +246,7 @@ class Conv3DTest(test.TestCase):
expected=expected_output)
def testConv3D2x2x2Filter1x2x1Dilation(self):
if test.is_gpu_available(cuda_only=True):
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],