def _bulid(self, dataset, sess=None):
    self._dataset = dataset
    if self._is_eager:
        self._eager_iterator = tfe.Iterator(dataset)
    else:
        self._iterator = dataset.make_initializable_iterator()
        self._batch_op = self._iterator.get_next()
        if sess:
            self._sess = sess
        else:
            self._sess = session()
    try:
        self.reset()
    except:
        pass
def _bulid(self, dataset, sess=None):
    self._dataset = dataset
    if self._is_eager:
        self._eager_iterator = tfe.Iterator(dataset)
    else:
        self._iterator = dataset.make_initializable_iterator()
        self._batch_op = self._iterator.get_next()
        if sess:
            self._sess = sess
        else:
            self._sess = session()
    try:
        self.reset()
    except:
        pass