Course 4 Week 4 Assignment 2 Exercise 3: Wrong Value

I am getting the wrong value in this exercise but I can’t see any issues with my code. Below is my code:

{moderator edit - solution code removed}

And the error is as follows:

tf.Tensor(2.9203947, shape=(), dtype=float32)

AssertionError Traceback (most recent call last)
9 assert np.isclose(J_style_layer_GG, 0.0), “Wrong value. compute_layer_style_cost(A, A) must be 0”
10 assert J_style_layer_SG > 0, “Wrong value. compute_layer_style_cost(A, B) must be greater than 0 if A != B”
—> 11 assert np.isclose(J_style_layer_SG, 14.017805), “Wrong value.”
13 print("J_style_layer = " + str(J_style_layer_SG))

AssertionError: Wrong value.

Please read the instructions again and in particular see the “Additional Hints” section. What you have done is to directly reshape the data to the desired shape. That has the result of scrambling the data. Here’s another thread about this same error from a while back that goes into slightly more detail about why that method doesn’t work.