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
dgl
Commits
6255c95a
Unverified
Commit
6255c95a
authored
Jan 28, 2022
by
Rhett Ying
Committed by
GitHub
Jan 28, 2022
Browse files
[Fix] too many open files (#3694)
* [Fix] too many open files
parent
05c6c3c5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
python/dgl/distributed/dist_dataloader.py
python/dgl/distributed/dist_dataloader.py
+6
-0
No files found.
python/dgl/distributed/dist_dataloader.py
View file @
6255c95a
...
@@ -155,5 +155,11 @@ class DistDataLoader:
...
@@ -155,5 +155,11 @@ class DistDataLoader:
end_pos
=
self
.
current_pos
+
self
.
batch_size
end_pos
=
self
.
current_pos
+
self
.
batch_size
idx
=
self
.
data_idx
[
self
.
current_pos
:
end_pos
].
tolist
()
idx
=
self
.
data_idx
[
self
.
current_pos
:
end_pos
].
tolist
()
ret
=
[
self
.
dataset
[
i
]
for
i
in
idx
]
ret
=
[
self
.
dataset
[
i
]
for
i
in
idx
]
# Sharing large number of tensors between processes will consume too many
# file descriptors, so let's convert each tensor to scalar value beforehand.
if
isinstance
(
ret
[
0
],
tuple
):
ret
=
[(
type
,
F
.
as_scalar
(
id
))
for
(
type
,
id
)
in
ret
]
else
:
ret
=
[
F
.
as_scalar
(
id
)
for
id
in
ret
]
self
.
current_pos
=
end_pos
self
.
current_pos
=
end_pos
return
ret
return
ret
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