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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions mmf/modules/hf_layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,17 @@ def forward(
attention_mask: Optional[Tensor],
encoder_hidden_states: Optional[Tensor] = None,
encoder_attention_mask: Optional[Tensor] = None,
output_attentions: bool = False,
output_hidden_states: bool = False,
output_attentions: bool = None,
output_hidden_states: bool = None,
return_dict: bool = False,
head_mask: Optional[Tensor] = None,
) -> Tuple[Tensor]:

if output_attentions is None:
output_attentions = self.output_attentions
if output_hidden_states is None:
output_hidden_states = self.output_hidden_states

all_hidden_states = ()
all_attentions = ()
for i, layer_module in enumerate(self.layer):
Expand Down