Week 4 exercise 5 Encoder

I am passing x into EncoderLayers like so:

x = self.enc_layers[i](x, training, mask)

I am getting the following error:


AssertionError Traceback (most recent call last)
in
1 # UNIT TEST
----> 2 Encoder_test(Encoder)

~/work/W4A1/public_tests.py in Encoder_test(target)
142 [[-0.01885331, 0.8866553 , -1.624897 , 0.75709504],
143 [ 0.4165045 , 0.27912217, -1.6719477 , 0.97632086],
→ 144 [ 0.71298015, -0.7565592 , -1.1861688 , 1.2297478 ]]]), “Wrong values case 3”
145
146 print(“\033[92mAll tests passed”)

AssertionError: Wrong values case 3

Any ideas? Thanks.

If you look at the test cases in public_tests.py, the “case 3” is the only one that uses training = False.

So there may be an error with how you’re handling the “training” parameter within the Encoder function.