Skip to content

Commit

Permalink
[BugFix] calling pad with immutable sequence (#1075)
Browse files Browse the repository at this point in the history
  • Loading branch information
SamAdamDay authored Nov 6, 2024
1 parent 6272510 commit 760c537
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tensordict/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def pad(tensordict: T, pad_size: Sequence[int], value: float = 0.0) -> T:
for i in range(len(pad_size)):
new_batch_size[i // 2] += pad_size[i]

reverse_pad = pad_size[::-1]
reverse_pad = list(pad_size[::-1])
for i in range(0, len(reverse_pad), 2):
reverse_pad[i], reverse_pad[i + 1] = reverse_pad[i + 1], reverse_pad[i]

Expand Down

0 comments on commit 760c537

Please sign in to comment.