[Graphbolt] Modify preprocess_ondisk_dataset function. (#6017)

fix str
This commit is contained in:
keli-wen
2023-07-19 11:42:08 +08:00
committed by GitHub
parent b26da25297
commit fe8a8fc0f6

View File

@@ -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):