File tree 2 files changed +12
-0
lines changed
torchrl/data/replay_buffers
2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -207,3 +207,11 @@ def state_dict(self):
207
207
208
208
def __len__ (self ):
209
209
return ray .get (self ._rb .__len__ .remote ())
210
+
211
+ @property
212
+ def write_count (self ):
213
+ return ray .get (self ._rb ._getattr .remote ("write_count" ))
214
+
215
+ @property
216
+ def dim_extend (self ):
217
+ return ray .get (self ._rb ._getattr .remote ("dim_extend" ))
Original file line number Diff line number Diff line change @@ -447,6 +447,10 @@ def __len__(self) -> int:
447
447
with self ._replay_lock :
448
448
return len (self ._storage )
449
449
450
+ def _getattr (self , attr ):
451
+ # To access properties in remote settings, see RayReplayBuffer.write_count for instance
452
+ return getattr (self , attr )
453
+
450
454
@property
451
455
def write_count (self ):
452
456
"""The total number of items written so far in the buffer through add and extend."""
You can’t perform that action at this time.
0 commit comments