message: Add additional test case for GitHub issue 31696 for GPU
diff: @@ -1395,6 +1395,28 @@ class ResourceVariableOpsTest(test_util.TensorFlowTestCase,
  self.assertAllEqual(output_shape, result.shape.as_list())
  self.assertAllEqual(expected, result)
  + @parameterized.parameters([
  + dict(dtype=dtypes.bool),
  + dict(dtype=dtypes.int64),
  + dict(dtype=dtypes.half),
  + dict(dtype=dtypes.float32),
  + dict(dtype=dtypes.double),
  + ])
  + @test_util.run_gpu_only
  + @test_util.run_in_graph_and_eager_modes
  + def testGatherWithDTypes(self, dtype):
  + if dtype == dtypes.bool:
  + params = constant_op.constant([False, True, False, True])
  + expected = constant_op.constant([[False, True], [False, True]])
  + else:
  + params = constant_op.constant([6, 7, 8, 9], dtype=dtype)
  + expected = constant_op.constant([[8, 7], [6, 9]], dtype=dtype)
  + indices = constant_op.constant([[2, 1], [0, 3]])
  + var = resource_variable_ops.ResourceVariable(params, name="var0")
  + with ops.control_dependencies([var.initializer]):
  + result = resource_variable_ops.resource_gather(
  + var.handle, indices, dtype=dtype)
  + self.assertAllEqual(expected, result)
  if __name__ == "__main__":
  test.main()
  