Hi, I’m stuck here. This is saying the output must be a tensor. However I couldn’t find any place where I used np instead of tf, (except for when asked for (np.newaxis/arange))
Can you please help?
Thanks.
AssertionError Traceback (most recent call last)
in
1 # UNIT TEST
----> 2 Decoder_test(Decoder, create_look_ahead_mask, create_padding_mask)
~/work/W4A1/public_tests.py in Decoder_test(target, create_look_ahead_mask, create_padding_mask)
226 assert type(att_weights) == dict, “Wrong type for att_weights[0]. Output must be a tensor”
227 assert len(keys) == 2 * num_layers, f"Wrong length for attention weights. It must be 2 x num_layers = {2*num_layers}"
→ 228 assert tf.is_tensor(att_weights[keys[0]]), f"Wrong type for att_weights[{keys[0]}]. Output must be a tensor"
229 shape1 = (x.shape[0], num_heads, x.shape[1], x.shape[1])
230 assert tuple(tf.shape(att_weights[keys[1]]).numpy()) == shape1, f"Wrong shape. We expected {shape1}"
AssertionError: Wrong type for att_weights[decoder_layer1_block1_self_att]. Output must be a tensor