Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass tensordict as an additional input of _precompute_cache #91

Merged
merged 1 commit into from
Sep 11, 2023

Conversation

Junyoungpark
Copy link
Collaborator

Description

Pass td as an additional input of _precompute_cache to allow better flexibility of _precompute_cache in the children classes

Motivation and Context

Types of changes

What types of changes does your code introduce? Remove all that do not apply:

  • New feature (non-breaking change which adds core functionality)

Checklist

  • My change requires a change to the documentation.
  • I have updated the tests accordingly (required for a bug fix or a new feature).
  • I have updated the documentation accordingly.

@codecov
Copy link

codecov bot commented Sep 10, 2023

Codecov Report

Patch coverage is 85.71% of modified lines.

Files Changed Coverage
rl4co/models/zoo/common/autoregressive/decoder.py 85.71%

📢 Thoughts on this report? Let us know!.

@Junyoungpark
Copy link
Collaborator Author

@fedebotu would you take a look at this?
I found passing td as an extra argument for _precompute_cache can be useful to design a subclass of AutoregressivePolicy with the extended features.

@fedebotu
Copy link
Member

I left a minor comment as review - I think it may be useful to substitute the PrecomputedCache into something more TensorDict-like in the future - for instance, TensorClass may do

@Junyoungpark
Copy link
Collaborator Author

I leave the reply comments in the code!
yeah, I agree with the suggestion!

@Junyoungpark Junyoungpark merged commit 4ed3235 into main Sep 11, 2023
20 checks passed
@cbhua cbhua deleted the ar_decoder_refac branch March 8, 2024 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants