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

[fix] VisualBERT returns attention tuple #1036 #1052

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Aug 22, 2021

  1. [fix] VisualBERT returns attention tuple facebookresearch#1036

    PROBLEM: The default value of output_attentions in forward( ) call of BertEncoderJit (in mmf/modules/hf_layers.py) is set as False. So even if the user/developer specifies output_attentions = True in config; its value is taken as default False and thus VisualBERT returns an empty tuple for attentions.
    
    FIX: Set output_attentions as None in BertEncoderJit's forward( ) definition, and update output_attentions to self.output_attentions if it is not passed as an argument (i.e it is None). Therefore, now output_attentions will take the value of self.output_attentions (which was initialized using config during instantiation of BertEncoderJit class)
    
    Same problem and same fix for output_hidden_states as well.
    
    Tested locally.
    abhinav-bohra authored Aug 22, 2021
    Configuration menu
    Copy the full SHA
    f68fc15 View commit details
    Browse the repository at this point in the history