428516056abe41f135133e732a8d44af6ce9a234,rllib/utils/exploration/random.py,Random,get_torch_exploration_action,#Random#Any#Any#,83
Before Change
return action, logp
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
// Spaces.
a = self.action_space.sample()
After Change
action_dist.required_model_output_shape(
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(

In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
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: deepmipt/DeepPavlov
Commit Name: 1a6d4020c53e2b39e224616481528fad901cbd4e
Time: 2018-10-15
Author: yoptar@gmail.com
File Name: deeppavlov/core/commands/infer.py
Class Name:
Method Name: predict_on_stream
Project Name: microsoft/nni
Commit Name: b7366b685afdde156e551f8ba5008857f789e368
Time: 2019-02-11
Author: 871886504@qq.com
File Name: tools/nni_annotation/code_generator.py
Class Name:
Method Name: test_variable_equal