Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.

Fix UT: //tensorflow/python:saver_test #26

Open
wants to merge 1 commit into
base: r1.15.5+nv21.05
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions tensorflow/python/training/optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ def apply_fn():
with ops.name_scope("update_" + scope_name), ops.colocate_with(var):
update_ops.append(processor.update_op(self, grad))
if global_step is None:
apply_updates = self._finish(update_ops, sname+'-apply')
apply_updates = self._finish(update_ops, sname)
else:
with ops.control_dependencies([self._finish(update_ops, "update")]):
with ops.colocate_with(global_step):
Expand All @@ -666,9 +666,9 @@ def apply_fn():
apply_updates = resource_variable_ops.assign_add_variable_op(
global_step.handle,
ops.convert_to_tensor(1, dtype=global_step.dtype),
name=sname+'-apply')
name=sname)
else:
apply_updates = state_ops.assign_add(global_step, 1, name=sname+'-apply')
apply_updates = state_ops.assign_add(global_step, 1, name=sname)

if not context.executing_eagerly():
if isinstance(apply_updates, ops.Tensor):
Expand Down Expand Up @@ -772,12 +772,12 @@ def finish(self, update_ops):
finish_updates = distribution.extended.update_non_slot(
non_slot_devices, finish, args=(self, update_ops), group=False)
if global_step is None:
apply_updates = distribution.group(finish_updates, name=sname+'-apply')
apply_updates = distribution.group(finish_updates, name=sname)
else:
with ops.control_dependencies(finish_updates):
apply_updates = distribution.extended.update(
global_step, state_ops.assign_add, args=(1,),
kwargs={"name": sname+'-apply'})
kwargs={"name": sname})

if not context.executing_eagerly():
if isinstance(apply_updates, ops.Tensor):
Expand Down