code: def _infer_device_name(graph_def):
      """Infer device name from a partition GraphDef."""
      device_name = None
      for node in graph_def.node:
          if node.device:
              device_name = node.device
              break
      if device_name is None:
          logging.warn(
              "Failed to infer device name from partition GraphDef: none of the "
              "nodes of the GraphDef has a non-empty device name."
          )
      return device_name
  
imports: from tensorflow.core.framework import graph_pb2
  from tensorflow.python.framework import op_def_registry
  from tensorflow.python.platform import tf_logging
label_desc: Use image node_id 7 for calling a global function with example usage: _infer_device_name(graph_def) and returns: device_name