8c4dd89b40febc9d2493b7410aac530b6968ce70,gluonnlp/data/stream.py,_LanguageModelBPTTStream,__iter__,#_LanguageModelBPTTStream#,418

Before Change


        data = np.empty([self._batch_size, self._seq_len], dtype=np.float32)
        target = np.empty([self._batch_size, self._seq_len], dtype=np.float32)
        mask = np.empty([self._batch_size, self._seq_len], dtype=np.float32)
        corpus = iter(self._corpus)

        while has_next or has_token_buffered:
            _init(data, target, mask, self._padding_idx)
            has_token_buffered = False

After Change


        target = np.empty([self._batch_size, self._seq_len], dtype=np.float32)
        mask = np.empty([self._batch_size, self._seq_len], dtype=np.float32)
        corpus = itertools.chain.from_iterable(
            (corpus_dataset[idx] for idx in self._sampler(len(corpus_dataset)))
            for corpus_dataset in self._corpus)

        while has_next or has_token_buffered:
            _init(data, target, mask, self._padding_idx)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: dmlc/gluon-nlp
Commit Name: 8c4dd89b40febc9d2493b7410aac530b6968ce70
Time: 2018-08-04
Author: leonard@lausen.nl
File Name: gluonnlp/data/stream.py
Class Name: _LanguageModelBPTTStream
Method Name: __iter__


Project Name: PetrochukM/PyTorch-NLP
Commit Name: dd2eaf6c174fdd757514bc06d1063e5f9c6bb4a0
Time: 2019-10-20
Author: petrochukm@gmail.com
File Name: torchnlp/samplers/noisy_sorted_sampler.py
Class Name: NoisySortedSampler
Method Name: __iter__


Project Name: pyannote/pyannote-audio
Commit Name: c2481d699dcaeb93421f87a747d74781bd5edbda
Time: 2020-01-08
Author: bredin@limsi.fr
File Name: pyannote/audio/embedding/extraction.py
Class Name: SequenceEmbedding
Method Name: apply


Project Name: senarvi/theanolm
Commit Name: 0816c636b7d7832a0177a08a08888840d717bed4
Time: 2017-01-24
Author: seppo.git@marjaniemi.com
File Name: theanolm/scoring/textscorer.py
Class Name: TextScorer
Method Name: score_batch