-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Labels
featureIs an improvement or enhancementIs an improvement or enhancementneeds triageWaiting to be triaged by maintainersWaiting to be triaged by maintainers
Description
Description & Motivation
I have a very similar use case to the one outlined in this issue: #19311 . Different from that, I would like to return a TensorDict
(see https://github.com/pytorch/tensordict/) from a training_step
. The check inside
if isinstance(training_step_output, dict): |
dict
, but I think it should be a little more flexible to allow a TensorDict
.
Pitch
I can imaging having to specify tensordict
as a requirement is not preferable, so rather than isinstance(training_step_output, [dict, TensorDict])
, I think checking if training_step_output
has a keys
attribute could work nicely.
Alternatives
No response
Additional context
No response
Metadata
Metadata
Assignees
Labels
featureIs an improvement or enhancementIs an improvement or enhancementneeds triageWaiting to be triaged by maintainersWaiting to be triaged by maintainers