Difficulty in Achieving Required Implementation about flatten

In the code homework “# Logistic Regression with a Neural Network Mindset” of Neural Networks and Deep Learning week 2.
I try to flatten ndarray like this ways

train_set_x_flatten = train_set_x_orig.reshape (-1,train_set_x_orig.shape[0])
test_set_x_flatten = test_set_x_orig.reshape(-1,test_set_x_orig.shape[0])

and the way shown by official hint implementation is

train_set_x_flatten = train_set_x_orig.reshape(train_set_x_orig.shape[0],-1).T
test_set_x_flatten = test_set_x_orig.reshape(test_set_x_orig.shape[0],-1).T

I think the implementation of my way will get same result as hint ways’ implementation , but i cannot get passed with my ways. Are there some error or miss in my implementation?
If so, please tell me.

Thanks you

Hi,

You should read this to understand why your implementation failed.

Best,
Saif.

Thank you very much!