Skip to content

Commit

Permalink
[Quality] Warn if the sampler is not prioritized but update_priority …
Browse files Browse the repository at this point in the history
…is called (pytorch#2253)
  • Loading branch information
vmoens authored Jun 27, 2024
1 parent 353c897 commit 1083b35
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions torchrl/data/replay_buffers/samplers.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ def update_priority(
*,
storage: Storage | None = None,
) -> dict | None:
warnings.warn(
f"Calling update_priority() on a sampler {type(self).__name__} that is not prioritized. Make sure this is the indented behaviour."
)
return

def mark_update(
Expand Down

0 comments on commit 1083b35

Please sign in to comment.