rl icon indicating copy to clipboard operation
rl copied to clipboard

[Feature Request] Make sure that all losses work with tensorclasses and regular tensors

Open vmoens opened this issue 2 years ago • 2 comments

Motivation

We should add tests for all losses with

  • [ ] tensors passed via tensordict.nn.dispatch. This should be accompanied by an example in the docstrings of how to use the losses without tensordict.
  • [ ] Similarly, it should be easy to pass regular nn.Modules to the losses (eg an actor that reads an obs and outputs an action, a qvalue that reads an obs and an action and outputs a value, etc).
  • [ ] We also need to check that losses work with tensorclasses. This essentially requires us to check that no __getitem__ is used for get(key), ie the latter should always be preferred. Tests should all include a tensorclass version.

vmoens avatar Apr 15 '23 16:04 vmoens

hey @vmoens is this still a relevant issue? if so i can look into it this weekend

andrewldesousa avatar Jan 30 '25 03:01 andrewldesousa

Yeah I don't think we really test that!

vmoens avatar Jan 30 '25 04:01 vmoens