Skip to content

Commit

Permalink
[BugFix] Fix sampling in NonTensorSpec (#2172)
Browse files Browse the repository at this point in the history
  • Loading branch information
vmoens committed May 26, 2024
1 parent a93063b commit 78b4717
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions torchrl/data/tensor_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1953,21 +1953,21 @@ def rand(self, shape=None):
if shape is None:
shape = ()
return NonTensorData(
data=None, batch_size=(*shape, self.shape), device=self.device
data=None, batch_size=(*shape, *self.shape), device=self.device
)

def zero(self, shape=None):
if shape is None:
shape = ()
return NonTensorData(
data=None, batch_size=(*shape, self.shape), device=self.device
data=None, batch_size=(*shape, *self.shape), device=self.device
)

def one(self, shape=None):
if shape is None:
shape = ()
return NonTensorData(
data=None, batch_size=(*shape, self.shape), device=self.device
data=None, batch_size=(*shape, *self.shape), device=self.device
)

def is_in(self, val: torch.Tensor) -> bool:
Expand Down

0 comments on commit 78b4717

Please sign in to comment.