Skip to content

Commit 747bbc6

Browse files
Update generated Python Op docs.
Change: 144354547
1 parent 0026b6e commit 747bbc6

15 files changed

Lines changed: 76 additions & 82 deletions

tensorflow/g3doc/api_docs/python/contrib.learn.monitors.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2632,7 +2632,7 @@ Wraps monitors into a SessionRunHook.
26322632

26332633
- - -
26342634

2635-
#### `tf.contrib.learn.monitors.RunHookAdapterForMonitors.after_create_session(session)` {#RunHookAdapterForMonitors.after_create_session}
2635+
#### `tf.contrib.learn.monitors.RunHookAdapterForMonitors.after_create_session(session, coord)` {#RunHookAdapterForMonitors.after_create_session}
26362636

26372637
Called when new TensorFlow session is created.
26382638

@@ -2648,6 +2648,7 @@ has two essential differences with the situation in which `begin` is called:
26482648

26492649

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

26522653

26532654
- - -

tensorflow/g3doc/api_docs/python/functions_and_classes/shard0/tf.train.GlobalStepWaiterHook.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Create a _GlobalStepWaiterHook.
1818

1919
- - -
2020

21-
#### `tf.train.GlobalStepWaiterHook.after_create_session(session)` {#GlobalStepWaiterHook.after_create_session}
21+
#### `tf.train.GlobalStepWaiterHook.after_create_session(session, coord)` {#GlobalStepWaiterHook.after_create_session}
2222

2323
Called when new TensorFlow session is created.
2424

@@ -34,6 +34,7 @@ has two essential differences with the situation in which `begin` is called:
3434

3535

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

3839

3940
- - -

tensorflow/g3doc/api_docs/python/functions_and_classes/shard0/tf.train.SessionRunHook.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Hook to extend calls to MonitoredSession.run().
22
- - -
33

4-
#### `tf.train.SessionRunHook.after_create_session(session)` {#SessionRunHook.after_create_session}
4+
#### `tf.train.SessionRunHook.after_create_session(session, coord)` {#SessionRunHook.after_create_session}
55

66
Called when new TensorFlow session is created.
77

@@ -17,6 +17,7 @@ has two essential differences with the situation in which `begin` is called:
1717

1818

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

2122

2223
- - -

tensorflow/g3doc/api_docs/python/functions_and_classes/shard1/tf.train.LoggingTensorHook.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Initializes a LoggingHook monitor.
2626

2727
- - -
2828

29-
#### `tf.train.LoggingTensorHook.after_create_session(session)` {#LoggingTensorHook.after_create_session}
29+
#### `tf.train.LoggingTensorHook.after_create_session(session, coord)` {#LoggingTensorHook.after_create_session}
3030

3131
Called when new TensorFlow session is created.
3232

@@ -42,6 +42,7 @@ has two essential differences with the situation in which `begin` is called:
4242

4343

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

4647

4748
- - -

tensorflow/g3doc/api_docs/python/functions_and_classes/shard1/tf.train.NanTensorHook.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Initializes NanLoss monitor.
1717

1818
- - -
1919

20-
#### `tf.train.NanTensorHook.after_create_session(session)` {#NanTensorHook.after_create_session}
20+
#### `tf.train.NanTensorHook.after_create_session(session, coord)` {#NanTensorHook.after_create_session}
2121

2222
Called when new TensorFlow session is created.
2323

@@ -33,6 +33,7 @@ has two essential differences with the situation in which `begin` is called:
3333

3434

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

3738

3839
- - -

tensorflow/g3doc/api_docs/python/functions_and_classes/shard1/tf_debug.LocalCLIDebugHook.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Add a tensor filter.
4444

4545
- - -
4646

47-
#### `tf_debug.LocalCLIDebugHook.after_create_session(session)` {#LocalCLIDebugHook.after_create_session}
47+
#### `tf_debug.LocalCLIDebugHook.after_create_session(session, coord)` {#LocalCLIDebugHook.after_create_session}
4848

4949
Called when new TensorFlow session is created.
5050

@@ -60,6 +60,7 @@ has two essential differences with the situation in which `begin` is called:
6060

6161

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

6465

6566
- - -

tensorflow/g3doc/api_docs/python/functions_and_classes/shard2/tf.train.CheckpointSaverHook.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Initialize CheckpointSaverHook monitor.
2828

2929
- - -
3030

31-
#### `tf.train.CheckpointSaverHook.after_create_session(session)` {#CheckpointSaverHook.after_create_session}
31+
#### `tf.train.CheckpointSaverHook.after_create_session(session, coord)` {#CheckpointSaverHook.after_create_session}
3232

3333
Called when new TensorFlow session is created.
3434

@@ -44,6 +44,7 @@ has two essential differences with the situation in which `begin` is called:
4444

4545

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

4849

4950
- - -

tensorflow/g3doc/api_docs/python/functions_and_classes/shard3/tf.train.SyncReplicasOptimizer.md

Lines changed: 16 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -66,43 +66,22 @@ opt = tf.SyncReplicasOptimizer(opt, replicas_to_aggregate=50,
6666

6767
# Now you can call `minimize()` or `compute_gradients()` and
6868
# `apply_gradients()` normally
69-
grads = opt.minimize(total_loss, global_step=self.global_step)
69+
training_op = opt.minimize(total_loss, global_step=self.global_step)
7070

7171

72-
# You can now call get_init_tokens_op() and get_chief_queue_runner().
73-
# Note that get_init_tokens_op() must be called before creating session
74-
# because it modifies the graph by adding new nodes.
75-
init_token_op = opt.get_init_tokens_op()
76-
chief_queue_runner = opt.get_chief_queue_runner()
72+
# You can create the hook which handles initialization and queues.
73+
sync_replicas_hook = opt.make_session_run_hook(is_chief)
7774
```
7875

7976
In the training program, every worker will run the train_op as if not
80-
synchronized. But one worker (usually the chief) will need to execute the
81-
chief_queue_runner and get_init_tokens_op from this optimizer.
77+
synchronized.
8278

8379
```python
84-
# When you create the supervisor, you need to add the local_init_op and
85-
# ready_for_local_init_op to make sure the local_step is initialized to the
86-
# global_step. Here is an example:
87-
if is_chief:
88-
local_init_op = opt.chief_init_op
89-
else:
90-
local_init_op = opt.local_step_init_op
91-
ready_for_local_init_op = opt.ready_for_local_init_op
92-
sv = tf.Supervisor(graph=g,
93-
is_chief=is_chief,
94-
# This initialize local step.
95-
local_init_op=local_init_op,
96-
# This makes sure global step is initialized before using.
97-
ready_for_local_init_op=ready_for_local_init_op,
98-
saver=model.saver)
99-
100-
# After the session is created by the Supervisor and before the main while
101-
# loop:
102-
if is_chief and FLAGS.sync_replicas:
103-
sv.start_queue_runners(sess, [chief_queue_runner])
104-
# Insert initial tokens to the queue.
105-
sess.run(init_token_op)
80+
with training.MonitoredTrainingSession(
81+
master=workers[worker_id].target, is_chief=is_chief,
82+
hooks=[sync_replicas_hook]) as mon_sess:
83+
while not mon_sess.should_stop():
84+
mon_sess.run(training_op)
10685
```
10786

10887
- - -
@@ -280,3 +259,10 @@ This simply wraps the get_slot_names() from the actual optimizer.
280259
A list of strings.
281260

282261

262+
- - -
263+
264+
#### `tf.train.SyncReplicasOptimizer.make_session_run_hook(is_chief, num_tokens=-1)` {#SyncReplicasOptimizer.make_session_run_hook}
265+
266+
Creates a hook to handle SyncReplicasHook ops such as initialization.
267+
268+

tensorflow/g3doc/api_docs/python/functions_and_classes/shard4/tf_debug.DumpingDebugHook.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Create a local debugger command-line interface (CLI) hook.
3434

3535
- - -
3636

37-
#### `tf_debug.DumpingDebugHook.after_create_session(session)` {#DumpingDebugHook.after_create_session}
37+
#### `tf_debug.DumpingDebugHook.after_create_session(session, coord)` {#DumpingDebugHook.after_create_session}
3838

3939
Called when new TensorFlow session is created.
4040

@@ -50,6 +50,7 @@ has two essential differences with the situation in which `begin` is called:
5050

5151

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

5455

5556
- - -

tensorflow/g3doc/api_docs/python/functions_and_classes/shard5/tf.contrib.learn.monitors.RunHookAdapterForMonitors.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Wraps monitors into a SessionRunHook.
88

99
- - -
1010

11-
#### `tf.contrib.learn.monitors.RunHookAdapterForMonitors.after_create_session(session)` {#RunHookAdapterForMonitors.after_create_session}
11+
#### `tf.contrib.learn.monitors.RunHookAdapterForMonitors.after_create_session(session, coord)` {#RunHookAdapterForMonitors.after_create_session}
1212

1313
Called when new TensorFlow session is created.
1414

@@ -24,6 +24,7 @@ has two essential differences with the situation in which `begin` is called:
2424

2525

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

2829

2930
- - -

0 commit comments

Comments
 (0)