Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
892f9ea0
Unverified
Commit
892f9ea0
authored
Aug 13, 2023
by
Erfan Zekri Esfahani
Committed by
GitHub
Aug 13, 2023
Browse files
import required torch and numpy libraries (#25483)
parent
fe3c8ab1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
docs/source/en/tasks/semantic_segmentation.md
docs/source/en/tasks/semantic_segmentation.md
+4
-0
No files found.
docs/source/en/tasks/semantic_segmentation.md
View file @
892f9ea0
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment