Limit the amount of logspam a use of GraphKeys.VARIABLES causes.

Multiple copies of this warning next to each other often make logs unreadable.

PiperOrigin-RevId: 173672701
This commit is contained in:
A. Unique TensorFlower 2017-10-27 08:15:17 -07:00 committed by TensorFlower Gardener
parent 9c8a520b07
commit 0ccf5cf600

View File

@ -4938,9 +4938,10 @@ class GraphKeys(object):
@decorator_utils.classproperty
def VARIABLES(cls): # pylint: disable=no-self-argument
logging.warning("VARIABLES collection name is deprecated, "
"please use GLOBAL_VARIABLES instead; "
"VARIABLES will be removed after 2017-03-02.")
logging.log_first_n(logging.WARN,
"VARIABLES collection name is deprecated, please use "
"GLOBAL_VARIABLES instead; VARIABLES will be removed "
"after 2017-03-02.", 1)
return cls.GLOBAL_VARIABLES