C5_W4_A1_Transformer_Subclass_v1 Encoder Class

When implementing Encoder class, I received the following error and couldn’t figure out why. Please help!

TypeError: ‘ListWrapper’ object is not callable

What is the definition of the variable ListWrapper? I just took a look at my notebook for this assignment and I don’t have anything called that or anything that sounds like that in the Encoder function.

That error means you tried to use ListWrapper as a function, but it is not defined as a function. One way that type of error can happen is if you accidentally use parentheses instead of square brackets to index an array or tensor. In python, if I say this:

myObject(myIndex)

That means that myObject is a function and I am calling it with the argument myIndex. But if myObject is really an array and I want to index it, the correct syntax for that is:

myObject[myIndex]

Hi @paulinpaloalto is that ok to email you my code? so that you could help take a look?

Sure, I’ll send you a DM about that …