Skip to content

Commit 66fe67d

Browse files
Lifannrhdong
authored andcommitted
fix: Do not reuse variable in python to avoid confict of multiple variables with different properties
1 parent 7f20412 commit 66fe67d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tensorflow_recommenders_addons/dynamic_embedding/python/ops/dynamic_embedding_variable.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1226,7 +1226,7 @@ def default_partition_fn(keys, shard_num):
12261226
scope = variable_scope.get_variable_scope()
12271227
scope_store = variable_scope._get_default_variable_store()
12281228
full_name = scope.name + "/" + name if scope.name else name
1229-
if full_name in scope_store._vars:
1229+
if context.executing_eagerly() and full_name in scope_store._vars:
12301230
if scope.reuse is False:
12311231
err_msg = ("Variable %s already exists, disallowed."
12321232
" Did you mean to set reuse=True or "

0 commit comments

Comments
 (0)