03acf3cd9eeaed74b415aaf86178751bd4a212fa,ml/rl/readers/data_streamer.py,,pin_memory,#Any#,137

Before Change


        return batch
    elif dataclasses.is_dataclass(batch):
        return type(batch)(
            **{
                name: pin_memory(value)
                for name, value in dataclasses.asdict(batch).items()
            }
        )
    elif dataclasses.is_dataclass(batch):
        return type(batch)(
            **{

After Change


        retval = dataclasses.replace(
            batch,
            **{
                field.name: pin_memory(getattr(batch, field.name))
                for field in dataclasses.fields(batch)
            }
        )
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: facebookresearch/Horizon
Commit Name: 03acf3cd9eeaed74b415aaf86178751bd4a212fa
Time: 2019-07-16
Author: jjg@fb.com
File Name: ml/rl/readers/data_streamer.py
Class Name:
Method Name: pin_memory


Project Name: facebookresearch/ParlAI
Commit Name: 2d25e783797d0918e30de45ab009c35e847fe20b
Time: 2020-03-23
Author: roller@fb.com
File Name: parlai/agents/transformer/modules.py
Class Name: TransformerDecoder
Method Name: forward


Project Name: descarteslabs/descarteslabs-python
Commit Name: e6211ba0f59e0bd6c71459e9dfbc043d13eb24a8
Time: 2020-12-08
Author: gabe@descarteslabs.com
File Name: descarteslabs/workflows/interactive/parameters.py
Class Name: ParameterSet
Method Name: to_dict


Project Name: facebookresearch/pytext
Commit Name: 64429901d353ea7a1b374b4176f59f580bd36a4f
Time: 2019-06-04
Author: geoffreygoh@fb.com
File Name: pytext/config/serialize.py
Class Name:
Method Name: _union_from_json