❓ How Linear layer difference between TF2 and PT are handled ?
# ❓ Questions & Help

There is a difference between TF2 and Pytorch on how to store the weights of a Linear Layer.

As shown in [this Colab notebook](https://colab.research.google.com/drive/1zLWONO3wo09-PImo0kg1bwARsh2jKnpQ?usp=sharing), in order to get the same output for both TF2 and PT when using `torch.nn.Linear` and `tf.keras.layers.Dense`, we need to transpose the weights in PT.

**I couldn't find in this library where this is handled** (when loading a Pytorch checkpoint to TF2 for example).  
Can someone point me out where and how this is handled ?
[Here's an example when loading a TF BERT model in PyTorch.](https://github.com/huggingface/transformers/blob/master/src/transformers/modeling_bert.py#L122)