Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.learn.pytorch
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
bob
bob.learn.pytorch
Commits
42df0fd6
Commit
42df0fd6
authored
6 years ago
by
Guillaume HEUSCH
Browse files
Options
Downloads
Patches
Plain Diff
[test] fixed test for map_labels
parent
c8216718
No related branches found
No related tags found
1 merge request
!9
Light cnn
Pipeline
#26406
failed
6 years ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/learn/pytorch/test/test.py
+10
-4
10 additions, 4 deletions
bob/learn/pytorch/test/test.py
with
10 additions
and
4 deletions
bob/learn/pytorch/test/test.py
+
10
−
4
View file @
42df0fd6
...
...
@@ -109,12 +109,18 @@ def test_map_labels():
labels
=
[
'
1
'
,
'
4
'
,
'
7
'
]
from
..datasets
import
map_labels
new_labels
=
map_labels
(
labels
)
new_labels
=
sorted
(
new_labels
)
assert
new_labels
==
[
'
0
'
,
'
1
'
,
'
2
'
]
assert
'
0
'
in
new_labels
assert
'
1
'
in
new_labels
assert
'
2
'
in
new_labels
#new_labels = sorted(new_labels)
#assert new_labels == ['0', '1', '2']
new_labels
=
map_labels
(
labels
,
start_index
=
5
)
new_labels
=
sorted
(
new_labels
)
assert
new_labels
==
[
'
5
'
,
'
6
'
,
'
7
'
]
#new_labels = sorted(new_labels)
assert
'
5
'
in
new_labels
assert
'
6
'
in
new_labels
assert
'
7
'
in
new_labels
#assert new_labels == ['5', '6', '7']
from
torch.utils.data
import
Dataset
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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