File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
torchrl/data/replay_buffers Expand file tree Collapse file tree 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):
207207
208208 def __len__ (self ):
209209 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:
447447 with self ._replay_lock :
448448 return len (self ._storage )
449449
450+ def _getattr (self , attr ):
451+ # To access properties in remote settings, see RayReplayBuffer.write_count for instance
452+ return getattr (self , attr )
453+
450454 @property
451455 def write_count (self ):
452456 """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