pt_outputs = pt_model(**pt_batch, output_hidden_states=True, output_attentions=True)
all_hidden_states = pt_outputs.hidden_states
all_attentions = pt_outputs.attentions
===PT-TF-SPLIT===
tf_outputs = tf_model(tf_batch, output_hidden_states=True, output_attentions=True)
all_hidden_states = tf_outputs.hidden_states
all_attentions = tf_outputs.attentions
```
Accessing the code
The [AutoModel] and [AutoTokenizer] classes are just shortcuts that will automatically work with any
pretrained model. Behind the scenes, the library has one model class per combination of architecture plus class, so the
code is easy to access and tweak if you need to.
In our previous example, the model was called "distilbert-base-uncased-finetuned-sst-2-english", which means it's using
the DistilBERT architecture. As [AutoModelForSequenceClassification] (or [TFAutoModelForSequenceClassification] if you are using TensorFlow) was used, the model automatically created is then a [DistilBertForSequenceClassification]. You can look at its documentation for all details relevant to that specific model, or browse the source code. This is how you would
