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 040165c commit eb9a37dCopy full SHA for eb9a37d
torchrl/data/replay_buffers/storages.py
@@ -5,6 +5,7 @@
5
6
import abc
7
import os
8
+import warnings
9
from collections import OrderedDict
10
from copy import copy
11
from typing import Any, Dict, Sequence, Union
@@ -333,6 +334,11 @@ def load_state_dict(self, state_dict):
333
334
self._storage.load_state_dict(_storage)
335
self._storage.memmap_()
336
elif self._storage is None:
337
+ warnings.warn(
338
+ "Loading the storage on an uninitialized TensorDict."
339
+ "It is preferable to load a storage onto a"
340
+ "pre-allocated one whenever possible."
341
+ )
342
self._storage = TensorDict({}, []).load_state_dict(_storage)
343
344
else:
0 commit comments