File tree Expand file tree Collapse file tree 3 files changed +6
-10
lines changed Expand file tree Collapse file tree 3 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -1791,6 +1791,10 @@ def test_batch_errors():
1791
1791
1792
1792
1793
1793
def test_add_warning ():
1794
+ from torchrl ._utils import RL_WARNINGS
1795
+
1796
+ if not RL_WARNINGS :
1797
+ return
1794
1798
rb = ReplayBuffer (storage = ListStorage (10 ), batch_size = 3 )
1795
1799
with pytest .warns (
1796
1800
UserWarning ,
Original file line number Diff line number Diff line change @@ -1219,15 +1219,6 @@ def append(
1219
1219
f"The new history to append must have one less dimension than self. Got self.ndim={ self .ndim } and history.ndim={ history .ndim } ."
1220
1220
)
1221
1221
dim = _maybe_correct_neg_dim (dim , self .batch_size )
1222
- # if self.ndim > 1 and dim >= self.ndim - 1:
1223
- # # then we need to append each element independently
1224
- # result = []
1225
- # for hist, new_hist in zip(self.unbind(0), history.unbind(0)):
1226
- # hist_c = hist.append(new_hist, inplace=inplace, dim=dim - 1)
1227
- # result.append(hist_c)
1228
- # if inplace:
1229
- # return self
1230
- # return lazy_stack(result)
1231
1222
if inplace :
1232
1223
if (
1233
1224
isinstance (self ._tensordict , LazyStackedTensorDict )
Original file line number Diff line number Diff line change @@ -1843,7 +1843,7 @@ def _step_no_buffers(
1843
1843
if self .consolidate :
1844
1844
try :
1845
1845
data = tensordict .consolidate (
1846
- share_memory = True , inplace = True , num_threads = 1
1846
+ share_memory = True , inplace = False , num_threads = 1
1847
1847
)
1848
1848
except Exception as err :
1849
1849
raise RuntimeError (_CONSOLIDATE_ERR_CAPTURE ) from err
@@ -2677,6 +2677,7 @@ def _run_worker_pipe_direct(
2677
2677
# data = data[idx]
2678
2678
data , reset_kwargs = data
2679
2679
if data is not None :
2680
+ data .unlock_ ()
2680
2681
data ._fast_apply (
2681
2682
lambda x : x .clone () if x .device .type == "cuda" else x , out = data
2682
2683
)
You can’t perform that action at this time.
0 commit comments