C4 week4 Deep Learning & Art: Exercise 3 - compute_layer_style_cost

If that’s all the code you have, then no, that is not correct. The point is that you can’t just reshape directly to the final shape you want, because that ends up scrambling the data. Here’s a thread which explains why that doesn’t work and suggests the correct way to do it. You might want to read the earlier part of that thread to get the full context for what that last post is doing.