Skip to content

Commit 97ea1c8

Browse files
committed
fix: Do not reuse variable in python to avoid confict of multiple variables with different properties
1 parent 2f125f9 commit 97ea1c8

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
@@ -1223,7 +1223,7 @@ def default_partition_fn(keys, shard_num):
12231223
scope = variable_scope.get_variable_scope()
12241224
scope_store = variable_scope._get_default_variable_store()
12251225
full_name = scope.name + "/" + name if scope.name else name
1226-
if full_name in scope_store._vars:
1226+
if context.executing_eagerly() and full_name in scope_store._vars:
12271227
if scope.reuse is False:
12281228
err_msg = ("Variable %s already exists, disallowed."
12291229
" Did you mean to set reuse=True or "

0 commit comments

Comments
 (0)