Course 5 - Week 4 - A1 - Exercise 4 - UNQ_C4 - EncoderLayer

In the cell UNQ_C4, inside function call() of class EncoderLayer() ,
I have edited self_attn_output = None to

self_attn_output = self.mha(x.shape[0], x.shape[1], x.shape[2])

unit test gives error → ‘int’ object has no attribute ‘rank’; Where am I making the mistake. Please suggest the correct way. Thanks.

1 Like

That line of code should be “self.mha(x, x, x, mask)”.
Since this is self-attention, the Q, V, and K matrices are all the same ‘x’ matrix.