mirror of
https://github.com/vale981/ray
synced 2025-03-06 02:21:39 -05:00
[RLlib] RepayBuffer: _hit_counts
working again. (#23586)
This commit is contained in:
parent
0b3a79ca41
commit
02a50f02b7
1 changed files with 5 additions and 2 deletions
|
@ -280,10 +280,13 @@ class ReplayBuffer:
|
|||
|
||||
def _encode_sample(self, idxes: List[int]) -> SampleBatchType:
|
||||
"""Fetches concatenated samples at given indeces from the storage."""
|
||||
samples = [self._storage[i] for i in idxes]
|
||||
samples = []
|
||||
for i in idxes:
|
||||
self._hit_count[i] += 1
|
||||
samples.append(self._storage[i])
|
||||
|
||||
if samples:
|
||||
# Assume all samples are of same type
|
||||
# We assume all samples are of same type
|
||||
sample_type = type(samples[0])
|
||||
out = sample_type.concat_samples(samples)
|
||||
else:
|
||||
|
|
Loading…
Add table
Reference in a new issue