Update disabled tests to show XLA's intent to not support align_corners=False.
This is partially due to it being removed in Tensorflow 2.0 and less important. PiperOrigin-RevId: 237273953
This commit is contained in:
parent
fa666f7f3d
commit
06404d88af
@ -421,7 +421,7 @@ class ZeroPaddingTest(keras_parameterized.TestCase):
|
|||||||
keras.layers.ZeroPadding3D(padding=None)
|
keras.layers.ZeroPadding3D(padding=None)
|
||||||
|
|
||||||
|
|
||||||
@test_util.disable_all_xla('b/124289666') # align_corners=False unimplemented
|
@test_util.disable_all_xla('align_corners=False not supported by XLA')
|
||||||
@keras_parameterized.run_all_keras_modes
|
@keras_parameterized.run_all_keras_modes
|
||||||
class UpSamplingTest(keras_parameterized.TestCase):
|
class UpSamplingTest(keras_parameterized.TestCase):
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ from tensorflow.python.ops import image_ops
|
|||||||
from tensorflow.python.platform import test
|
from tensorflow.python.platform import test
|
||||||
|
|
||||||
|
|
||||||
@test_util.disable_all_xla("b/124289666") # align_corners=False unimplemented
|
@test_util.disable_all_xla('align_corners=False not supported by XLA')
|
||||||
class ResizeNearestNeighborOpTest(test.TestCase):
|
class ResizeNearestNeighborOpTest(test.TestCase):
|
||||||
|
|
||||||
TYPES = [np.float32, np.float64]
|
TYPES = [np.float32, np.float64]
|
||||||
@ -150,14 +150,18 @@ class ResizeBilinearOpTest(test.TestCase):
|
|||||||
self.assertLess(err, 1e-3)
|
self.assertLess(err, 1e-3)
|
||||||
|
|
||||||
@test_util.run_deprecated_v1
|
@test_util.run_deprecated_v1
|
||||||
@test_util.disable_xla("b/124290659") # align_corners=False unimplemented
|
|
||||||
def testCompareGpuVsCpu(self):
|
def testCompareGpuVsCpu(self):
|
||||||
in_shape = [2, 4, 6, 3]
|
in_shape = [2, 4, 6, 3]
|
||||||
out_shape = [2, 8, 16, 3]
|
out_shape = [2, 8, 16, 3]
|
||||||
|
|
||||||
size = np.prod(in_shape)
|
size = np.prod(in_shape)
|
||||||
x = 1.0 / size * np.arange(0, size).reshape(in_shape).astype(np.float32)
|
x = 1.0 / size * np.arange(0, size).reshape(in_shape).astype(np.float32)
|
||||||
for align_corners in [True, False]:
|
|
||||||
|
# Align corners will be deprecated for tf2.0 and the false version is not
|
||||||
|
# supported by XLA.
|
||||||
|
align_corner_options = [True
|
||||||
|
] if test_util.is_xla_enabled() else [True, False]
|
||||||
|
for align_corners in align_corner_options:
|
||||||
grad = {}
|
grad = {}
|
||||||
for use_gpu in [False, True]:
|
for use_gpu in [False, True]:
|
||||||
with self.cached_session(use_gpu=use_gpu):
|
with self.cached_session(use_gpu=use_gpu):
|
||||||
|
@ -2269,7 +2269,7 @@ class ResizeImagesV2Test(test_util.TensorFlowTestCase):
|
|||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@test_util.disable_xla("b/124289666") # align_corners=False unimplemented
|
@test_util.disable_xla("align_corners=False not supported by XLA")
|
||||||
@test_util.run_deprecated_v1
|
@test_util.run_deprecated_v1
|
||||||
def testNoOp(self):
|
def testNoOp(self):
|
||||||
img_shape = [1, 6, 4, 1]
|
img_shape = [1, 6, 4, 1]
|
||||||
@ -2416,7 +2416,7 @@ class ResizeImagesV2Test(test_util.TensorFlowTestCase):
|
|||||||
if method in self.INTERPOLATING_METHODS:
|
if method in self.INTERPOLATING_METHODS:
|
||||||
self.assertAllClose(resized, img_np, atol=1e-5)
|
self.assertAllClose(resized, img_np, atol=1e-5)
|
||||||
|
|
||||||
@test_util.disable_xla("b/124289666") # align_corners=False unimplemented
|
@test_util.disable_xla("align_corners=False not supported by XLA")
|
||||||
def testResizeDown(self):
|
def testResizeDown(self):
|
||||||
# This test is also conducted with int8, so 127 is the maximum
|
# This test is also conducted with int8, so 127 is the maximum
|
||||||
# value that can be used.
|
# value that can be used.
|
||||||
@ -2448,7 +2448,7 @@ class ResizeImagesV2Test(test_util.TensorFlowTestCase):
|
|||||||
resized = self.evaluate(y)
|
resized = self.evaluate(y)
|
||||||
self.assertAllClose(resized, expected, atol=1e-5)
|
self.assertAllClose(resized, expected, atol=1e-5)
|
||||||
|
|
||||||
@test_util.disable_xla("b/124289666") # align_corners=False unimplemented
|
@test_util.disable_xla("align_corners=False not supported by XLA")
|
||||||
def testResizeUp(self):
|
def testResizeUp(self):
|
||||||
img_shape = [1, 3, 2, 1]
|
img_shape = [1, 3, 2, 1]
|
||||||
data = [64, 32, 32, 64, 50, 100]
|
data = [64, 32, 32, 64, 50, 100]
|
||||||
@ -2507,7 +2507,8 @@ class ResizeImagesV2Test(test_util.TensorFlowTestCase):
|
|||||||
[1, target_height, target_width, 1])
|
[1, target_height, target_width, 1])
|
||||||
self.assertAllClose(resized, expected, atol=1e-04)
|
self.assertAllClose(resized, expected, atol=1e-04)
|
||||||
|
|
||||||
@test_util.disable_xla("TODO(jflynn): Figure out why this fails.")
|
# XLA doesn't implement half_pixel_centers
|
||||||
|
@test_util.disable_xla("b/127616992")
|
||||||
def testLegacyBicubicMethodsMatchNewMethods(self):
|
def testLegacyBicubicMethodsMatchNewMethods(self):
|
||||||
img_shape = [1, 3, 2, 1]
|
img_shape = [1, 3, 2, 1]
|
||||||
data = [64, 32, 32, 64, 50, 100]
|
data = [64, 32, 32, 64, 50, 100]
|
||||||
@ -2562,7 +2563,7 @@ class ResizeImagesV2Test(test_util.TensorFlowTestCase):
|
|||||||
resized = self.evaluate(y)
|
resized = self.evaluate(y)
|
||||||
self.assertAllClose(resized, expected, atol=1)
|
self.assertAllClose(resized, expected, atol=1)
|
||||||
|
|
||||||
@test_util.disable_xla("b/124289666") # align_corners=False unimplemented
|
@test_util.disable_xla("align_corners=False not supported by XLA")
|
||||||
def testCompareNearestNeighbor(self):
|
def testCompareNearestNeighbor(self):
|
||||||
if test.is_gpu_available():
|
if test.is_gpu_available():
|
||||||
input_shape = [1, 5, 6, 3]
|
input_shape = [1, 5, 6, 3]
|
||||||
@ -2767,7 +2768,7 @@ class ResizeImagesTest(test_util.TensorFlowTestCase):
|
|||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@test_util.disable_xla("b/124289666") # align_corners=False unimplemented
|
@test_util.disable_xla("align_corners=False not supported by XLA")
|
||||||
@test_util.run_deprecated_v1
|
@test_util.run_deprecated_v1
|
||||||
def testNoOp(self):
|
def testNoOp(self):
|
||||||
img_shape = [1, 6, 4, 1]
|
img_shape = [1, 6, 4, 1]
|
||||||
@ -2884,7 +2885,7 @@ class ResizeImagesTest(test_util.TensorFlowTestCase):
|
|||||||
expected_dtype = dtypes.float32
|
expected_dtype = dtypes.float32
|
||||||
self.assertEqual(y.dtype, expected_dtype)
|
self.assertEqual(y.dtype, expected_dtype)
|
||||||
|
|
||||||
@test_util.disable_xla("b/124289666") # align_corners=False unimplemented
|
@test_util.disable_xla("align_corners=False not supported by XLA")
|
||||||
def testSumTensor(self):
|
def testSumTensor(self):
|
||||||
img_shape = [1, 6, 4, 1]
|
img_shape = [1, 6, 4, 1]
|
||||||
# This test is also conducted with int8, so 127 is the maximum
|
# This test is also conducted with int8, so 127 is the maximum
|
||||||
@ -2911,7 +2912,7 @@ class ResizeImagesTest(test_util.TensorFlowTestCase):
|
|||||||
self.assertAllEqual(img_shape, newshape)
|
self.assertAllEqual(img_shape, newshape)
|
||||||
self.assertAllClose(resized, img_np, atol=1e-5)
|
self.assertAllClose(resized, img_np, atol=1e-5)
|
||||||
|
|
||||||
@test_util.disable_xla("b/124289666") # align_corners=False unimplemented
|
@test_util.disable_xla("align_corners=False not supported by XLA")
|
||||||
def testResizeDown(self):
|
def testResizeDown(self):
|
||||||
# This test is also conducted with int8, so 127 is the maximum
|
# This test is also conducted with int8, so 127 is the maximum
|
||||||
# value that can be used.
|
# value that can be used.
|
||||||
@ -2943,7 +2944,7 @@ class ResizeImagesTest(test_util.TensorFlowTestCase):
|
|||||||
resized = self.evaluate(y)
|
resized = self.evaluate(y)
|
||||||
self.assertAllClose(resized, expected, atol=1e-5)
|
self.assertAllClose(resized, expected, atol=1e-5)
|
||||||
|
|
||||||
@test_util.disable_xla("b/124289666") # align_corners=False unimplemented
|
@test_util.disable_xla("align_corners=False not supported by XLA")
|
||||||
def testResizeUpAlignCornersFalse(self):
|
def testResizeUpAlignCornersFalse(self):
|
||||||
img_shape = [1, 3, 2, 1]
|
img_shape = [1, 3, 2, 1]
|
||||||
data = [64, 32, 32, 64, 50, 100]
|
data = [64, 32, 32, 64, 50, 100]
|
||||||
@ -3069,7 +3070,7 @@ class ResizeImagesTest(test_util.TensorFlowTestCase):
|
|||||||
resized = self.evaluate(y)
|
resized = self.evaluate(y)
|
||||||
self.assertAllClose(resized, expected, atol=1)
|
self.assertAllClose(resized, expected, atol=1)
|
||||||
|
|
||||||
@test_util.disable_xla("b/124289666") # align_corners=False unimplemented
|
@test_util.disable_xla("align_corners=False not supported by XLA")
|
||||||
def testCompareNearestNeighbor(self):
|
def testCompareNearestNeighbor(self):
|
||||||
if test.is_gpu_available():
|
if test.is_gpu_available():
|
||||||
input_shape = [1, 5, 6, 3]
|
input_shape = [1, 5, 6, 3]
|
||||||
@ -3405,7 +3406,7 @@ class ResizeImageWithPadV2Test(test_util.TensorFlowTestCase):
|
|||||||
self.assertEqual(y.get_shape().as_list(), post_shape)
|
self.assertEqual(y.get_shape().as_list(), post_shape)
|
||||||
|
|
||||||
|
|
||||||
@test_util.disable_xla("b/124289666") # align_corners=False unimplemented
|
@test_util.disable_xla("align_corners=False not supported by XLA")
|
||||||
@test_util.run_deprecated_v1
|
@test_util.run_deprecated_v1
|
||||||
def testNoOp(self):
|
def testNoOp(self):
|
||||||
x_shape = [10, 10, 10]
|
x_shape = [10, 10, 10]
|
||||||
@ -3413,7 +3414,7 @@ class ResizeImageWithPadV2Test(test_util.TensorFlowTestCase):
|
|||||||
|
|
||||||
self._assertReturns(x, x_shape, x, x_shape)
|
self._assertReturns(x, x_shape, x, x_shape)
|
||||||
|
|
||||||
@test_util.disable_xla("b/124289666") # align_corners=False unimplemented
|
@test_util.disable_xla("align_corners=False not supported by XLA")
|
||||||
@test_util.run_deprecated_v1
|
@test_util.run_deprecated_v1
|
||||||
def testPad(self):
|
def testPad(self):
|
||||||
# Reduce vertical dimension
|
# Reduce vertical dimension
|
||||||
|
Loading…
Reference in New Issue
Block a user