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
OpenDAS
vision
Commits
1affa2e8
Unverified
Commit
1affa2e8
authored
Apr 29, 2020
by
theonekeyg
Committed by
GitHub
Apr 29, 2020
Browse files
Change range(len) to enumerate (#2153)
parent
96268814
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
torchvision/datasets/folder.py
torchvision/datasets/folder.py
+1
-1
No files found.
torchvision/datasets/folder.py
View file @
1affa2e8
...
@@ -122,7 +122,7 @@ class DatasetFolder(VisionDataset):
...
@@ -122,7 +122,7 @@ class DatasetFolder(VisionDataset):
"""
"""
classes
=
[
d
.
name
for
d
in
os
.
scandir
(
dir
)
if
d
.
is_dir
()]
classes
=
[
d
.
name
for
d
in
os
.
scandir
(
dir
)
if
d
.
is_dir
()]
classes
.
sort
()
classes
.
sort
()
class_to_idx
=
{
cl
asses
[
i
]
:
i
for
i
in
range
(
len
(
classes
)
)
}
class_to_idx
=
{
cl
s_name
:
i
for
i
,
cls_name
in
enumerate
(
classes
)}
return
classes
,
class_to_idx
return
classes
,
class_to_idx
def
__getitem__
(
self
,
index
):
def
__getitem__
(
self
,
index
):
...
...
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