From 3e1cd8241eddc7f3ec036c26f1cbbd3272088653 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Louf?= Date: Thu, 10 Oct 2019 14:18:20 +0200 Subject: [PATCH] fix stupid (re)naming issue --- transformers/modeling_bert.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/transformers/modeling_bert.py b/transformers/modeling_bert.py index 6dae6d6ce5..5d53b981e5 100644 --- a/transformers/modeling_bert.py +++ b/transformers/modeling_bert.py @@ -333,12 +333,12 @@ class BertLayer(nn.Module): if encoder_hidden_state: try: - crossattention_outputs = self.crossattention(attention_output, attention_mask, head_mask, encoder_hidden_state) + attention_outputs = self.crossattention(attention_output, attention_mask, head_mask, encoder_hidden_state) except AttributeError as ae: raise ae("you need to set `is_encoder` to True in the configuration to instantiate an encoder layer") - crossattention_output = crossattention_outputs[0] - intermediate_output = self.intermediate(crossattention_output) + attention_output = attention_outputs[0] + intermediate_output = self.intermediate(attention_output) layer_output = self.output(intermediate_output, attention_output) outputs = (layer_output,) + attention_outputs[1:] # add attentions if we output them return outputs