Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
combo
Manage
Activity
Members
Labels
Plan
Issues
20
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
2
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Syntactic Tools
combo
Commits
459cfe05
Commit
459cfe05
authored
3 years ago
by
Mateusz Klimaszewski
Browse files
Options
Downloads
Patches
Plain Diff
Change tensor constructor.
parent
bbf32308
Branches
Branches containing commit
No related merge requests found
Pipeline
#2930
passed with stage
in 7 minutes and 4 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
combo/data/dataset.py
+1
-1
1 addition, 1 deletion
combo/data/dataset.py
with
1 addition
and
1 deletion
combo/data/dataset.py
+
1
−
1
View file @
459cfe05
...
...
@@ -204,7 +204,7 @@ class UniversalDependenciesDatasetReader(allen_data.DatasetReader):
default_value
=
[
0.0
]
*
classes_count
padded_tags
=
util
.
pad_sequence_to_length
(
field
.
_indexed_multi_labels
,
desired_num_tokens
,
lambda
:
default_value
)
tensor
=
torch
.
LongT
ensor
(
padded_tags
)
tensor
=
torch
.
t
ensor
(
padded_tags
,
dtype
=
torch
.
long
)
return
tensor
return
as_tensor
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment