class_docstr: Data iterator that iterates through **multiple** datasets and switches
  between datasets.
  
  The iterator can switch to a dataset and resume from where we
  left off last time we visited the dataset. This is a wrapper of TF
  feedable :tf_main:`iterator <data/Iterator>`.
  
  Args:
      datasets: Datasets to iterates through. This can be:
  
          - A single instance of :tf_main:`tf.data.Dataset <data/Dataset>`             or instance of subclass of :class:`~texar.tf.data.DataBase`.
          - A `dict` that maps dataset name to             instance of :tf_main:`tf.data.Dataset <data/Dataset>` or             subclass of :class:`~texar.tf.data.DataBase`.
          - A `list` of instances of subclasses of             :class:`texar.tf.data.DataBase`. The name of instances             (:attr:`texar.tf.data.DataBase.name`) must be unique.
  
  Example:
  
      .. code-block:: python
  
          train_data = MonoTextData(hparams={'num_epochs': 200, ...})
          test_data = MonoTextData(hparams_test)
          iterator = FeedableDataIterator({'train': train_data,
                                           'test': test_data})
          batch = iterator.get_next()
  
          sess = tf.Session()
  
          def _eval_epoch(): # Iterate through test data for one epoch
              # Initialize and start from beginning of test data
              iterator.initialize_dataset(sess, 'test')
              while True:
                  try:
                      fetch_dict = { # Read from test data
                          iterator.handle: Iterator.get_handle(sess, 'test')
                      }
                      test_batch_ = sess.run(batch, feed_dict=feed_dict)
                  except tf.errors.OutOfRangeError:
                      print("End of val epoch.")
  
          # Initialize and start from beginning of training data
          iterator.initialize_dataset(sess, 'train')
          step = 0
          while True:
              try:
                  fetch_dict = { # Read from training data
                      iterator.handle: Iterator.get_handle(sess, 'train')
                  }
                  train_batch_ = sess.run(batch, fetch_dict=fetch_dict)
  
                  step +=1
                  if step % 200 == 0: # Evaluate periodically
                      _eval_epoch()
              except tf.errors.OutOfRangeError:
                  print("End of training.")
class_docstr_tok: ["Data","iterator","that","iterates","through","*","*","multiple","*","*","datasets","and","switches","between","datasets",".","The","iterator","can","switch","to","a","dataset","and","resume","from","where","we","left","off","last","time","we","visited","the","dataset",".","This","is","a","wrapper","of","TF","feedable",":","tf_main",":","`","iterator","<","data\/Iterator",">","`",".","Args",":","datasets",":","Datasets","to","iterates","through",".","This","can","be",":","-","A","single","instance","of",":","tf_main",":","`","tf.data.Dataset","<","data\/Dataset",">","`","or","instance","of","subclass","of",":","class",":","`","~texar.tf.data.DataBase","`",".","-","A","`","dict","`","that","maps","dataset","name","to","instance","of",":","tf_main",":","`","tf.data.Dataset","<","data\/Dataset",">","`","or","subclass","of",":","class",":","`","~texar.tf.data.DataBase","`",".","-","A","`","list","`","of","instances","of","subclasses","of",":","class",":","`","texar.tf.data.DataBase","`",".","The","name","of","instances","(",":","attr",":","`","texar.tf.data.DataBase.name","`",")","must","be","unique",".","Example",":","..","code-block",":",":","python","train_data","=","MonoTextData","(","hparams=","{","'num_epochs","'",":","200",",","...","}",")","test_data","=","MonoTextData","(","hparams_test",")","iterator","=","FeedableDataIterator","(","{","'train","'",":","train_data",",","'test","'",":","test_data","}",")","batch","=","iterator.get_next","(",")","sess","=","tf.Session","(",")","def","_eval_epoch","(",")",":","#","Iterate","through","test","data","for","one","epoch","#","Initialize","and","start","from","beginning","of","test","data","iterator.initialize_dataset","(","sess",",","'test","'",")","while","True",":","try",":","fetch_dict","=","{","#","Read","from","test","data","iterator.handle",":","Iterator.get_handle","(","sess",",","'test","'",")","}","test_batch_","=","sess.run","(","batch",",","feed_dict=feed_dict",")","except","tf.errors.OutOfRangeError",":","print","(","``","End","of","val","epoch",".","''",")","#","Initialize","and","start","from","beginning","of","training","data","iterator.initialize_dataset","(","sess",",","'train","'",")","step","=","0","while","True",":","try",":","fetch_dict","=","{","#","Read","from","training","data","iterator.handle",":","Iterator.get_handle","(","sess",",","'train","'",")","}","train_batch_","=","sess.run","(","batch",",","fetch_dict=fetch_dict",")","step","+=1","if","step","%","200","==","0",":","#","Evaluate","periodically","_eval_epoch","(",")","except","tf.errors.OutOfRangeError",":","print","(","``","End","of","training",".","''",")"]
docstr: The handle placeholder that can be fed with a dataset handle to
  fetch data from the dataset.
docstr_tok: ["The","handle","placeholder","that","can","be","fed","with","a","dataset","handle","to","fetch","data","from","the","dataset","."]
code: def handle(self):
      """The handle placeholder that can be fed with a dataset handle to
      fetch data from the dataset.
      """
      return self._handle
  
imports: import tensorflow
  from texar.tf.data.data.data_base import DataBase
  from texar.tf.utils.variables import get_unique_named_variable_scope
label_desc: Use image node_id 6 for calling the FeedableDataIterator obj's underlying member method code with example usage: obj.handle() and returns: self