Skip to content

Commit

Permalink
Update generated Python Op docs.
Browse files Browse the repository at this point in the history
Change: 144749626
  • Loading branch information
tensorflower-gardener committed Jan 17, 2017
1 parent 7a0d788 commit da0116b
Show file tree
Hide file tree
Showing 5 changed files with 884 additions and 463 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Prints the given tensors once every N local steps or once every N seconds.
The tensors will be printed to the log, with `INFO` severity.
- - -

#### `tf.train.LoggingTensorHook.__init__(tensors, every_n_iter=None, every_n_secs=None)` {#LoggingTensorHook.__init__}
#### `tf.train.LoggingTensorHook.__init__(tensors, every_n_iter=None, every_n_secs=None, formatter=None)` {#LoggingTensorHook.__init__}

Initializes a LoggingHook monitor.

Expand All @@ -17,6 +17,8 @@ Initializes a LoggingHook monitor.
* <b>`every_n_secs`</b>: `int` or `float`, print the values of `tensors` once every N
seconds. Exactly one of `every_n_iter` and `every_n_secs` should be
provided.
* <b>`formatter`</b>: function, takes dict of `tag`->`Tensor` and returns a string.
If `None` uses default printing all tensors.

##### Raises:

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
Runs `feed_fn` and sets the `feed_dict` accordingly.
- - -

#### `tf.train.FeedFnHook.__init__(feed_fn)` {#FeedFnHook.__init__}

Constructs the FeedFnHook with given `feed_fn`.

##### Args:


* <b>`feed_fn`</b>: function, no arguments and returns `dict` to feed.


- - -

#### `tf.train.FeedFnHook.after_create_session(session, coord)` {#FeedFnHook.after_create_session}

Called when new TensorFlow session is created.

This is called to signal the hooks that a new session has been created. This
has two essential differences with the situation in which `begin` is called:

* When this is called, the graph is finalized and ops can no longer be added
to the graph.
* This method will also be called as a result of recovering a wrapped
session, not only at the beginning of the overall session.

##### Args:


* <b>`session`</b>: A TensorFlow Session that has been created.
* <b>`coord`</b>: A Coordinator object which keeps track of all threads.


- - -

#### `tf.train.FeedFnHook.after_run(run_context, run_values)` {#FeedFnHook.after_run}

Called after each call to run().

The `run_values` argument contains results of requested ops/tensors by
`before_run()`.

The `run_context` argument is the same one send to `before_run` call.
`run_context.request_stop()` can be called to stop the iteration.

##### Args:


* <b>`run_context`</b>: A `SessionRunContext` object.
* <b>`run_values`</b>: A SessionRunValues object.


- - -

#### `tf.train.FeedFnHook.before_run(run_context)` {#FeedFnHook.before_run}




- - -

#### `tf.train.FeedFnHook.begin()` {#FeedFnHook.begin}

Called once before using the session.

When called, the default graph is the one that will be launched in the
session. The hook can modify the graph by adding new operations to it.
After the `begin()` call the graph will be finalized and the other callbacks
can not modify the graph anymore. Second call of `begin()` on the same
graph, should not change the graph.


- - -

#### `tf.train.FeedFnHook.end(session)` {#FeedFnHook.end}

Called at the end of session.

The `session` argument can be used in case the hook wants to run final ops,
such as saving a last checkpoint.

##### Args:


* <b>`session`</b>: A TensorFlow Session that will be soon closed.


Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
A run hook which evaluates `Tensors` at the end of a session.
- - -

#### `tf.train.FinalOpsHook.__init__(final_ops, final_ops_feed_dict=None)` {#FinalOpsHook.__init__}

Constructs the FinalOpHook with ops to run at the end of the session.

##### Args:


* <b>`final_ops`</b>: A single `Tensor`, a list of `Tensors` or a dictionary of
names to `Tensors`.
* <b>`final_ops_feed_dict`</b>: A feed dictionary to use when running
`final_ops_dict`.


- - -

#### `tf.train.FinalOpsHook.after_create_session(session, coord)` {#FinalOpsHook.after_create_session}

Called when new TensorFlow session is created.

This is called to signal the hooks that a new session has been created. This
has two essential differences with the situation in which `begin` is called:

* When this is called, the graph is finalized and ops can no longer be added
to the graph.
* This method will also be called as a result of recovering a wrapped
session, not only at the beginning of the overall session.

##### Args:


* <b>`session`</b>: A TensorFlow Session that has been created.
* <b>`coord`</b>: A Coordinator object which keeps track of all threads.


- - -

#### `tf.train.FinalOpsHook.after_run(run_context, run_values)` {#FinalOpsHook.after_run}

Called after each call to run().

The `run_values` argument contains results of requested ops/tensors by
`before_run()`.

The `run_context` argument is the same one send to `before_run` call.
`run_context.request_stop()` can be called to stop the iteration.

##### Args:


* <b>`run_context`</b>: A `SessionRunContext` object.
* <b>`run_values`</b>: A SessionRunValues object.


- - -

#### `tf.train.FinalOpsHook.before_run(run_context)` {#FinalOpsHook.before_run}

Called before each call to run().

You can return from this call a `SessionRunArgs` object indicating ops or
tensors to add to the upcoming `run()` call. These ops/tensors will be run
together with the ops/tensors originally passed to the original run() call.
The run args you return can also contain feeds to be added to the run()
call.

The `run_context` argument is a `SessionRunContext` that provides
information about the upcoming `run()` call: the originally requested
op/tensors, the TensorFlow Session.

At this point graph is finalized and you can not add ops.

##### Args:


* <b>`run_context`</b>: A `SessionRunContext` object.

##### Returns:

None or a `SessionRunArgs` object.


- - -

#### `tf.train.FinalOpsHook.begin()` {#FinalOpsHook.begin}

Called once before using the session.

When called, the default graph is the one that will be launched in the
session. The hook can modify the graph by adding new operations to it.
After the `begin()` call the graph will be finalized and the other callbacks
can not modify the graph anymore. Second call of `begin()` on the same
graph, should not change the graph.


- - -

#### `tf.train.FinalOpsHook.end(session)` {#FinalOpsHook.end}




- - -

#### `tf.train.FinalOpsHook.final_ops_values` {#FinalOpsHook.final_ops_values}




2 changes: 2 additions & 0 deletions tensorflow/g3doc/api_docs/python/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,8 @@
* [`do_quantize_training_on_graphdef`](../../api_docs/python/train.md#do_quantize_training_on_graphdef)
* [`exponential_decay`](../../api_docs/python/train.md#exponential_decay)
* [`ExponentialMovingAverage`](../../api_docs/python/train.md#ExponentialMovingAverage)
* [`FeedFnHook`](../../api_docs/python/train.md#FeedFnHook)
* [`FinalOpsHook`](../../api_docs/python/train.md#FinalOpsHook)
* [`FtrlOptimizer`](../../api_docs/python/train.md#FtrlOptimizer)
* [`generate_checkpoint_state_proto`](../../api_docs/python/train.md#generate_checkpoint_state_proto)
* [`get_checkpoint_mtimes`](../../api_docs/python/train.md#get_checkpoint_mtimes)
Expand Down
Loading

0 comments on commit da0116b

Please sign in to comment.