UNQ_C2 - Data Generator - 3 tests failed

Hello Mentors,

I need some help please? For question 2, I am getting the following. Before I give the details, I must confess that I am not using the list_comprehension for the example_mask.

Having said that, I have used tons of print statements to track the variables and don’t understand the expecteed outputs because when I double-check the ords for the lines, I am not seeing those ords in the expected output. But I am very happy to be corrected.

As usual I am very helpful for any assistance I can get. The course is not perfect, but the mentors are fantastic!!

Please see below:

David

Element with index 0 in the output tuple has incorrect shape. It should be (batch_size, max_length).
Expected [[49 50 51 52 53 54 55 56 57 1]
[50 51 52 53 54 55 56 57 48 1]
[51 52 53 54 55 56 57 48 49 1]].
Got [[48 49 50 51 52 53 54 1 0 0]
[49 50 51 52 53 54 55 56 57 1]
[51 52 53 54 55 56 57 48 49 1]].
Element with index 1 in the output tuple has incorrect shape. It should be (batch_size, max_length).
Expected [[49 50 51 52 53 54 55 56 57 1]
[50 51 52 53 54 55 56 57 48 1]
[51 52 53 54 55 56 57 48 49 1]].
Got [[48 49 50 51 52 53 54 1 0 0]
[49 50 51 52 53 54 55 56 57 1]
[51 52 53 54 55 56 57 48 49 1]].
Element with index 2 in the output tuple has incorrect shape. It should be (batch_size, max_length).
Expected [[1 1 1 1 1 1 1 1 1 1]
[1 1 1 1 1 1 1 1 1 1]
[1 1 1 1 1 1 1 1 1 1]].
Got [[1 1 1 1 1 1 1 1 0 0]
[1 1 1 1 1 1 1 1 1 1]
[1 1 1 1 1 1 1 1 1 1]].
27 Tests passed
3 Tests failed



Hi David_Simmonds,

The error message indicates that something went wrong with the statements that determine the shape of the output. This is probably caused by the way you coded relevant if statements and/or the way in which you added the padding. You may want to check these. If you cannot find the cause you can send me your notebook as an attachment to a direct mail and I can have a look.

Thanks Reinoud,

I just realized that I created an artificial problem by using [index] instead of lines_index[index] (which is in the instructions) to access the data_lines array. I figured it out when comparing week3 to week2. Thanks so much!!

David