Tweak GPUCompatibleFIFOQueue's unit test so it runs more configurations

tf.constant places on the CPU executing eagerly, which mismatched with GPU placements later in the test.

Fixes #45662.

PiperOrigin-RevId: 350216699
Change-Id: I2c82b5be99ccdf315f553003efbb1cd90672b992
diff --git a/tensorflow/python/kernel_tests/fifo_queue_test.py b/tensorflow/python/kernel_tests/fifo_queue_test.py
index dc2963e..dfc5743 100644
--- a/tensorflow/python/kernel_tests/fifo_queue_test.py
+++ b/tensorflow/python/kernel_tests/fifo_queue_test.py
@@ -415,7 +415,9 @@
     with test_util.use_gpu():
       q = data_flow_ops.GPUCompatibleFIFOQueue(10, dtypes_lib.float32)
       elems_numpy = [10.0, 20.0, 30.0]
-      elems = [constant_op.constant(x) for x in elems_numpy]
+      # The identity ensures constants are copied to the GPU immediately
+      elems = [array_ops.identity(constant_op.constant(x))
+               for x in elems_numpy]
 
       for x in elems:
         self.evaluate(q.enqueue((x,)))