I am not saying that this must be the case, just that this may be the case. From what I understand from this conversation, you already noticed that the shapes of layers are flipped across the two libraries. If the layers are implemented in essentially the same way in both libraries, why would such a non-trivial difference exist?
So—if I understood you correctly—you have discovered one type of mismatch between the two libraries’ implementation of the selfsame thing. Given this, all I am saying is that it would be prudent to not assume that things are nearly the same across the two libraries. If you wish to do a thorough job of the porting, I feel you should cross-check the implementation of each type of layer in either library.