diff --git a/tensorflow/python/ops/nn_test.py b/tensorflow/python/ops/nn_test.py
index b581acdd356..8bd90f01ba1 100644
--- a/tensorflow/python/ops/nn_test.py
+++ b/tensorflow/python/ops/nn_test.py
@@ -1333,17 +1333,6 @@ class DataFormatVectorPermuteTest(test_lib.TestCase):
       with test_util.use_gpu():
         self.evaluate(op)
 
-  @test_util.disable_xla("XLA catches the error and rethrows as different one")
-  def test2DNoWH(self):
-    x = [[0, 1], [2, 3]]
-    with self.assertRaisesRegex(
-        errors.InvalidArgumentError,
-        "Format specifier must contain H and W for 2D case"):
-      op = nn_ops.data_format_vec_permute(
-          x, src_format="1234", dst_format="4321")
-      with test_util.use_gpu():
-        self.evaluate(op)
-
 
 @test_util.run_all_in_graph_and_eager_modes
 class AvgPoolTest(test_lib.TestCase):