Trax _in#_out# in UNQ_C5 in NLP C4 W2

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

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:

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!

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

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

1 Like

Hi CharlesK,

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

Good luck!

2 Likes

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…

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?

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.