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

changed stack_states from a fn to a classmethod #236

Merged
merged 2 commits into from
Jan 29, 2025

Conversation

Idriss-Malek
Copy link
Contributor

@Idriss-Malek Idriss-Malek commented Jan 29, 2025

Edit by @saleml :
For reference, the idea behind this change, is to allow users who have their own States class (for a specific environment), that has extra attributes, to subclass to stack_states function, in order to allow for the extra attributes to be stacked

Copy link
Collaborator

@saleml saleml left a comment

Choose a reason for hiding this comment

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

Clean and useful. Looks good to me.
Waiting for the tests to pass on github CI.


stacked_states = state_example.from_batch_shape((0, 0)) # Empty.
stacked_states.tensor = torch.stack([s.tensor for s in states], dim=0)
# TODO: do not ignore the next ignore
Copy link
Collaborator

Choose a reason for hiding this comment

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

nice

Copy link
Collaborator

@saleml saleml left a comment

Choose a reason for hiding this comment

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

LGTM

@saleml saleml merged commit 38782ed into GFNOrg:master Jan 29, 2025
4 checks passed
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