# Trax \_in#\_out# in UNQ\_C5 in NLP C4 W2

**URL:** <https://community.deeplearning.ai/t/trax-in-out-in-unq-c5-in-nlp-c4-w2/85253>\
**Category:** NLP with Attention Models\
**Tags:** week-module-2\
**Created:** [January 11, 2022, 12:45am UTC](https://community.deeplearning.ai/t/trax-in-out-in-unq-c5-in-nlp-c4-w2/85253 "2022-01-11T00:45:51Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike\_Stewart](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@Mike\_Stewart](https://community.deeplearning.ai/u/Mike_Stewart)\
**Post date:** [January 11, 2022, 12:45am UTC](https://community.deeplearning.ai/t/trax-in-out-in-unq-c5-in-nlp-c4-w2/85253/1 "2022-01-11T00:45:51Z")

</div>

I’m running the test output cell for UNQ\_C5 in this week’s assignment, and I note that my solution outputs

```auto
Serial_in3[
  Branch_in2_out3[
    [Dense_512, AttnHeads_in2]
    [Dense_512, AttnHeads_in2]
    [Dense_512, AttnHeads_in2]
  ]
  DotProductAttn_in3
  AttnOutput_in2
  Dense_512
]

```

where the following is expected:

```auto
Serial[
  Branch_out3[
    [Dense_512, AttnHeads]
    [Dense_512, AttnHeads]
    [Dense_512, AttnHeads]
  ]
  DotProductAttn_in3
  AttnOutput
  Dense_512
]

```

Relatedly, my code passes 6 and fails 2 unit tests, with mostly unhelpful text output. Presumably, there is something going on incorrectly with my code, and I am trying to diagnose what it is. Is there a reason why Trax would output \_in# and \_out#? This seems like it may be a red-herring, but I don’t know what else to do, given that I think I’m using proper syntax. I could post code snippets, but I worry about violating rules around sharing solutions. Thanks for any insight you can offer!

---

<div class="post-metadata">

**Author:** ![Mike\_Stewart](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@Mike\_Stewart](https://community.deeplearning.ai/u/Mike_Stewart)\
**Post date:** [January 11, 2022, 12:54am UTC](https://community.deeplearning.ai/t/trax-in-out-in-unq-c5-in-nlp-c4-w2/85253/2 "2022-01-11T00:54:31Z")

</div>

Nevermind: I misunderstood what was meant by calling closure functions and my problem is resolved.

---

<div class="post-metadata">

**Author:** ![CharlesK](https://avatars.discourse-cdn.com/v4/letter/c/3ab097/32.png) [@CharlesK](https://community.deeplearning.ai/u/CharlesK)\
**Post date:** [January 20, 2022, 8:56pm UTC](https://community.deeplearning.ai/t/trax-in-out-in-unq-c5-in-nlp-c4-w2/85253/3 "2022-01-20T20:56:14Z")

</div>

Hi, I have an error at this question which disturb me, I do as advised by putting 3 blocks of [tl.Dense(d\_feature), ComputeAttentionHeads], and I have the error TypeError: list indices must be integers or slices, not tuple. Can anyone can advise? Thank you in advance. Charles

---

<div class="post-metadata">

**Author:** ![reinoudbosch](https://avatars.discourse-cdn.com/v4/letter/r/22d042/32.png) [@reinoudbosch](https://community.deeplearning.ai/u/reinoudbosch)\
**Post date:** [January 31, 2022, 6:10pm UTC](https://community.deeplearning.ai/t/trax-in-out-in-unq-c5-in-nlp-c4-w2/85253/4 "2022-01-31T18:10:45Z")

</div>

Hi CharlesK,

Do not forget to separate the lists in tl.Branch with commas.

Good luck!

---

<div class="post-metadata">

**Author:** ![Mathieu\_Beaudoin](https://avatars.discourse-cdn.com/v4/letter/m/45deac/32.png) [@Mathieu\_Beaudoin](https://community.deeplearning.ai/u/Mathieu_Beaudoin)\
**Post date:** [April 28, 2022, 8:06pm UTC](https://community.deeplearning.ai/t/trax-in-out-in-unq-c5-in-nlp-c4-w2/85253/6 "2022-04-28T20:06:40Z")

</div>

Would you mind shedding some light on the nature of the adjustment to your code that fixed the issue? Everything else seems to be working fine for me, except for that pesky little detail…

---

<div class="post-metadata">

**Author:** ![Arena](https://avatars.discourse-cdn.com/v4/letter/a/f1d935/32.png) [@Arena](https://community.deeplearning.ai/u/Arena)\
**Post date:** [September 19, 2022, 8:09am UTC](https://community.deeplearning.ai/t/trax-in-out-in-unq-c5-in-nlp-c4-w2/85253/7 "2022-09-19T08:09:46Z")

</div>

Hi,

I also have this problem. I used comma in tl.branch, but I got 2 error in the w2\_tests.test\_CausalAttention(CausalAttention)

This is my labId = “qqmokpvh”  
Would you please take a look and help me?

---

<div class="post-metadata">

**Author:** ![reinoudbosch](https://avatars.discourse-cdn.com/v4/letter/r/22d042/32.png) [@reinoudbosch](https://community.deeplearning.ai/u/reinoudbosch)\
**Post date:** [September 19, 2022, 10:21pm UTC](https://community.deeplearning.ai/t/trax-in-out-in-unq-c5-in-nlp-c4-w2/85253/8 "2022-09-19T22:21:38Z")

</div>

Hi Arena,

I cannot access your lab through your labId. If you send it to me as an attachment to a direct message I can have a look.
