Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.learn.pytorch
Commits
79cecbd2
Commit
79cecbd2
authored
Jan 29, 2019
by
Guillaume HEUSCH
Browse files
[utils] remove comments in the map_label function
parent
46fc1f92
Changes
1
Hide whitespace changes
Inline
Side-by-side
bob/learn/pytorch/datasets/utils.py
View file @
79cecbd2
...
...
@@ -90,18 +90,8 @@ def map_labels(raw_labels, start_index=0):
for
i
in
range
(
len
(
possible_labels
)):
l
=
possible_labels
[
i
]
#labels[numpy.where(labels==l)[0][0]] = i + start_index
labels
[
numpy
.
where
(
labels
==
l
)[
0
]]
=
i
+
start_index
# -----
# map back to native int, resolve the problem with dataset concatenation
# it does: line 78 is now ok
# for some reason, it was not working when the type of id labels were numpy.int64 ...
#labels_int = []
#for i in range(len(labels)):
# labels_int.append(labels[i].item())
#return labels_int
return
labels
from
torch.utils.data
import
Dataset
...
...
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