24bf6ad607b491fc28c83b930e7cec927599d73f,python/ray/util/sgd/torch/distributed_torch_runner.py,DistributedTorchRunner,_setup_training,#DistributedTorchRunner#,68

Before Change


            self.models = [self.models]
        assert all(isinstance(model, nn.Module) for model in self.models), (
            "All models must be PyTorch models: {}.".format(self.models))
        if torch.cuda.is_available():
            self.models = [model.cuda() for model in self.models]

        logger.debug("Creating optimizer.")

After Change


            self.models = [self.models]
        assert all(isinstance(model, nn.Module) for model in self.models), (
            "All models must be PyTorch models: {}.".format(self.models))
        if self.use_gpu and torch.cuda.is_available():
            self.models = [model.cuda() for model in self.models]

        logger.debug("Creating optimizer.")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

Instances


Project Name: ray-project/ray
Commit Name: 24bf6ad607b491fc28c83b930e7cec927599d73f
Time: 2020-04-01
Author: rliaw@berkeley.edu
File Name: python/ray/util/sgd/torch/distributed_torch_runner.py
Class Name: DistributedTorchRunner
Method Name: _setup_training


Project Name: ray-project/ray
Commit Name: d192ef06119f3eccf569a844b30976db99cfa0f6
Time: 2020-03-10
Author: rliaw@berkeley.edu
File Name: python/ray/util/sgd/torch/torch_runner.py
Class Name: TorchRunner
Method Name: _create_loss


Project Name: ray-project/ray
Commit Name: 24bf6ad607b491fc28c83b930e7cec927599d73f
Time: 2020-04-01
Author: rliaw@berkeley.edu
File Name: python/ray/util/sgd/torch/torch_runner.py
Class Name: TorchRunner
Method Name: setup


Project Name: ray-project/ray
Commit Name: 8204717eed71923f1e14fa6bd17ca4588c140c09
Time: 2020-07-16
Author: sven@anyscale.io
File Name: rllib/policy/torch_policy.py
Class Name: TorchPolicy
Method Name: __init__