Skip to content

Commit 9dee9eb

Browse files
committed
fix: device not apply in tensor meta
1 parent 74d19b7 commit 9dee9eb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

graph_net/torch/test_compiler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ def get_input_dict(args):
126126
inputs_params = utils.load_converted_from_text(f"{args.model_path}")
127127
params = inputs_params["weight_info"]
128128
for tensor_meta in params.values():
129-
if hasattr(tensor_meta, "device"):
130-
tensor_meta.device = args.device
129+
if "device" in tensor_meta["info"]:
130+
tensor_meta["info"]["device"] = args.device
131131
return {
132132
k: utils.replay_tensor(v).to(torch.device(args.device))
133133
for k, v in params.items()

0 commit comments

Comments
 (0)