Fix the logic for detecting if a job is running on GPU.
Fix the logic for detecting if a job is running on GPU.

PiperOrigin-RevId: 338173961

tensorflow/lingvo,tensorflow/lingvo,tensorflow/lingvo,tensorflow/lingvo