0cecfbb6929c9f9b447d5d75a76b362f20a371cf,tensorpack/dataflow/serialize.py,TFRecordSerializer,save,#Any#Any#,147

Before Change


            df (DataFlow): the DataFlow to serialize.
            path (str): output tfrecord file.
        
        if os.environ.get("TENSORPACK_COMPATIBLE_SERIALIZE", "msgpack") == "msgpack":
            def _dumps(dp):
                return dumps(dp)
        else:

After Change


        size = _reset_df_and_get_size(df)
        with tf.python_io.TFRecordWriter(path) as writer, get_tqdm(total=size) as pbar:
            for dp in df:
                writer.write(dumps(dp))
                pbar.update()

    @staticmethod
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: tensorpack/tensorpack
Commit Name: 0cecfbb6929c9f9b447d5d75a76b362f20a371cf
Time: 2019-05-24
Author: ppwwyyxx@users.noreply.github.com
File Name: tensorpack/dataflow/serialize.py
Class Name: TFRecordSerializer
Method Name: save


Project Name: kengz/SLM-Lab
Commit Name: 901cc588fee90215d2e2831bd4a3e7481b307ba7
Time: 2018-06-18
Author: kengzwl@gmail.com
File Name: slm_lab/lib/viz.py
Class Name:
Method Name: save_image


Project Name: interactiveaudiolab/nussl
Commit Name: f9541adcd1b41bab5ab2cecfb60b572c4adbdcf1
Time: 2020-08-24
Author: eth@nmanilow.com
File Name: nussl/core/migration.py
Class Name: SafeModelLoader
Method Name: load