Skip to content

Commit

Permalink
fix save and load from non 0 device
Browse files Browse the repository at this point in the history
  • Loading branch information
strint committed Sep 22, 2023
1 parent 4e60628 commit 905ccaf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/oneflow/nn/graph/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,8 @@ def _fill_sub_destination(dest_dict, name_list, tensor_tuple):
assert len(tensor_tuple) == len(name_list)
for name_idx in range(len(name_list)):
tensor_item = tensor_tuple[name_idx]
dest_dict[name_list[name_idx]] = (tensor_item, tensor_item.device.type)
device_str = ':'.join((tensor_item.device.type, str(tensor_item.device.index)))
dest_dict[name_list[name_idx]] = (tensor_item, device_str)

# This is original outputs is needed to build output buffer.
tuple_idx = -1
Expand Down

0 comments on commit 905ccaf

Please sign in to comment.