Regarding layer_attn and use_linear_attn
See original GitHub issuehttps://github.com/lucidrains/imagen-pytorch/blob/main/imagen_pytorch/imagen_pytorch.py#L1295
transformer_block_klass = TransformerBlock if layer_attn else (LinearAttentionTransformerBlock if use_linear_attn else Identity)
Is this supposed to mean:
transformer_block_klass = (LinearAttentionTransformerBlock if use_linear_attn else TransformerBlock) if layer_attn else Identity
Issue Analytics
- State:
- Created a year ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks! I’ll think of a less confusing design 👍
@xiankgx do you want to double check this commit? https://github.com/lucidrains/imagen-pytorch/commit/d4c45ab1c8380de71e5dd1044dc4100ef9ac76ce you can now pass in a tuple to
use_linear_attn
ex.use_linear_attn = (False, True, False, False)