(self, batch, data, fast=False)
Translate a batch of sentences.

        Mostly a wrapper around :obj:`Beam`.

        Args:
           batch (:obj:`Batch`): a batch from a dataset object
           data (:obj:`Dataset`): the dataset object
           fast (bool): enables fast beam search (may not support all features)

        Todo:
           Shouldn't need the original dataset.
Translate a batch of sentences.
Translate a batch of sentences .
def translate_batch(self, batch, data, fast=False):
        """
        Translate a batch of sentences.

        Mostly a wrapper around :obj:`Beam`.

        Args:
           batch (:obj:`Batch`): a batch from a dataset object
           data (:obj:`Dataset`): the dataset object
           fast (bool): enables fast beam search (may not support all features)

        Todo:
           Shouldn't need the original dataset.
        """


        with torch.no_grad():
            if fast:
                return self._fast_translate_batch(
                    batch,
                    data,
                    self.max_length,
                    min_length=self.min_length,
                    n_best=self.n_best,
                    return_attention=self.replace_unk)
            else:
                # 2333: go here
                return self._translate_batch(batch, data)
def translate_batch ( self , batch , data , fast = False ) : with torch . no_grad ( ) : if fast : return self . _fast_translate_batch ( batch , data , self . max_length , min_length = self . min_length , n_best = self . n_best , return_attention = self . replace_unk ) else : # 2333: go here return self . _translate_batch ( batch , data )