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.

This code block will not be executed

See original GitHub issue

System Info

python 3.9

Who can help?

No response

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, …)
  • My own task or dataset (give details below)

Reproduction

` combined_attention_mask = None

    if attention_mask is not None and combined_attention_mask is not None:
        # [bsz, seq_len] -> [bsz, 1, tgt_seq_len, src_seq_len]
        combined_attention_mask = combined_attention_mask + _expand_mask(
            attention_mask, inputs_embeds.dtype, tgt_len=input_shape[-1]
        )`

Expected behavior

The combined_attention_mask is set to None, so the if code block below it will never be executed because it will check combined_attention_mask is not None.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
NielsRoggecommented, Jul 27, 2022

Hi @AlfredQin, thanks for spotting that. The combined_attention_mask was probably taken from another model, which is not relevant for DETR.

Feel free to open a PR to remove that code block!

0reactions
github-actions[bot]commented, Aug 22, 2022

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Does 'finally' always execute in Python? - Stack Overflow
No matter what happened previously, the final-block is executed once the code block is complete and any raised exceptions handled.
Read more >
Is finally block always get executed in Java? - Tutorialspoint
Yes, the finally block is always get executed unless there is an abnormal program termination either resulting from a JVM crash or from...
Read more >
Blocks and Statements - Oracle Help Center
The sequence of execution of a program is controlled by statements, which are executed for their effect and do not have values.
Read more >
When Finally Block is not executed in Java - Scientech Easy
Learn possibility when finally block is not executed in Java, when finally block gets executed, statements after return in finally block is not...
Read more >
try-finally - C# Reference - Microsoft Learn
If the exception is not caught, execution of the finally block depends on whether the operating system chooses to trigger an exception ...
Read more >

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