Skip to content

Commit

Permalink
[Feature] Composite.batch_size
Browse files Browse the repository at this point in the history
ghstack-source-id: 621884a559a71e80a4be36c7ba984fd08be47952
Pull Request resolved: #2597
  • Loading branch information
vmoens committed Nov 24, 2024
1 parent 097d8ad commit 2e82cab
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions torchrl/data/tensor_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4257,6 +4257,14 @@ def __new__(cls, *args, **kwargs):
cls._locked = False
return super().__new__(cls)

@property
def batch_size(self):
return self._shape

@batch_size.setter
def batch_size(self, value: torch.Size):
self._shape = value

@property
def shape(self):
return self._shape
Expand Down

0 comments on commit 2e82cab

Please sign in to comment.