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
fe8a8fc0
Unverified
Commit
fe8a8fc0
authored
Jul 19, 2023
by
keli-wen
Committed by
GitHub
Jul 19, 2023
Browse files
[Graphbolt] Modify `preprocess_ondisk_dataset` function. (#6017)
fix str
parent
b26da252
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
python/dgl/graphbolt/impl/ondisk_dataset.py
python/dgl/graphbolt/impl/ondisk_dataset.py
+7
-8
No files found.
python/dgl/graphbolt/impl/ondisk_dataset.py
View file @
fe8a8fc0
...
...
@@ -137,9 +137,9 @@ def preprocess_ondisk_dataset(input_config_path: str) -> str:
):
# Always save the feature in numpy format.
out_feature
[
"format"
]
=
"numpy"
out_feature
[
"path"
]
=
processed_dir_prefix
/
feature
[
"path"
].
replace
(
"pt"
,
"npy"
)
out_feature
[
"path"
]
=
str
(
processed_dir_prefix
/
feature
[
"path"
].
replace
(
"pt"
,
"npy"
)
)
if
feature
[
"format"
]
==
"numpy"
:
# If the original format is numpy, just copy the file.
...
...
@@ -176,10 +176,9 @@ def preprocess_ondisk_dataset(input_config_path: str) -> str:
):
# Always save the feature in numpy format.
output_set_per_type
[
"format"
]
=
"numpy"
output_set_per_type
[
"path"
]
=
processed_dir_prefix
/
input_set_per_type
[
"path"
].
replace
(
"pt"
,
"npy"
output_set_per_type
[
"path"
]
=
str
(
processed_dir_prefix
/
input_set_per_type
[
"path"
].
replace
(
"pt"
,
"npy"
)
)
if
input_set_per_type
[
"format"
]
==
"numpy"
:
# If the original format is numpy, just copy the file.
...
...
@@ -209,7 +208,7 @@ def preprocess_ondisk_dataset(input_config_path: str) -> str:
with
open
(
output_config_path
,
"w"
)
as
f
:
yaml
.
dump
(
output_config
,
f
)
print
(
"Finish preprocessing the on-disk dataset."
)
return
output_config_path
return
str
(
output_config_path
)
class
OnDiskDataset
(
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