Can’t figure out what I did wrong when calling self.mha2. Could you please assist?
I call it with the set of arguments self.mha2(Q1, enc_output, enc_output, padding_mask, return_attention_scores=True) and i got an error message : AssertionError: Wrong values in attn_w_b2. Check the call to self.mha2
You seem to have missed training=training parameter when calling self.mha2. This should be present when calling self.mha1 as well. If that doesn’t fix the error, please click my name and send your notebook as an attachment.
The 2nd Add & Norm layer takes as inputs the multi-head attention output multi_attn_out2 and one more term that’s not multi_attn_out1. multi_attn_out1 is the output of the 1st multi-head attention layer.