DLZECX
1
Hello
I ran W4A1C5’s
Encoder_test(Encoder)
but I got
InvalidArgumentError: Incompatible shapes: [2,3,4] vs. [1,5,4] [Op:AddV2]
The above two shapes are the shapes ofx.shape
and self.pos_encoding.shape
I have passed through C2’s unit test and I stuck here for quite long. Could someone help me with the shape of the pos_encoding
?
1 Like
TMosh
2
Perhaps the problem is in the Encoder() class, in the code you’re using for this line:
x += self.pos_encoding[…]
1 Like
DLZECX
3
Could please you specify my problem?
I tried
x += self.pos_encoding[…]
and
x += self.pos_encoding
They both didn’t work.
TMosh
4
You need to replace the […] with the correct index expression.
3 Likes
DLZECX
5
Thank you a lot, I’ve solved the problem now.
The information is located in the instruction, though with a bit of caveat as I mentioned in this reply.