# SeqModelWeek4 Error in Encoder

**URL:** <https://community.deeplearning.ai/t/seqmodelweek4-error-in-encoder/39408>\
**Category:** Sequence Models\
**Tags:** coursera-platform\
**Created:** [September 19, 2021, 9:30am UTC](https://community.deeplearning.ai/t/seqmodelweek4-error-in-encoder/39408 "2021-09-19T09:30:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![forthe\_websites3](https://avatars.discourse-cdn.com/v4/letter/f/f04885/32.png) [@forthe\_websites3](https://community.deeplearning.ai/u/forthe_websites3)\
**Post date:** [September 19, 2021, 9:30am UTC](https://community.deeplearning.ai/t/seqmodelweek4-error-in-encoder/39408/1 "2021-09-19T09:30:40Z")

</div>

I am using below code for encoder, I cant see anything wrong - However, I’m getting Assertion error -

###ERROR

AssertionError Traceback (most recent call last)  
 in   
1 # UNIT TEST  
----\> 2 Encoder\_test(Encoder)

~/work/W4A1/public\_tests.py in Encoder\_test(target)  
124 [[-0.4612937 , 1.0697356 , -1.4127715 , 0.8043293],  
125 [0.27027237, 0.28793618, -1.6370889 , 1.0788803],  
 → 126 [1.2370994 , -1.0687275 , -0.8945037 , 0.7261319]]]), “Wrong values case 1”  
127  
128 encoderq\_output = encoderq(x, True, np.array([[[[1., 1., 1.]]], [[[1., 1., 0.]]]]))

AssertionError: Wrong values case 1

###CODE

```auto
# UNQ_C5 (UNIQUE CELL IDENTIFIER, DO NOT EDIT)
# GRADED FUNCTION
class Encoder(tf.keras.layers.Layer):

mentor edit: code removed

```

---

<div class="post-metadata">

**Author:** ![sharob.sinha](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/sharob.sinha/32/7010_2.png) [@sharob.sinha](https://community.deeplearning.ai/u/sharob.sinha)\
**Post date:** [September 20, 2021, 2:00pm UTC](https://community.deeplearning.ai/t/seqmodelweek4-error-in-encoder/39408/2 "2021-09-20T14:00:19Z")

</div>

Hi @forthe_websites3,

I have moved this post to the [DLS Course 5](https://community.deeplearning.ai/c/deep-learning-specialization/dls-course-5/16)category as other learners taking the same course might benefit from this.

Kindly make sure if you have any course-specific queries, explore the specialization category and post in the relevant course subcategory as course-specific mentors are actively answering the queries there. The [General Discussions](https://community.deeplearning.ai/c/random-discussions/23) category is not monitored by our mentors.

If you are unclear about how to use Discourse, we have made this [guide](https://docs.google.com/document/d/1xrWj9plgme08hcxj5L5tEhOuQCa4W8_eN3E1kSb2pW0/edit) for our learners. I believe that reading this will help you out posting in the appropriate categories next time!

–  
Happy Learning!!  
Sharob

---

<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 23, 2021, 1:35am UTC](https://community.deeplearning.ai/t/seqmodelweek4-error-in-encoder/39408/3 "2021-09-23T01:35:13Z")

</div>

Please do not post your code on the Forum.
