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 MoFHeka committed Mar 24, 2024
1 parent ba467f4 commit 65e437f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,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 65e437f

Please sign in to comment.