Skip to content

Conversation

@tcbegley
Copy link
Contributor

Description

By creating a return value using self.__class__, child classes inheriting from TensorDictSequential will return an instance of the child type rather than TensorDictSequential without us having to redefine select_subsequence.

cf. pytorch/rl#700

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 25, 2022
@vmoens vmoens added the bug Something isn't working label Nov 25, 2022
Copy link
Collaborator

@vmoens vmoens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@vmoens vmoens merged commit 23643a7 into main Nov 25, 2022
@vmoens vmoens deleted the select-subsequence-class branch November 25, 2022 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants