Skip to content

Commit 56b7429

Browse files
ispirmustafatensorflower-gardener
authored andcommitted
Deprecate graph_actions.py
Change: 144142420
1 parent ca61311 commit 56b7429

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

tensorflow/contrib/learn/python/learn/graph_actions.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,21 @@
5050
from tensorflow.python.training import session_manager as session_manager_lib
5151
from tensorflow.python.training import summary_io
5252
from tensorflow.python.training import supervisor as tf_supervisor
53+
from tensorflow.python.util.deprecation import deprecated
5354

5455
# Singleton for SummaryWriter per logdir folder.
5556
_SUMMARY_WRITERS = {}
5657

5758
# Lock protecting _SUMMARY_WRITERS
5859
_summary_writer_lock = threading.Lock()
5960

61+
_graph_action_deprecation = deprecated(
62+
'2017-02-15',
63+
'graph_actions.py will be deleted. Use tf.train.* utilities instead. '
64+
'You can use learn/estimators/estimator.py as an example.')
6065

66+
67+
@_graph_action_deprecation
6168
def clear_summary_writers():
6269
"""Clear cached summary writers. Currently only used for unit tests."""
6370
return summary_io.SummaryWriterCache.clear()
@@ -312,7 +319,8 @@ def make_saver():
312319
summary_io.SummaryWriterCache.clear()
313320
return loss
314321

315-
# TODO(ispir): Deprecate train in favor of supervised_train
322+
323+
@_graph_action_deprecation
316324
def train(graph,
317325
output_dir,
318326
train_op,
@@ -658,6 +666,7 @@ def _write_summary_results(output_dir, eval_results, current_global_step):
658666
summary_writer.flush()
659667

660668

669+
@_graph_action_deprecation
661670
def evaluate(graph,
662671
output_dir,
663672
checkpoint_path,
@@ -811,6 +820,7 @@ def evaluate(graph,
811820
return eval_results, current_global_step
812821

813822

823+
@_graph_action_deprecation
814824
def run_n(output_dict, feed_dict=None, restore_checkpoint_path=None, n=1):
815825
"""Run `output_dict` tensors `n` times, with the same `feed_dict` each run.
816826
@@ -832,7 +842,7 @@ def run_n(output_dict, feed_dict=None, restore_checkpoint_path=None, n=1):
832842
restore_checkpoint_path=restore_checkpoint_path)
833843

834844

835-
# TODO(ptucker): Add save_checkpoint_path.
845+
@_graph_action_deprecation
836846
def run_feeds_iter(output_dict, feed_dicts, restore_checkpoint_path=None):
837847
"""Run `output_dict` tensors with each input in `feed_dicts`.
838848
@@ -884,11 +894,13 @@ def run_feeds_iter(output_dict, feed_dicts, restore_checkpoint_path=None):
884894
coord.join(threads, stop_grace_period_secs=120)
885895

886896

897+
@_graph_action_deprecation
887898
def run_feeds(*args, **kwargs):
888899
"""See run_feeds_iter(). Returns a `list` instead of an iterator."""
889900
return list(run_feeds_iter(*args, **kwargs))
890901

891902

903+
@_graph_action_deprecation
892904
def infer(restore_checkpoint_path, output_dict, feed_dict=None):
893905
"""Restore graph from `restore_checkpoint_path` and run `output_dict` tensors.
894906

0 commit comments

Comments
 (0)