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

Before Change


            }
        )
    elif dataclasses.is_dataclass(batch):
        return type(batch)(
            **{
                name: pin_memory(value)
                for name, value in dataclasses.asdict(batch).items()
            }
        )
    elif isinstance(batch, collections.Mapping):
        // NB: preserving OrderedDict
        return type(batch)((k, pin_memory(sample)) for k, sample in batch.items())
    elif isinstance(batch, collections.Sequence):

After Change


    elif isinstance(batch, string_classes):
        return batch
    elif dataclasses.is_dataclass(batch):
        retval = dataclasses.replace(
            batch,
            **{
                field.name: pin_memory(getattr(batch, field.name))
                for field in dataclasses.fields(batch)
            }
        )
        return retval
    elif isinstance(batch, collections.Mapping):
        // NB: preserving OrderedDict
        return type(batch)((k, pin_memory(sample)) for k, sample in batch.items())
    elif isinstance(batch, collections.Sequence):
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: quantumlib/Cirq
Commit Name: 2c904da84273fdc25b5c97070b66483401669e1a
Time: 2021-02-10
Author: mrwojtek@google.com
File Name: cirq/google/calibration/engine_simulator.py
Class Name: PhasedFSimEngineSimulator
Method Name: create_gate_with_drift


Project Name: jsalt18-sentence-repl/jiant
Commit Name: 5cbddfddff41474424f13f0c641e569fbcca7458
Time: 2020-05-21
Author: email@jasonphang.com
File Name: jiant/utils/python/datastructures.py
Class Name: ExtendedDataClassMixin
Method Name: to_dict


Project Name: tensorflow/datasets
Commit Name: 82f1ecfef392a433670c17123649184ab94c843c
Time: 2020-12-11
Author: epot@google.com
File Name: tensorflow_datasets/core/utils/shard_utils.py
Class Name: FileInstruction
Method Name: replace