Update: I use as:
x, block1, block2 = self.dec_layers(x, enc_output, training, look_ahead_mask, padding_mask, return_attention_scores=True)
But the test has errors such as:
Cell In[32], line 68, in Decoder.call(self, x, enc_output, training, look_ahead_mask, padding_mask)
64 # use a for loop to pass x through a stack of decoder layers and update attention_weights (~4 lines total)
65 for i in range(self.num_layers):
66 # pass x and the encoder output through a stack of decoder layers and save the attention weights
67 # of block 1 and 2 (~1 line)
—> 68 x, block1, block2 = self.dec_layers(x, enc_output, training, look_ahead_mask, padding_mask, return_attention_scores=True)
70 #update attention_weights dictionary with the attention weights of block 1 and block 2
71 attention_weights[‘decoder_layer{}_block1_self_att’.format(i+1)] = block1
TypeError: Exception encountered when calling layer ‘decoder’ (type Decoder).
Hey, is your call to self.dec_layers correct? I am wrestling with an error there too, albeit different from yours and wondering if I am passing the right input.