code: def gpu_available_in_session():
      sess = tfv1.get_default_session()
      for dev in sess.list_devices():
          if dev.device_type.lower() == "gpu":
              return True
      return False
  
file_path: tensorpack/tensorpack/tfutils/common.py
imports: import tensorflow
  from ..compat import tfv1
  from ..utils.argtools import graph_memoized
  from .collect_env import collect_env_info
label_desc: Use image node_id 7 for calling a global function with example usage: gpu_available_in_session() and returns: False, True