code: def _force_device_sync(self):
      # If this function is called in the context of a non-CPU device
      # (e.g., inside a 'with tf.device("/gpu:0")' block)
      # then this will force a copy from CPU->NON_CPU_DEVICE->CPU,
      # which forces a sync. This is a roundabout way, yes.
      tf.constant(1.0).cpu()
  
imports: import gc
  import time
  from absl.testing import parameterized
  import tensorflow
  from tensorflow.python.eager import forwardprop
  from tensorflow.python.eager.benchmarks.resnet50 import resnet50
  from tensorflow.python.eager.benchmarks.resnet50 import resnet50_test_util
label_desc: Use image node_id 1 for calling the HVPBenchmarks obj's underlying member method code with example usage: obj._force_device_sync() without return types