Fix non-used device argument in to_torch conversion (#1107)

This commit is contained in:
Mantas
2024-07-03 10:16:52 +01:00
committed by GitHub
parent 57136fbaee
commit 6b22fd5534
2 changed files with 4 additions and 4 deletions

View File

@@ -94,9 +94,9 @@ def _numpy_iterable_to_torch(
if hasattr(value, "_make"):
# namedtuple - underline used to prevent potential name conflicts
# noinspection PyProtectedMember
return type(value)._make(numpy_to_torch(v) for v in value)
return type(value)._make(numpy_to_torch(v, device) for v in value)
else:
return type(value)(numpy_to_torch(v) for v in value)
return type(value)(numpy_to_torch(v, device) for v in value)
class NumpyToTorch(gym.Wrapper, gym.utils.RecordConstructorArgs):