class_docstr: Wrapper around another workers that initializes a TensorFlow Session.
class_docstr_tok: ["Wrapper","around","another","workers","that","initializes","a","TensorFlow","Session","."]
docstr: Initialize a worker.
docstr_tok: ["Initialize","a","worker","."]
code: def worker_init(self):
      """Initialize a worker."""
      self._sess = tf.compat.v1.get_default_session()
      if not self._sess:
          # create a tf session for all
          # sampler worker processes in
          # order to execute the policy.
          self._sess = tf.compat.v1.Session()
          self._sess_entered = True
          self._sess.__enter__()
  
file_path: garage/src/garage/tf/samplers/worker.py
imports: import tensorflow
  from garage.sampler.worker import Worker
label_desc: Use image node_id 2 for calling the TFWorkerWrapper obj's underlying member method code with example usage: obj.worker_init() without return types