===PT-TF-SPLIT===
print(tf_predictions)
tf.Tensor(
[[2.2043e-04 9.9978e-01]
 [5.3086e-01 4.6914e-01]], shape=(2, 2), dtype=float32)
```
If you provide the model with labels in addition to inputs, the model output object will also contain a loss
attribute:
```py
import torch
pt_outputs = pt_model(**pt_batch, labels=torch.tensor([1, 0]))
print(pt_outputs)
SequenceClassifierOutput(loss=tensor(0.3167, grad_fn=), logits=tensor([[-4.0833,  4.3364],
        [ 0.0818, -0.0418]], grad_fn=), hidden_states=None, attentions=None)
===PT-TF-SPLIT===
import tensorflow as tf
tf_outputs = tf_model(tf_batch, labels=tf.constant([1, 0]))
print(tf_outputs)
TFSequenceClassifierOutput(loss=, logits=, hidden_states=None, attentions=None)
```
Models are standard torch.nn.Module or tf.keras.Model so you can use them in your usual training loop. 🤗 Transformers also provides a [Trainer] class to help with your training in PyTorch (taking care of things such as distributed training, mixed precision, etc.) whereas you can leverage the fit() method in Keras. See the training tutorial for more details.
