Skip to content

Commit

Permalink
fix: Do not reuse variable in python to avoid confict of multiple var…
Browse files Browse the repository at this point in the history
…iables with different properties
  • Loading branch information
Lifann authored and rhdong committed Aug 15, 2023
1 parent 7f20412 commit 66fe67d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1226,7 +1226,7 @@ def default_partition_fn(keys, shard_num):
scope = variable_scope.get_variable_scope()
scope_store = variable_scope._get_default_variable_store()
full_name = scope.name + "/" + name if scope.name else name
if full_name in scope_store._vars:
if context.executing_eagerly() and full_name in scope_store._vars:
if scope.reuse is False:
err_msg = ("Variable %s already exists, disallowed."
" Did you mean to set reuse=True or "
Expand Down

0 comments on commit 66fe67d

Please sign in to comment.