Skip to content

Commit 41a0c39

Browse files
add back function
1 parent 4de0dce commit 41a0c39

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/samplers.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,3 +229,12 @@ function StatsBase.sample(s::NStepBatchSampler{names}, e::EpisodesBuffer{<:Any,
229229
StatsBase.sample(s, t.traces, Val(names), inds)
230230
)
231231
end
232+
233+
function StatsBase.sample(s::NStepBatchSampler{names}, t::CircularPrioritizedTraces}) where {names}
234+
inds, priorities = rand(s.rng, t.priorities, s.batch_size)
235+
236+
merge(
237+
(key=t.keys[inds], priority=priorities),
238+
StatsBase.sample(s, t.traces, Val(names), inds)
239+
)
240+
end

0 commit comments

Comments
 (0)