AssertionError Traceback (most recent call last)
in
1 # UNIT TEST
----> 2 positional_encoding_test(positional_encoding, get_angles)
~/work/W4A1/public_tests.py in positional_encoding_test(target, get_angles)
34
35 ones = sin_part ** 2 + cos_part ** 2
—> 36 assert np.allclose(ones, np.ones((1, position, d_model // 2))), “Sum of square pairs must be 1 = sin(a)**2 + cos(a)**2”
37
38 angs = np.arctan(sin_part / cos_part)
AssertionError: Sum of square pairs must be 1 = sin(a)**2 + cos(a)**2
“Help needed, Please. I have been stuck all day”
Edit: I used this: “get_angles(np.arange(positions)[:, np.newaxis],
np.arange(d)[np.newaxis, :],
np.arange(d)[np.newaxis, :])” #to change the dim
And my get_angles() ran properly!