# WeeK 4 Exercise 6 DecoderLayer Problem

**URL:** <https://community.deeplearning.ai/t/week-4-exercise-6-decoderlayer-problem/19805>\
**Category:** Sequence Models\
**Tags:** coursera-platform\
**Created:** [July 8, 2021, 1:45am UTC](https://community.deeplearning.ai/t/week-4-exercise-6-decoderlayer-problem/19805 "2021-07-08T01:45:52Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![duanduan52](https://avatars.discourse-cdn.com/v4/letter/d/f17d59/32.png) [@duanduan52](https://community.deeplearning.ai/u/duanduan52)\
**Post date:** [July 8, 2021, 1:45am UTC](https://community.deeplearning.ai/t/week-4-exercise-6-decoderlayer-problem/19805/1 "2021-07-08T01:45:52Z")

</div>

Hello,

When I test the DecoderLayer coding, it returns the following error message:

 ![Screen Shot 2021-07-07 at 6.42.32 PM](https://global.discourse-cdn.com/dlai/original/2X/9/95d844c199e8f2c349de73216a125052378925a5.png)

Thanks.

---

<div class="post-metadata">

**Author:** ![TMosh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/tmosh/32/9321_2.png) [@TMosh](https://community.deeplearning.ai/u/TMosh)\
**Post date:** [July 8, 2021, 4:49am UTC](https://community.deeplearning.ai/t/week-4-exercise-6-decoderlayer-problem/19805/2 "2021-07-08T04:49:25Z")

</div>

Please don’t post your code on the discussion forum. That’s not allowed by the course Honor Code. Please edit your message and remove the code, thanks.

In self.mha2, the first argument is out1, not enc\_output. Otherwise you’re never using out1 at all.

---

<div class="post-metadata">

**Author:** ![duanduan52](https://avatars.discourse-cdn.com/v4/letter/d/f17d59/32.png) [@duanduan52](https://community.deeplearning.ai/u/duanduan52)\
**Post date:** [July 8, 2021, 5:01am UTC](https://community.deeplearning.ai/t/week-4-exercise-6-decoderlayer-problem/19805/3 "2021-07-08T05:01:50Z")

</div>

Thank you so much. I will do that.

---

<div class="post-metadata">

**Author:** ![duanduan52](https://avatars.discourse-cdn.com/v4/letter/d/f17d59/32.png) [@duanduan52](https://community.deeplearning.ai/u/duanduan52)\
**Post date:** [July 10, 2021, 8:13am UTC](https://community.deeplearning.ai/t/week-4-exercise-6-decoderlayer-problem/19805/4 "2021-07-10T08:13:11Z")

</div>

Hi TMosh, I followed your suggestion. But I still got the same error.

---

<div class="post-metadata">

**Author:** ![dexcrew](https://avatars.discourse-cdn.com/v4/letter/d/edb3f5/32.png) [@dexcrew](https://community.deeplearning.ai/u/dexcrew)\
**Post date:** [July 10, 2021, 10:53am UTC](https://community.deeplearning.ai/t/week-4-exercise-6-decoderlayer-problem/19805/5 "2021-07-10T10:53:33Z")

</div>

In self.mha2 try using the following set of inputs (out1, enc\_output, enc\_output + the rest). It should fix the issue.

---

<div class="post-metadata">

**Author:** ![duanduan52](https://avatars.discourse-cdn.com/v4/letter/d/f17d59/32.png) [@duanduan52](https://community.deeplearning.ai/u/duanduan52)\
**Post date:** [July 10, 2021, 8:27pm UTC](https://community.deeplearning.ai/t/week-4-exercise-6-decoderlayer-problem/19805/6 "2021-07-10T20:27:14Z")

</div>

Thank you so much. It works now.

---

<div class="post-metadata">

**Author:** ![Lyn\_Rodnel\_Boussengu](https://avatars.discourse-cdn.com/v4/letter/l/e0b2c6/32.png) [@Lyn\_Rodnel\_Boussengu](https://community.deeplearning.ai/u/Lyn_Rodnel_Boussengu)\
**Post date:** [May 18, 2022, 8:37am UTC](https://community.deeplearning.ai/t/week-4-exercise-6-decoderlayer-problem/19805/7 "2022-05-18T08:37:22Z")

</div>

> [@dexcrew](#):
>
> the

I try to use this set of inputs but i got the same error : AssertionError: Wrong values in out
