428516056abe41f135133e732a8d44af6ce9a234,rllib/utils/exploration/random.py,Random,get_torch_exploration_action,#Random#Any#Any#,83

Before Change



    def get_torch_exploration_action(self, action_dist, explore):
        tensor_fn = torch.LongTensor if \
            type(self.action_space) in [Discrete, MultiDiscrete] else \
            torch.FloatTensor
        if explore:
            // Unsqueeze will be unnecessary, once we support batch/time-aware

After Change


            // 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(
            (action.size()[0], ), dtype=torch.float32, device=self.device)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

Instances


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


Project Name: kevinzakka/recurrent-visual-attention
Commit Name: a38ac8958ebf1c61a10c4d5320f1e31d3d0b73dd
Time: 2020-05-23
Author: kevinarmandzakka@gmail.com
File Name: trainer.py
Class Name: Trainer
Method Name: reset


Project Name: arraiy/torchgeometry
Commit Name: dac6839364405ff932bc33a5ca7845cba4f8b4ce
Time: 2019-10-07
Author: edgar.riba@gmail.com
File Name: kornia/color/adjust.py
Class Name:
Method Name: adjust_brightness


Project Name: jadore801120/attention-is-all-you-need-pytorch
Commit Name: 0b0eabbfd972c9e3f6323bff9d39ac5fc3ba9cc7
Time: 2018-08-23
Author: yhhuang@nlg.csie.ntu.edu.tw
File Name: transformer/Translator.py
Class Name: Translator
Method Name: translate_batch