Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.learn.pytorch
Commits
42df0fd6
Commit
42df0fd6
authored
Jan 29, 2019
by
Guillaume HEUSCH
Browse files
[test] fixed test for map_labels
parent
c8216718
Pipeline
#26406
failed with stage
in 8 minutes and 40 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bob/learn/pytorch/test/test.py
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
...
...
Write
Preview
Supports
Markdown
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