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
0623f08e
"git@developer.sourcefind.cn:sugon_wxj/megatron-lm.git" did not exist on "4bea4e769ff195b6fa5adf9b368587acd67fc847"
Unverified
Commit
0623f08e
authored
May 30, 2023
by
Clémentine Fourrier
Committed by
GitHub
May 30, 2023
Browse files
Update collating_graphormer.py (#23862)
parent
62ba64b9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/transformers/models/graphormer/collating_graphormer.py
src/transformers/models/graphormer/collating_graphormer.py
+1
-1
No files found.
src/transformers/models/graphormer/collating_graphormer.py
View file @
0623f08e
...
...
@@ -129,6 +129,6 @@ class GraphormerDataCollator:
else
:
# binary classification
batch
[
"labels"
]
=
torch
.
from_numpy
(
np
.
concatenate
([
i
[
"labels"
]
for
i
in
features
]))
else
:
# multi task classification, left to float to keep the NaNs
batch
[
"labels"
]
=
torch
.
from_numpy
(
np
.
stack
([
i
[
"labels"
]
for
i
in
features
],
dim
=
0
))
batch
[
"labels"
]
=
torch
.
from_numpy
(
np
.
stack
([
i
[
"labels"
]
for
i
in
features
],
axis
=
0
))
return
batch
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