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
"git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "5c4c869014f5839d04c1fd28133045df0c91fd84"
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
...
@@ -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
...
...
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