36bda8432b2ed23f623c8c3031b2cba148bec93b,rllib/policy/torch_policy.py,TorchPolicy,__init__,#,45

Before Change


        self.model = model.to(self.device)
        // Combine view_requirements for Model and Policy.
        self.training_view_requirements = dict(
            **{
                SampleBatch.ACTIONS: ViewRequirement(
                    space=self.action_space, shift=0),
                SampleBatch.REWARDS: ViewRequirement(shift=0),
                SampleBatch.DONES: ViewRequirement(shift=0),
            },
            **self.model.inference_view_requirements)

        self.exploration = self._create_exploration()

After Change


            self.device = torch.device("cpu")
        self.model = model.to(self.device)
        // Combine view_requirements for Model and Policy.
        self.view_requirements.update(self.model.inference_view_requirements)

        self.exploration = self._create_exploration()
        self.unwrapped_model = model  // used to support DistributedDataParallel
        self._loss = loss
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: ray-project/ray
Commit Name: 36bda8432b2ed23f623c8c3031b2cba148bec93b
Time: 2020-10-01
Author: sven@anyscale.io
File Name: rllib/policy/torch_policy.py
Class Name: TorchPolicy
Method Name: __init__


Project Name: home-assistant/home-assistant
Commit Name: fc4dd4e51f634f3305facc5f57915cbe0ac2c4ca
Time: 2018-11-19
Author: danielperna84@gmail.com
File Name: homeassistant/components/light/homematic.py
Class Name: HMLight
Method Name: _init_data_struct


Project Name: home-assistant/home-assistant
Commit Name: 3188f796f9deed2310ba372b2e8d0ad35dc1e3ef
Time: 2021-03-25
Author: erik@montnemery.com
File Name: homeassistant/components/cast/config_flow.py
Class Name: FlowHandler
Method Name: async_step_import