Course 5 Week 4 Transformer Class Exercise 8

I am getting this error when asking for padding mask although I am already passing a mask


TypeError Traceback (most recent call last)
in
1 # UNIT TEST
----> 2 Transformer_test(Transformer, create_look_ahead_mask, create_padding_mask)

~/work/W4A1/public_tests.py in Transformer_test(target, create_look_ahead_mask, create_padding_mask)
276 enc_padding_mask,
277 look_ahead_mask,
→ 278 dec_padding_mask
279 )
280

/opt/conda/lib/python3.7/site-packages/tensorflow/python/keras/engine/base_layer.py in call(self, *args, **kwargs)
1010 with autocast_variable.enable_auto_cast_variables(
1011 self._compute_dtype_object):
→ 1012 outputs = call_fn(inputs, *args, **kwargs)
1013
1014 if self._activity_regularizer:

in call(self, input_sentence, output_sentence, training, enc_padding_mask, look_ahead_mask, dec_padding_mask)
53 # call self.encoder with the appropriate arguments to get the encoder output
54 #enc_output = self.decoder(input_sentence,training, enc_padding_mask) # (batch_size, inp_seq_len, fully_connected_dim)
—> 55 enc_output = self.decoder(input_sentence,training,look_ahead_mask,enc_padding_mask)
56 dec_output, attention_weights = self.decoder(output_sentence, enc_output, training, look_ahead_mask,dec_padding_mask)
57

/opt/conda/lib/python3.7/site-packages/tensorflow/python/keras/engine/base_layer.py in call(self, *args, **kwargs)
1010 with autocast_variable.enable_auto_cast_variables(
1011 self._compute_dtype_object):
→ 1012 outputs = call_fn(inputs, *args, **kwargs)
1013
1014 if self._activity_regularizer:

TypeError: call() missing 1 required positional argument: ‘padding_mask’

Is “enc_padding_mask” the correct name to use?

Note that the error is thrown when the Transformer() class calls your Decoder() class.
The error is in Decoder(), not Transformer().