import required torch and numpy libraries (#25483)
This commit is contained in:
committed by
GitHub
parent
fe3c8ab1af
commit
892f9ea0db
@@ -221,6 +221,10 @@ logits first, and then reshaped to match the size of the labels before you can c
|
|||||||
<pt>
|
<pt>
|
||||||
|
|
||||||
```py
|
```py
|
||||||
|
>>> import numpy as np
|
||||||
|
>>> import torch
|
||||||
|
>>> from torch import nn
|
||||||
|
|
||||||
>>> def compute_metrics(eval_pred):
|
>>> def compute_metrics(eval_pred):
|
||||||
... with torch.no_grad():
|
... with torch.no_grad():
|
||||||
... logits, labels = eval_pred
|
... logits, labels = eval_pred
|
||||||
|
|||||||
Reference in New Issue
Block a user