Skip to content

Commit

Permalink
[Embedding] Backward compatibility with 2306.
Browse files Browse the repository at this point in the history
Signed-off-by: 泊霆 <[email protected]>
  • Loading branch information
Mesilenceki committed Jan 10, 2024
1 parent 0f536a2 commit 9bd8178
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tensorflow/python/ops/kv_variable_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,11 +530,16 @@ def _init_from_proto(self, variable_def, import_scope=None):
cache_op = op
elif self._initializer_op.type == "InitializeKvVariableOp":
init_op = self._initializer_op

self._init_op_for_restore = g.as_graph_element(
if variable_def.initialize_op_for_restore:
self._init_op_for_restore = g.as_graph_element(
ops.prepend_name_scope(
variable_def.initialize_op_for_restore,
import_scope=import_scope))
else: #Backward compatibility with 2306
self._init_op_for_restore = g.as_graph_element(
ops.prepend_name_scope(
variable_def.initializer_name,
import_scope=import_scope))
self._trainable = getattr(variable_def, "trainable", True)
if variable_def.snapshot_name:
self._cached_value = g.as_graph_element(
Expand Down

0 comments on commit 9bd8178

Please sign in to comment.