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

Module: Implement for Tuple #1046

Closed
dcvz opened this issue Dec 4, 2023 · 3 comments
Closed

Module: Implement for Tuple #1046

dcvz opened this issue Dec 4, 2023 · 3 comments
Labels
enhancement Enhance existing features

Comments

@dcvz
Copy link
Contributor

dcvz commented Dec 4, 2023

Feature description

Implementing Module support for Tuple

Feature motivation

Would allow syntax such as:

#[derive(Module, Debug)]
pub struct UNetMidBlock2D<B: Backend> {
    resnet: ResnetBlock2D<B>,
    attn_resnets: Vec<(AttentionBlock<B>, ResnetBlock2D<B>)>,
}

Workaround

Use struct instead of tuple.

@antimora antimora added the enhancement Enhance existing features label Dec 5, 2023
@antimora
Copy link
Collaborator

antimora commented Dec 5, 2023

Would a workaround of using struct work in this case? Suggesting in case if someone is stuck on this issue.

@dcvz
Copy link
Contributor Author

dcvz commented Dec 5, 2023

Would a workaround of using struct work in this case? Suggesting in case if someone is stuck on this issue.

Yup! That’s the workaround I’ve gone with but raised the issue after a conversation with Nathaniel.

@varonroy varonroy mentioned this issue Jan 28, 2024
2 tasks
@antimora
Copy link
Collaborator

Done via #1186

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhance existing features
Projects
None yet
Development

No branches or pull requests

2 participants