Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RLlib] Added dtype to torch deterministic action #29648

Merged
merged 12 commits into from
Oct 25, 2022
7 changes: 5 additions & 2 deletions rllib/models/torch/torch_distributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,11 @@ def sample(

if sample_shape is None:
sample_shape = torch.Size()
loc_shape = self.loc.shape
return torch.ones(sample_shape + loc_shape, device=self.loc.device) * self.loc

device = self.loc.device
dtype = self.loc.dtype
shape = sample_shape + self.loc.shape
return torch.ones(shape, device=device, dtype=dtype) * self.loc

def rsample(
self,
Expand Down