5537fe13b097097668f9c08a00051e8b7a2d1980,rllib/utils/exploration/random.py,Random,get_torch_exploration_action,#Random#Any#Any#,83

Before Change


        if explore:
            // Unsqueeze will be unnecessary, once we support batch/time-aware
            // Spaces.
            action = tensor_fn(self.action_space.sample()).unsqueeze(0)
        else:
            action = tensor_fn(action_dist.deterministic_sample())
        logp = torch.zeros((action.size()[0], ), dtype=torch.float32)
        return action, logp

After Change


            // Unsqueeze will be unnecessary, once we support batch/time-aware
            // Spaces.
            a = self.action_space.sample()
            action = tensor_fn([a] if isinstance(a, int) else a)
        else:
            action = tensor_fn(action_dist.deterministic_sample())
        logp = torch.zeros((action.size()[0], ), dtype=torch.float32)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: ray-project/ray
Commit Name: 5537fe13b097097668f9c08a00051e8b7a2d1980
Time: 2020-04-03
Author: sven@anyscale.io
File Name: rllib/utils/exploration/random.py
Class Name: Random
Method Name: get_torch_exploration_action


Project Name: cornellius-gp/gpytorch
Commit Name: 24e8113e9a73fa3662fb616a231007deee1f35ac
Time: 2018-08-05
Author: jrg365@cornell.edu
File Name: gpytorch/kernels/multitask_kernel.py
Class Name: MultitaskKernel
Method Name: forward_diag


Project Name: OpenNMT/OpenNMT-py
Commit Name: 3bb62b0838e580201810095961db156f45368c6e
Time: 2018-12-08
Author: guillaume.klein@systrangroup.com
File Name: onmt/decoders/decoder.py
Class Name: RNNDecoderBase
Method Name: forward