715269b0a1e79025018f3f22cd972a714b59f4fb,api-examples/transformer_utils.py,MultiTFRecordLoader,__iter__,#MultiTFRecordLoader#,522

Before Change


                for d in itr:
                    if "y" in d.keys():
                        // d["x"] is in np.int32, but pytorch require np.int64
                        yield np.array(d["x"], dtype=int), np.array(d["y"], dtype=int)
                    else:
                        yield np.array(d["x"], dtype=int), np.array(d["x"], dtype=int)

After Change


                    // not sure about the optimal choice of shuffle_queue_size here:
                    itr = self.tfrecord.iterator_utils.shuffle_iterator(itr, queue_size=128)
                for d in itr:
                    yield np.array(d[self.x], dtype=int), np.array(d[self.y], dtype=int)

class MultiFileDatasetReader:
    Provide a base-class to do operations that are independent of token representation
    
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: dpressel/mead-baseline
Commit Name: 715269b0a1e79025018f3f22cd972a714b59f4fb
Time: 2021-01-15
Author: dpressel@gmail.com
File Name: api-examples/transformer_utils.py
Class Name: MultiTFRecordLoader
Method Name: __iter__


Project Name: dmlc/gluon-nlp
Commit Name: 205acce13a83b30eabd7a638e4773e7a4f91059a
Time: 2018-11-02
Author: leonard@lausen.nl
File Name: gluonnlp/data/batchify/embedding.py
Class Name: _EmbeddingCenterContextBatchify
Method Name: __iter__


Project Name: scipy/scipy
Commit Name: 19a50bcafb6d6d47e33af36c2cd4375961f65b85
Time: 2013-08-09
Author: blake.a.griffith@gmail.com
File Name: scipy/sparse/tests/test_base.py
Class Name: _TestSlicing
Method Name: test_slicing_3