# Error with Exercise 2 - DecoderLayer excercise

**URL:** <https://community.deeplearning.ai/t/error-with-exercise-2-decoderlayer-excercise/519520>\
**Category:** NLP with Attention Models\
**Tags:** week-module-2\
**Created:** [December 15, 2023, 4:09pm UTC](https://community.deeplearning.ai/t/error-with-exercise-2-decoderlayer-excercise/519520 "2023-12-15T16:09:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nguyen\_Huy\_Tuan\_K17](https://avatars.discourse-cdn.com/v4/letter/n/5daacb/32.png) [@Nguyen\_Huy\_Tuan\_K17](https://community.deeplearning.ai/u/Nguyen_Huy_Tuan_K17)\
**Post date:** [December 15, 2023, 4:09pm UTC](https://community.deeplearning.ai/t/error-with-exercise-2-decoderlayer-excercise/519520/1 "2023-12-15T16:09:15Z")

</div>

![image](https://global.discourse-cdn.com/dlai/original/3X/f/6/f6eda13695abe78b95a481b4ff72364a7d6dfab2.png)  
Hello, I’m having issue with the self.mha2() attribute. The return value attn\_weights\_block2 is suppose to has the shape (1, 16, 15, 3) but instead it returned the shape (1, 16, 15, 7).  
The other two values returned by the method which are out3 and attn\_weights\_block1 still have the correct shape (1, 16, 15, 15) and (1, 15, 12) respectively so I don’t know what I did wrong

---

<div class="post-metadata">

**Author:** ![Muhammad\_Shariq\_Shoa](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@Muhammad\_Shariq\_Shoa](https://community.deeplearning.ai/u/Muhammad_Shariq_Shoa)\
**Post date:** [December 18, 2023, 7:23am UTC](https://community.deeplearning.ai/t/error-with-exercise-2-decoderlayer-excercise/519520/2 "2023-12-18T07:23:53Z")

</div>

Facing same issue

---

<div class="post-metadata">

**Author:** ![a-zarta](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/a-zarta/32/162492_2.png) [@a-zarta](https://community.deeplearning.ai/u/a-zarta)\
**Post date:** [December 19, 2023, 3:48pm UTC](https://community.deeplearning.ai/t/error-with-exercise-2-decoderlayer-excercise/519520/3 "2023-12-19T15:48:30Z")

</div>

Hi @Nguyen_Huy_Tuan_K17, there was an error in the expected output mkdown which we have corrected already (you probably won’t see the change since we didn’t want to force learners to restart on a blank assignment because of this change, but it will be fixed for all future learners). Getting a 7 in that last dimension is correct.
