diff options
Diffstat (limited to 'tensorflow/python/ops/image_ops_test.py')
-rw-r--r-- | tensorflow/python/ops/image_ops_test.py | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/tensorflow/python/ops/image_ops_test.py b/tensorflow/python/ops/image_ops_test.py index c8691f4eb8..799f7e4935 100644 --- a/tensorflow/python/ops/image_ops_test.py +++ b/tensorflow/python/ops/image_ops_test.py @@ -299,7 +299,7 @@ class AdjustHueTest(test_util.TensorFlowTestCase): return y_v.reshape(x_np.shape) def _adjustHueTf(self, x_np, delta_h): - with self.test_session(use_gpu=False): + with self.test_session(use_gpu=True): x = constant_op.constant(x_np) y = image_ops.adjust_hue(x, delta_h) y_tf = y.eval() @@ -1185,9 +1185,13 @@ class CropToBoundingBoxTest(test_util.TensorFlowTestCase): offset_height, offset_width = [0, 0] target_height, target_width = [2, 2] - for x_shape in ([1, 3, 5, 1], [3, 5]): + for x_shape in ([3, 5],): + self._assertRaises(x, x_shape, offset_height, offset_width, target_height, + target_width, "'image' must be at least three-dimensional.") + + for x_shape in ([1, 3, 5, 1, 1],): self._assertRaises(x, x_shape, offset_height, offset_width, target_height, - target_width, "must be three-dimensional") + target_width, "'image' must have either 3 or 4 dimensions.") def testZeroLengthInput(self): # Input image has 0-length dimension(s). @@ -1430,9 +1434,13 @@ class PadToBoundingBoxTest(test_util.TensorFlowTestCase): offset_height, offset_width = [0, 0] target_height, target_width = [2, 2] - for x_shape in ([1, 3, 5, 1], [3, 5]): + for x_shape in ([3, 5],): self._assertRaises(x, x_shape, offset_height, offset_width, target_height, - target_width, "must be three-dimensional") + target_width, "'image' must be at least three-dimensional") + + for x_shape in ([1, 3, 5, 1, 1],): + self._assertRaises(x, x_shape, offset_height, offset_width, target_height, + target_width, "'image' must have either 3 or 4 dimensions.") def testZeroLengthInput(self): # Input image has 0-length dimension(s). @@ -2220,9 +2228,13 @@ class ResizeImageWithCropOrPadTest(test_util.TensorFlowTestCase): x = [0] * 15 target_height, target_width = [4, 4] - for x_shape in ([1, 3, 5, 1], [3, 5]): + for x_shape in ([3, 5],): + self._assertRaises(x, x_shape, target_height, target_width, + "'image' must have either 3 or 4 dimensions.") + + for x_shape in ([1, 3, 5, 1, 1],): self._assertRaises(x, x_shape, target_height, target_width, - "must be three-dimensional") + "'image' must have either 3 or 4 dimensions.") def testZeroLengthInput(self): # Input image has 0-length dimension(s). |