I am unable to understand why it is not changing its shape.

{mentor edit: code removed}

##
tf.Tensor(

[[[[ 0.11490856 0.4693238 -0.6517217 0.13027893]

[ 0. 0.48687497 -0.6237864 0.18140751]

[ 0.10580825 0.4657544 -0.66466635 0.11691388]]]], shape=(1, 1, 3, 4), dtype=float32)

tf.Tensor(

[[[[ 0.11490856 0.4693238 -0.6517217 0.13027893]

[ 0. 0.48687497 -0.6237864 0.18140751]

[ 0.10580825 0.4657544 -0.66466635 0.11691388]]]], shape=(1, 1, 3, 4), dtype=float32)

tf.Tensor(

[[[[-0.19707678 -1.0017939 -0.45860898 1.6574798 ]

[-1.218006 1.3352634 -0.6613954 0.54413795]

[ 0.5050506 0.5882081 -1.7301245 0.63686574]]]], shape=(1, 1, 3, 4), dtype=float32)

AssertionError Traceback (most recent call last)

in

17

18

â€”> 19 EncoderLayer_test(EncoderLayer)

in EncoderLayer_test(target)

7

8 assert tf.is_tensor(encoded), â€śWrong type. Output must be a tensorâ€ť

----> 9 assert tuple(tf.shape(encoded).numpy()) == (1, q.shape[1], q.shape[2]), f"Wrong shape. We expected ((1, {q.shape[1]}, {q.shape[2]}))"

10

11 assert np.allclose(encoded.numpy(),

AssertionError: Wrong shape. We expected ((1, 3, 4))