Week 4 assignment 2 UNQ_C1

There is an issue with the shape of the input in a test case.
I have attached the screenshot.

{moderator edit: code removed}

Your screen image does not appear to show any problems with the shape.
Do you have some test results you can post?

I recommend you read all of the “Additional Hints for unrolling” from the instructions just above that code cell. I think you may be missing a few steps.

Also, please don’t post your code on the forum. That isn’t allowed by the community guidelines.
I have removed the code from your post.

the highlighted part is the skeleton code provided in the assignment.
I think for the first test case, when I call the shape function to get the shape of a_G I get a tuple of length 4 which is expected, and for the second test_case I get a tuple of length 2 instead of 4
as you can see in the first image

Did you review the instructions that I mentioned? Your code seems to be missing the transpositions.

We’ve used this test case for about two years. It is unlikely you discovered a previously unknown problem.

Hi @Sarthak_Khandelwal!

Why you are using 1 while reshaping a_C_unrolled and a_G_unrolled?
See the hint:

To unroll the tensor, you want the shape to change from  (m,nH,nW,nC)  to  (m,nH×nW,nC) .

tf.reshape(tensor, shape) takes a list of integers that represent the desired output shape.

For the shape parameter, a -1 tells the function to choose the correct dimension size so that the output tensor still contains all the values of the original tensor.

So tf.reshape(a_C, shape=[m, n_H * n_W, n_C]) gives the same result as tf.reshape(a_C, shape=[m, -1, n_C])

Best,
Saif.