d7eaacb5fe4188f680c19ae26fa5d0074241ebc4,rllib/utils/exploration/random.py,Random,get_torch_exploration_action,#Random#Any#Any#,82

Before Change


                    self.action_space, self.model.model_config))
            // Add a batch dimension.
            if len(action_dist.inputs.shape) == len(req) + 1:
                a = np.expand_dims(a, 0)
            action = torch.from_numpy(a).to(self.device)
        else:
            action = action_dist.deterministic_sample()
        logp = torch.zeros(

After Change


            // Add a batch dimension?
            if len(action_dist.inputs.shape) == len(req) + 1:
                batch_size = action_dist.inputs.shape[0]
                a = np.stack(
                    [self.action_space.sample() for _ in range(batch_size)])
            else:
                a = self.action_space.sample()
            // Convert action to torch tensor.
            action = torch.from_numpy(a).to(self.device)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: ray-project/ray
Commit Name: d7eaacb5fe4188f680c19ae26fa5d0074241ebc4
Time: 2020-05-07
Author: sven@anyscale.io
File Name: rllib/utils/exploration/random.py
Class Name: Random
Method Name: get_torch_exploration_action


Project Name: adalca/neuron
Commit Name: d554a57e7c1a2ca016a14ae2b25f18d7c75cb971
Time: 2019-11-06
Author: adalca@mit.edu
File Name: neuron/layers.py
Class Name: LocalCrossLinear
Method Name: call


Project Name: reinforceio/tensorforce
Commit Name: 788fb1d674ec634f41fa8902b18dbba93d467283
Time: 2018-02-22
Author: svenmika1977@gmail.com
File Name: tensorforce/core/preprocessors/sequence.py
Class Name: Sequence
Method Name: tf_process