diff --git a/tensorflow_recommenders_addons/dynamic_embedding/python/ops/dynamic_embedding_optimizer.py b/tensorflow_recommenders_addons/dynamic_embedding/python/ops/dynamic_embedding_optimizer.py index 7b0d7b89d..c5e8054bd 100644 --- a/tensorflow_recommenders_addons/dynamic_embedding/python/ops/dynamic_embedding_optimizer.py +++ b/tensorflow_recommenders_addons/dynamic_embedding/python/ops/dynamic_embedding_optimizer.py @@ -107,7 +107,7 @@ def apply_grad_to_update_var(var, grad): if isinstance(var, de.shadow_ops.ShadowVariable): v0 = var.read_value(do_prefetch=False) else: - v0 = var.read_value(do_prefetch=not var.params.bp_v2) + v0 = var.read_value(do_prefetch=var.params.bp_v2) s0 = [_s.read_value() for _s in _slots] _before = [v0] + s0 diff --git a/tensorflow_recommenders_addons/dynamic_embedding/python/ops/tf_patch.py b/tensorflow_recommenders_addons/dynamic_embedding/python/ops/tf_patch.py index 56ce1b156..606e3f12a 100644 --- a/tensorflow_recommenders_addons/dynamic_embedding/python/ops/tf_patch.py +++ b/tensorflow_recommenders_addons/dynamic_embedding/python/ops/tf_patch.py @@ -90,7 +90,7 @@ def update_op(self, optimizer, g): if isinstance(self._v, de.shadow_ops.ShadowVariable): v0 = self._v.read_value(do_prefetch=False) else: - v0 = self._v.read_value(do_prefetch=not self._v.params.bp_v2) + v0 = self._v.read_value(do_prefetch=self._v.params.bp_v2) s0 = [_s.read_value() for _s in _slots] _before = [v0] + s0