Course 4 Week 4 Assignment 2 Exercise 3

How do you use tf.transpose() in that example when the task does not ask for a permutation of the shape?

They do tell you what the final shape needs to be and it’s different, right? But you’ll find that if you just directly “reshape” the values into the final shape that they ask for there, the answer will be incorrect. That’s because doing that ends up scrambling the data. To see an example of why this sort of thing matters, here’s a thread which explains it for the case of reshaping the image data in Course 1 Week 2.

1 Like