We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c7d4764 commit d93551dCopy full SHA for d93551d
torchrl/data/replay_buffers/storages.py
@@ -340,7 +340,9 @@ def set( # noqa: F811
340
self._init(data)
341
if not isinstance(cursor, (*INT_CLASSES, slice)):
342
if not isinstance(cursor, torch.Tensor):
343
- cursor = torch.tensor(cursor)
+ cursor = torch.tensor(cursor, dtype=torch.long)
344
+ elif cursor.dtype != torch.long:
345
+ cursor = cursor.to(dtype=torch.long)
346
if len(cursor) > len(self._storage):
347
warnings.warn(
348
"A cursor of length superior to the storage capacity was provided. "
0 commit comments