# C4W2\_Assignment\_Transformer Summarizer\_Exercise 2 - DecoderLayer

**URL:** <https://community.deeplearning.ai/t/c4w2-assignment-transformer-summarizer-exercise-2-decoderlayer/730680>\
**Category:** NLP with Attention Models\
**Tags:** week-module-4\
**Created:** [December 3, 2024, 1:35pm UTC](https://community.deeplearning.ai/t/c4w2-assignment-transformer-summarizer-exercise-2-decoderlayer/730680 "2024-12-03T13:35:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vemula\_suman](https://avatars.discourse-cdn.com/v4/letter/v/da6949/32.png) [@vemula\_suman](https://community.deeplearning.ai/u/vemula_suman)\
**Post date:** [December 3, 2024, 1:35pm UTC](https://community.deeplearning.ai/t/c4w2-assignment-transformer-summarizer-exercise-2-decoderlayer/730680/1 "2024-12-03T13:35:31Z")

</div>

hi @Deepti_Prasad  
I am getting below error ,i could not figure it out  
please help me to resolve.

 ![image](https://global.discourse-cdn.com/dlai/original/3X/5/0/50ae9cb02ea01aa454f5a1ec6083c9c333e3bf01.png)  
 ![image](https://global.discourse-cdn.com/dlai/original/3X/6/6/66dec93a5f73e50cb53b12353729cfe20db1ff58.png)  
 ![image](https://global.discourse-cdn.com/dlai/original/3X/e/a/ea6318fdab5493f836240093700618496bf8fd13.png)  
thank you

---

<div class="post-metadata">

**Author:** ![Deepti\_Prasad](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/deepti_prasad/32/165831_2.png) [@Deepti\_Prasad](https://community.deeplearning.ai/u/Deepti_Prasad)\
**Post date:** [December 3, 2024, 3:40pm UTC](https://community.deeplearning.ai/t/c4w2-assignment-transformer-summarizer-exercise-2-decoderlayer/730680/2 "2024-12-03T15:40:00Z")

</div>

in block1 codes where you calculate self attention, you are missing an important instruction mentions as return sequence as attention weights.

Kindly re-read instructions before the exercise, which mentions what all need to be followed for multi attention 1 code

---

<div class="post-metadata">

**Author:** ![vemula\_suman](https://avatars.discourse-cdn.com/v4/letter/v/da6949/32.png) [@vemula\_suman](https://community.deeplearning.ai/u/vemula_suman)\
**Post date:** [December 3, 2024, 4:10pm UTC](https://community.deeplearning.ai/t/c4w2-assignment-transformer-summarizer-exercise-2-decoderlayer/730680/3 "2024-12-03T16:10:00Z")

</div>

![image](https://global.discourse-cdn.com/dlai/original/3X/6/6/668fda03e56b27331f7ae9304447d216c00fa271.png)  
Have I to include above statement =True  
??

---

<div class="post-metadata">

**Author:** ![Deepti\_Prasad](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/deepti_prasad/32/165831_2.png) [@Deepti\_Prasad](https://community.deeplearning.ai/u/Deepti_Prasad)\
**Post date:** [December 3, 2024, 4:20pm UTC](https://community.deeplearning.ai/t/c4w2-assignment-transformer-summarizer-exercise-2-decoderlayer/730680/4 "2024-12-03T16:20:09Z")

</div>

![Screenshot_20241203_214438_Chrome](https://global.discourse-cdn.com/dlai/original/3X/c/0/c0de812e227161425325b5bddbab936b284968a2.jpeg)

Read the return attention score statement from the encoder layer section which tells you if you use if true you get attention output.

So in multi attention 1, instruction mentions return attention score to attention weight.

You have your answer, rather than responding yes or no to your question, I want you to implement your thought on what I mentioned (you are in the right direction)

most of the answer to your exersises are in instructions given in the grade cells and before the grade cell. so whenever you get stuck, try to catch it by first, which code line is throwing error, then what information it is providing about that incorrect code.

Then go back to the code line in exercise, re-read like you are reading for the first time. if possible don’t see the code you wrote, just read the instructions, you instantly will find the solution. this is my approach to debug code in any assignment.

---

<div class="post-metadata">

**Author:** ![vemula\_suman](https://avatars.discourse-cdn.com/v4/letter/v/da6949/32.png) [@vemula\_suman](https://community.deeplearning.ai/u/vemula_suman)\
**Post date:** [December 3, 2024, 5:16pm UTC](https://community.deeplearning.ai/t/c4w2-assignment-transformer-summarizer-exercise-2-decoderlayer/730680/5 "2024-12-03T17:16:20Z")

</div>

Thank you
