Skip to content

Commit 952e52f

Browse files
committed
Update utils
1 parent 7093643 commit 952e52f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

graph_net/torch/utils.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ def format_data(data):
132132

133133
def process_tensor_info(tensor_info, name_prefix="example_input"):
134134
data_list = None
135-
# MODIFICATION: Handle sparse tensor serialization
136135
is_sparse = tensor_info.get("type") == "sparse_int_tensor"
137136
sparse_indices = None
138137
sparse_values = None
@@ -226,7 +225,6 @@ def convert_meta_classes_to_tensors(file_path):
226225
data_value = None
227226
data_type = getattr(torch, attrs.get("dtype", "torch.float").split(".")[-1])
228227

229-
# MODIFICATION: Reconstruct sparse tensors during loading
230228
if attrs.get("is_sparse"):
231229
indices_shape = (len(attrs.get("shape")), -1)
232230
indices = torch.tensor(attrs["indices"]).reshape(indices_shape)
@@ -274,4 +272,4 @@ def replay_tensor(info):
274272
std = info["info"]["std"]
275273
if "data" in info and info["data"] is not None:
276274
return info["data"].to(device)
277-
return torch.randn(size=shape).to(dtype).to(device) * std * 0.2 + mean
275+
return torch.randn(size=shape).to(dtype).to(device) * std * 0.2 + mean

0 commit comments

Comments
 (0)