class_docstr: The base trainer class. Given an object of `hparams`, a trainer
  creates and initializes a model. After initialization, the method
  `model_train` can be used to train the model.
class_docstr_tok: ["The","base","trainer","class",".","Given","an","object","of","`","hparams","`",",","a","trainer","creates","and","initializes","a","model",".","After","initialization",",","the","method","`","model_train","`","can","be","used","to","train","the","model","."]
code: def _init_session(self):
      # Set TF random seed to improve reproducibility
      self.rng = np.random.RandomState([2017, 8, 30])
      tf.set_random_seed(1234)
  
      # Create TF session
      self.sess = tf.Session(
          config=tf.ConfigProto(allow_soft_placement=True)
      )
  
      # Object used to keep track of (and return) key accuracies
      if self.hparams.save:
          self.writer = tf.summary.FileWriter(
              self.hparams.save_dir, flush_secs=10
          )
      else:
          self.writer = None
  
imports: from collections import OrderedDict
  import logging
  import math
  import time
  import os
  import numpy
  import six
  import tensorflow
  from cleverhans.utils_tf import batch_indices
  from cleverhans.utils_mnist import data_mnist
  import utils_cifar
  import utils_svhn
  from utils import preprocess_batch
  from make_model import make_model
  from evaluator import Evaluator
  from evaluator import create_adv_by_name
  from model import clone_variable
label_desc: Use image node_id 2 for calling the TrainManager obj's underlying member method code with example usage: obj._init_session() without return types