class_docstr: The SessionRunHook for preemptible Cloud TPUs.
  
  This is an implementation of SessionRunHook for the pre-emptible Google Cloud
  TPU service. It attempts to close the session if the TPU is preempted, and
  exits the coordinator process if the session cannot be closed.
class_docstr_tok: ["The","SessionRunHook","for","preemptible","Cloud","TPUs",".","This","is","an","implementation","of","SessionRunHook","for","the","pre-emptible","Google","Cloud","TPU","service",".","It","attempts","to","close","the","session","if","the","TPU","is","preempted",",","and","exits","the","coordinator","process","if","the","session","can","not","be","closed","."]
code: def after_create_session(self, session, coord):
      if tpu_cluster_resolver.is_running_in_gce():
          self._tpu_poller = _TPUPollingThread(self._cluster, session)
          self._tpu_poller.start()
  
file_path: tensorflow-upstream/tensorflow/python/tpu/preempted_hook.py
imports: import logging
  import os
  import threading
  import time
  from tensorflow.python.distribute.cluster_resolver import tpu_cluster_resolver
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.training import session_run_hook
label_desc: Use image node_id 2 for calling the CloudTPUPreemptedHook obj's underlying member method code with example usage: obj.after_create_session(session, coord) without return types