# C5W4 UNQ\_C4, EncoderLayer

**URL:** <https://community.deeplearning.ai/t/c5w4-unq-c4-encoderlayer/36381>\
**Category:** Sequence Models\
**Tags:** coursera-platform\
**Created:** [September 12, 2021, 8:14am UTC](https://community.deeplearning.ai/t/c5w4-unq-c4-encoderlayer/36381 "2021-09-12T08:14:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bunny](https://avatars.discourse-cdn.com/v4/letter/b/3d9bf3/32.png) [@Bunny](https://community.deeplearning.ai/u/Bunny)\
**Post date:** [September 12, 2021, 8:14am UTC](https://community.deeplearning.ai/t/c5w4-unq-c4-encoderlayer/36381/1 "2021-09-12T08:14:30Z")

</div>

```auto
        # START CODE HERE
        mentor edit: code removed
        # END CODE HERE
        
        return encoder_layer_out

```

Can anyone point out what I did wrong? the error I get is

```auto
AssertionError: Wrong values when training=True

```

Also, Since the code is incorrect, I think this can be posted here for a while. Ill remove as soon as it works

Thanks

---

<div class="post-metadata">

**Author:** ![yassineayadi](https://avatars.discourse-cdn.com/v4/letter/y/97f17d/32.png) [@yassineayadi](https://community.deeplearning.ai/u/yassineayadi)\
**Post date:** [September 12, 2021, 4:27pm UTC](https://community.deeplearning.ai/t/c5w4-unq-c4-encoderlayer/36381/2 "2021-09-12T16:27:13Z")

</div>

> [@Bunny](#):
>
> `layernorm2`

in the layernorm2 you should sum the ffn\_output with out1 not attn\_output.

---

<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:** [September 12, 2021, 6:29pm UTC](https://community.deeplearning.ai/t/c5w4-unq-c4-encoderlayer/36381/3 "2021-09-12T18:29:36Z")

</div>

You should not post your code on the Forum, regardless of whether it has errors.
