47a96974ab2d75fc20c76a6d6da20976ecad32bb,gpytorch/random_variables/random_variable.py,RandomVariable,cpu,#RandomVariable#,16

Before Change



    def cpu(self):
        representation = self.representation()
        if not isinstance(representation, tuple) or isinstance(representation, list):
            representation = representation,
        return self.__class__(*(var.cpu() for var in representation))

    def cuda(self, device_id=None):
        representation = self.representation()

After Change


                new_args.append(arg)
        for name, val in self._kwargs.items():
            if hasattr(val, "cpu"):
                new_kwargs[name] = val.cpu()
            else:
                new_kwargs[name] = val
        return self.__class__(*new_args, **new_kwargs)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 5

Instances


Project Name: cornellius-gp/gpytorch
Commit Name: 47a96974ab2d75fc20c76a6d6da20976ecad32bb
Time: 2017-10-02
Author: gpleiss@gmail.com
File Name: gpytorch/random_variables/random_variable.py
Class Name: RandomVariable
Method Name: cpu


Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 8981dd0ff55b7c9303355aaad4087e1f2a2f2daa
Time: 2021-01-26
Author: beat.buesser@ie.ibm.com
File Name: art/estimators/classification/tensorflow.py
Class Name: TensorFlowV2Classifier
Method Name: __init__


Project Name: dpressel/mead-baseline
Commit Name: da1e8c2de9b265dcb18256a0a087165faf138b42
Time: 2019-01-14
Author: blester125@users.noreply.github.com
File Name: python/baseline/pytorch/seq2seq/model.py
Class Name: EncoderDecoderModelBase
Method Name: predict


Project Name: allenai/allennlp
Commit Name: c6bc7fde370e54312d9fabdeec66818240b6e783
Time: 2017-09-20
Author: markn@allenai.org
File Name: allennlp/models/semantic_role_labeler.py
Class Name: SemanticRoleLabeler
Method Name: decode