Skip to content

Commit

Permalink
support free eager tensor in graph state dict (#9085)
Browse files Browse the repository at this point in the history
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
BBuf and mergify[bot] authored Sep 13, 2022
1 parent aa5b11a commit e2f4048
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/oneflow/nn/graph/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ def state_dict(
assert len(additional_var_names) == len(additional_var_tensors)
for i in range(len(additional_var_names)):
additional_tensor = additional_var_tensors[i]
if not self._is_global_view:
if not self._is_global_view and additional_tensor.is_global:
additional_tensor = additional_tensor.to_local()
destination[additional_var_names[i]] = additional_tensor
else:
Expand Down

0 comments on commit e2f4048

Please sign in to comment.