Skip to content

Commit

Permalink
Use is_resource_variable() in train.assert_gloabl_step.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 190573872
  • Loading branch information
tensorflower-gardener committed Mar 27, 2018
1 parent 5743030 commit b16ec31
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions tensorflow/python/training/training_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from __future__ import division
from __future__ import print_function


from tensorflow.python.eager import context
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import graph_io
Expand All @@ -31,7 +30,6 @@
from tensorflow.python.platform import tf_logging as logging
from tensorflow.python.util.tf_export import tf_export


# Picked a long key value to minimize the chance of collision with user defined
# collection keys.
GLOBAL_STEP_READ_KEY = 'global_step_read_op_cache'
Expand Down Expand Up @@ -170,8 +168,7 @@ def assert_global_step(global_step_tensor):
"""
if not (isinstance(global_step_tensor, variables.Variable) or
isinstance(global_step_tensor, ops.Tensor) or
isinstance(global_step_tensor,
resource_variable_ops.ResourceVariable)):
resource_variable_ops.is_resource_variable(global_step_tensor)):
raise TypeError(
'Existing "global_step" must be a Variable or Tensor: %s.' %
global_step_tensor)
Expand Down

0 comments on commit b16ec31

Please sign in to comment.