import required torch and numpy libraries (#25483)

This commit is contained in:
Erfan Zekri Esfahani 2023-08-13 20:56:40 +03:30 committed by GitHub
parent fe3c8ab1af
commit 892f9ea0db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -221,6 +221,10 @@ logits first, and then reshaped to match the size of the labels before you can c
<pt>
```py
>>> import numpy as np
>>> import torch
>>> from torch import nn
>>> def compute_metrics(eval_pred):
... with torch.no_grad():
... logits, labels = eval_pred