Printing weights of a pre-trained model 
During the generation of the key matrix, query matrix, and value matrix, what are the weights used? How do I print these weights?
In PyTorch, you can easily print out the weights of any model, like so (let's take BERT as an example):

```
from transformers import BertModel

model = BertModel.from_pretrained("bert-base-uncased")

for name, param in model.named_parameters():
      print(name, param.shape)
```
This prints a long list of all parameter names, together with their shape. The keys, values and queries are parameters of each layer of BERT (BERT-base has 12 layers, so there are 12 key, value and query matrices). One of them is the following:

```
encoder.layer.0.attention.self.query.weight torch.Size([768, 768])
encoder.layer.0.attention.self.query.bias torch.Size([768])
encoder.layer.0.attention.self.key.weight torch.Size([768, 768])
encoder.layer.0.attention.self.key.bias torch.Size([768])
encoder.layer.0.attention.self.value.weight torch.Size([768, 768])
encoder.layer.0.attention.self.value.bias torch.Size([768])
```<|||||>Yes, we can print the shape and parameter names by using this code. However, I wish to print the whole matrix [768,768] /[768]: (the value of the matrix). There must be some value assigned to this after the training is done.<|||||>Just replace `print(name, param.shape)` by `print(name, param)` in the code above.<|||||>Yea, that works. Thanks a lot 