burn
burn copied to clipboard
Module: Implement for Tuple
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.
Would a workaround of using struct work in this case? Suggesting in case if someone is stuck on this issue.
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.
Done via #1186