question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Regarding layer_attn and use_linear_attn

See original GitHub issue

https://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:closed
  • Created a year ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
lucidrainscommented, Aug 30, 2022

Thanks! I’ll think of a less confusing design 👍

0reactions
lucidrainscommented, Aug 30, 2022

@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)

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found