message: skipping some parts of the 'def_function_xla_jit_test' on the ROCm platform, because XLA support is not yet enabled on the ROCm platform
diff: @@ -39,6 +39,8 @@ class DefFunctionTest(test.TestCase):
  inputs = constant_op.constant([1, 2, 2, 3, 3])
  self.assertAllClose([2, 3, 3, 4, 4], func(inputs, 1))
  + if not test.is_built_with_rocm():
  + # XLA support is not yet enabled for TF ROCm
  self.assertAllClose([2, 3, 3, 4, 4], xla_func(inputs, 1))
  def testUnsupportedOps(self):
  @@ -63,18 +65,19 @@ class DefFunctionTest(test.TestCase):
  func = def_function.function(fn, experimental_compile=False)
  xla_func = def_function.function(fn, experimental_compile=True)
  + def run_and_check(test_func):
  x = constant_op.constant(3.0)
  - with backprop.GradientTape() as tape_1:
  - y_1 = func(x)
  - with backprop.GradientTape() as tape_2:
  - y_2 = xla_func(x)
  - dy_1 = tape_1.gradient(y_1, v)
  - dy_2 = tape_2.gradient(y_2, v)
  -
  - self.assertAllClose(6.0, y_1)
  - self.assertAllClose(6.0, y_2)
  - self.assertAllClose(3.0, dy_1)
  - self.assertAllClose(3.0, dy_2)
  + with backprop.GradientTape() as tape:
  + y = test_func(x)
  + dy = tape.gradient(y, v)
  +
  + self.assertAllClose(6.0, y)
  + self.assertAllClose(3.0, dy)
  +
  + run_and_check(func)
  + if not test.is_built_with_rocm():
  + # XLA support is not yet enabled for TF ROCm
  + run_and_check(xla_func)
  if __name__ == '__main__':
  