Skip to content

Commit

Permalink
[BugFix] densify non tensor stack is a no-op
Browse files Browse the repository at this point in the history
ghstack-source-id: edbc22ce562cd918ce5dd5c0441e47cdadf7d88a
Pull Request resolved: #1194
  • Loading branch information
vmoens committed Jan 30, 2025
1 parent 9b66338 commit f3794ba
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tensordict/tensorclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -3562,6 +3562,10 @@ def _from_list(cls, datalist: List, device: torch.device, ndim: int | None = Non
stack_dim=0,
)

def densify(self, layout: torch.layout = torch.strided):
# No need to do anything with a non tensor stack
return self

def update(
self,
input_dict_or_td: dict[str, CompatibleType] | T,
Expand Down

0 comments on commit f3794ba

Please sign in to comment.