ray icon indicating copy to clipboard operation
ray copied to clipboard

[RLlib] `Algorithm.add_policy()` should alternatively accept an already instantiated policy object.

Open sven1977 opened this issue 3 years ago • 0 comments

Signed-off-by: sven1977 [email protected]

Algorithm.add_policy() should alternatively accept an already instantiated policy object.

  • Same for RolloutWorker.add_policy().
  • Enhanced existing test case to cover this behavior.

Why are these changes needed?

Related issue number

Checks

  • [x] I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • [x] I've run scripts/format.sh to lint the changes in this PR.
  • [ ] I've included any doc changes needed for https://docs.ray.io/en/master/.
  • [ ] I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • [ ] Unit tests
    • [ ] Release tests
    • [ ] This PR is not tested :(

sven1977 avatar Sep 20 '22 13:09 sven1977