提交 728be3e6 编写于 作者: Y Yifei Feng

Regenerate docs for 0.12 rc1.

上级 d2912e62
......@@ -2862,17 +2862,6 @@ The following standard keys are defined:
* `WEIGHTS`: weights inside neural network layers
* `BIASES`: biases inside neural network layers
* `ACTIVATIONS`: activations of neural network layers
- - -
#### `tf.GraphKeys.VARIABLES` {#GraphKeys.VARIABLES}
DEPRECATED FUNCTION
THIS FUNCTION IS DEPRECATED. It will be removed after 2017-03-02.
Instructions for updating:
VARIABLES collection name is deprecated, please use GLOBAL_VARIABLES instead
## Defining new operations
......
......@@ -2,7 +2,7 @@
See `tf.global_variables`. (deprecated)
THIS FUNCTION IS DEPRECATED. It will be removed after 2016-03-02.
THIS FUNCTION IS DEPRECATED. It will be removed after 2017-03-02.
Instructions for updating:
Please use tf.global_variables instead.
### `tf.merge_all_summaries(key='summaries')` {#merge_all_summaries}
### `tf.merge_all_summaries(*args, **kwargs)` {#merge_all_summaries}
Merges all summaries collected in the default graph.
Merges all summaries collected in the default graph. (deprecated)
##### Args:
THIS FUNCTION IS DEPRECATED. It will be removed after 2016-11-30.
Instructions for updating:
Please switch to tf.summary.merge_all.
Args:
key: `GraphKey` used to collect the summaries. Defaults to
`GraphKeys.SUMMARIES`.
* <b>`key`</b>: `GraphKey` used to collect the summaries. Defaults to
`GraphKeys.SUMMARIES`.
##### Returns:
If no summaries were collected, returns None. Otherwise returns a scalar
`Tensor` of type `string` containing the serialized `Summary` protocol
buffer resulting from the merging.
Returns:
If no summaries were collected, returns None. Otherwise returns a scalar
`Tensor` of type `string` containing the serialized `Summary` protocol
buffer resulting from the merging.
### `tf.image_summary(tag, tensor, max_images=3, collections=None, name=None)` {#image_summary}
Outputs a `Summary` protocol buffer with images.
The summary has up to `max_images` summary values containing images. The
images are built from `tensor` which must be 4-D with shape `[batch_size,
height, width, channels]` and where `channels` can be:
* 1: `tensor` is interpreted as Grayscale.
* 3: `tensor` is interpreted as RGB.
* 4: `tensor` is interpreted as RGBA.
The images have the same number of channels as the input tensor. For float
input, the values are normalized one image at a time to fit in the range
`[0, 255]`. `uint8` values are unchanged. The op uses two different
normalization algorithms:
* If the input values are all positive, they are rescaled so the largest one
is 255.
* If any input value is negative, the values are shifted so input value 0.0
is at 127. They are then rescaled so that either the smallest value is 0,
or the largest one is 255.
The `tag` argument is a scalar `Tensor` of type `string`. It is used to
build the `tag` of the summary values:
* If `max_images` is 1, the summary value tag is '*tag*/image'.
* If `max_images` is greater than 1, the summary value tags are
generated sequentially as '*tag*/image/0', '*tag*/image/1', etc.
##### Args:
* <b>`tag`</b>: A scalar `Tensor` of type `string`. Used to build the `tag`
of the summary values.
* <b>`tensor`</b>: A 4-D `uint8` or `float32` `Tensor` of shape `[batch_size, height,
width, channels]` where `channels` is 1, 3, or 4.
* <b>`max_images`</b>: Max number of batch elements to generate images for.
* <b>`collections`</b>: Optional list of ops.GraphKeys. The collections to add the
summary to. Defaults to [ops.GraphKeys.SUMMARIES]
* <b>`name`</b>: A name for the operation (optional).
##### Returns:
A scalar `Tensor` of type `string`. The serialized `Summary` protocol
buffer.
### `tf.image_summary(*args, **kwargs)` {#image_summary}
Outputs a `Summary` protocol buffer with images. (deprecated)
THIS FUNCTION IS DEPRECATED. It will be removed after 2016-11-30.
Instructions for updating:
Please switch to tf.summary.image. Note that tf.summary.histogram uses the node name instead of the tag. This means that TensorFlow will automatically de-duplicate summary names based on the scope they are created in. Also, the max_images argument was renamed to max_outputs.
The summary has up to `max_images` summary values containing images. The
images are built from `tensor` which must be 4-D with shape `[batch_size,
height, width, channels]` and where `channels` can be:
* 1: `tensor` is interpreted as Grayscale.
* 3: `tensor` is interpreted as RGB.
* 4: `tensor` is interpreted as RGBA.
The images have the same number of channels as the input tensor. For float
input, the values are normalized one image at a time to fit in the range
`[0, 255]`. `uint8` values are unchanged. The op uses two different
normalization algorithms:
* If the input values are all positive, they are rescaled so the largest one
is 255.
* If any input value is negative, the values are shifted so input value 0.0
is at 127. They are then rescaled so that either the smallest value is 0,
or the largest one is 255.
The `tag` argument is a scalar `Tensor` of type `string`. It is used to
build the `tag` of the summary values:
* If `max_images` is 1, the summary value tag is '*tag*/image'.
* If `max_images` is greater than 1, the summary value tags are
generated sequentially as '*tag*/image/0', '*tag*/image/1', etc.
Args:
tag: A scalar `Tensor` of type `string`. Used to build the `tag`
of the summary values.
tensor: A 4-D `uint8` or `float32` `Tensor` of shape `[batch_size, height,
width, channels]` where `channels` is 1, 3, or 4.
max_images: Max number of batch elements to generate images for.
collections: Optional list of ops.GraphKeys. The collections to add the
summary to. Defaults to [ops.GraphKeys.SUMMARIES]
name: A name for the operation (optional).
Returns:
A scalar `Tensor` of type `string`. The serialized `Summary` protocol
buffer.
### `tf.scalar_summary(tags, values, collections=None, name=None)` {#scalar_summary}
### `tf.scalar_summary(*args, **kwargs)` {#scalar_summary}
Outputs a `Summary` protocol buffer with scalar values.
Outputs a `Summary` protocol buffer with scalar values. (deprecated)
The input `tags` and `values` must have the same shape. The generated
summary has a summary value for each tag-value pair in `tags` and `values`.
THIS FUNCTION IS DEPRECATED. It will be removed after 2016-11-30.
Instructions for updating:
Please switch to tf.summary.scalar. Note that tf.summary.scalar uses the node name instead of the tag. This means that TensorFlow will automatically de-duplicate summary names based on the scope they are created in. Also, passing a tensor or list of tags to a scalar summary op is no longer supported.
##### Args:
The input `tags` and `values` must have the same shape. The generated
summary has a summary value for each tag-value pair in `tags` and `values`.
Args:
tags: A `string` `Tensor`. Tags for the summaries.
values: A real numeric Tensor. Values for the summaries.
collections: Optional list of graph collections keys. The new summary op is
added to these collections. Defaults to `[GraphKeys.SUMMARIES]`.
name: A name for the operation (optional).
* <b>`tags`</b>: A `string` `Tensor`. Tags for the summaries.
* <b>`values`</b>: A real numeric Tensor. Values for the summaries.
* <b>`collections`</b>: Optional list of graph collections keys. The new summary op is
added to these collections. Defaults to `[GraphKeys.SUMMARIES]`.
* <b>`name`</b>: A name for the operation (optional).
##### Returns:
A scalar `Tensor` of type `string`. The serialized `Summary` protocol
buffer.
Returns:
A scalar `Tensor` of type `string`. The serialized `Summary` protocol
buffer.
### `tf.histogram_summary(tag, values, collections=None, name=None)` {#histogram_summary}
### `tf.histogram_summary(*args, **kwargs)` {#histogram_summary}
Outputs a `Summary` protocol buffer with a histogram.
Outputs a `Summary` protocol buffer with a histogram. (deprecated)
The generated
[`Summary`](https://www.tensorflow.org/code/tensorflow/core/framework/summary.proto)
has one summary value containing a histogram for `values`.
THIS FUNCTION IS DEPRECATED. It will be removed after 2016-11-30.
Instructions for updating:
Please switch to tf.summary.histogram. Note that tf.summary.histogram uses the node name instead of the tag. This means that TensorFlow will automatically de-duplicate summary names based on their scope.
This op reports an `InvalidArgument` error if any value is not finite.
The generated
[`Summary`](https://www.tensorflow.org/code/tensorflow/core/framework/summary.proto)
has one summary value containing a histogram for `values`.
##### Args:
This op reports an `InvalidArgument` error if any value is not finite.
Args:
tag: A `string` `Tensor`. 0-D. Tag to use for the summary value.
values: A real numeric `Tensor`. Any shape. Values to use to
build the histogram.
collections: Optional list of graph collections keys. The new summary op is
added to these collections. Defaults to `[GraphKeys.SUMMARIES]`.
name: A name for the operation (optional).
* <b>`tag`</b>: A `string` `Tensor`. 0-D. Tag to use for the summary value.
* <b>`values`</b>: A real numeric `Tensor`. Any shape. Values to use to
build the histogram.
* <b>`collections`</b>: Optional list of graph collections keys. The new summary op is
added to these collections. Defaults to `[GraphKeys.SUMMARIES]`.
* <b>`name`</b>: A name for the operation (optional).
##### Returns:
A scalar `Tensor` of type `string`. The serialized `Summary` protocol
buffer.
Returns:
A scalar `Tensor` of type `string`. The serialized `Summary` protocol
buffer.
### `tf.merge_summary(inputs, collections=None, name=None)` {#merge_summary}
### `tf.merge_summary(*args, **kwargs)` {#merge_summary}
Merges summaries.
Merges summaries. (deprecated)
This op creates a
[`Summary`](https://www.tensorflow.org/code/tensorflow/core/framework/summary.proto)
protocol buffer that contains the union of all the values in the input
summaries.
THIS FUNCTION IS DEPRECATED. It will be removed after 2016-11-30.
Instructions for updating:
Please switch to tf.summary.merge.
When the Op is run, it reports an `InvalidArgument` error if multiple values
in the summaries to merge use the same tag.
This op creates a
[`Summary`](https://www.tensorflow.org/code/tensorflow/core/framework/summary.proto)
protocol buffer that contains the union of all the values in the input
summaries.
##### Args:
When the Op is run, it reports an `InvalidArgument` error if multiple values
in the summaries to merge use the same tag.
Args:
inputs: A list of `string` `Tensor` objects containing serialized `Summary`
protocol buffers.
collections: Optional list of graph collections keys. The new summary op is
added to these collections. Defaults to `[GraphKeys.SUMMARIES]`.
name: A name for the operation (optional).
* <b>`inputs`</b>: A list of `string` `Tensor` objects containing serialized `Summary`
protocol buffers.
* <b>`collections`</b>: Optional list of graph collections keys. The new summary op is
added to these collections. Defaults to `[GraphKeys.SUMMARIES]`.
* <b>`name`</b>: A name for the operation (optional).
##### Returns:
A scalar `Tensor` of type `string`. The serialized `Summary` protocol
buffer resulting from the merging.
Returns:
A scalar `Tensor` of type `string`. The serialized `Summary` protocol
buffer resulting from the merging.
Writes `Summary` protocol buffers to event files.
The `FileWriter` class provides a mechanism to create an event file in a
given directory and add summaries and events to it. The class updates the
file contents asynchronously. This allows a training program to call methods
to add data to the file directly from the training loop, without slowing down
training.
- - -
#### `tf.train.SummaryWriter.__init__(logdir, graph=None, max_queue=10, flush_secs=120, graph_def=None)` {#SummaryWriter.__init__}
Creates a `FileWriter` and an event file.
#### `tf.train.SummaryWriter.__init__(*args, **kwargs)` {#SummaryWriter.__init__}
On construction the summary writer creates a new event file in `logdir`.
This event file will contain `Event` protocol buffers constructed when you
call one of the following functions: `add_summary()`, `add_session_log()`,
`add_event()`, or `add_graph()`.
Creates a `SummaryWriter` and an event file. (deprecated)
If you pass a `Graph` to the constructor it is added to
the event file. (This is equivalent to calling `add_graph()` later).
THIS FUNCTION IS DEPRECATED. It will be removed after 2016-11-30.
Instructions for updating:
Please switch to tf.summary.FileWriter. The interface and behavior is the same; this is just a rename.
TensorBoard will pick the graph from the file and display it graphically so
you can interactively explore the graph you built. You will usually pass
the graph from the session in which you launched it:
This class is deprecated, and should be replaced with tf.summary.FileWriter.
```python
...create a graph...
# Launch the graph in a session.
sess = tf.Session()
# Create a summary writer, add the 'graph' to the event file.
writer = tf.train.SummaryWriter(<some-directory>, sess.graph)
```
On construction the summary writer creates a new event file in `logdir`.
This event file will contain `Event` protocol buffers constructed when you
call one of the following functions: `add_summary()`, `add_session_log()`,
`add_event()`, or `add_graph()`.
The other arguments to the constructor control the asynchronous writes to
the event file:
If you pass a `Graph` to the constructor it is added to
the event file. (This is equivalent to calling `add_graph()` later).
* `flush_secs`: How often, in seconds, to flush the added summaries
and events to disk.
* `max_queue`: Maximum number of summaries or events pending to be
written to disk before one of the 'add' calls block.
TensorBoard will pick the graph from the file and display it graphically so
you can interactively explore the graph you built. You will usually pass
the graph from the session in which you launched it:
##### Args:
```python
...create a graph...
# Launch the graph in a session.
sess = tf.Session()
# Create a summary writer, add the 'graph' to the event file.
writer = tf.train.SummaryWriter(<some-directory>, sess.graph)
```
The other arguments to the constructor control the asynchronous writes to
the event file:
* <b>`logdir`</b>: A string. Directory where event file will be written.
* <b>`graph`</b>: A `Graph` object, such as `sess.graph`.
* <b>`max_queue`</b>: Integer. Size of the queue for pending events and summaries.
* <b>`flush_secs`</b>: Number. How often, in seconds, to flush the
pending events and summaries to disk.
* <b>`graph_def`</b>: DEPRECATED: Use the `graph` argument instead.
* `flush_secs`: How often, in seconds, to flush the added summaries
and events to disk.
* `max_queue`: Maximum number of summaries or events pending to be
written to disk before one of the 'add' calls block.
Args:
logdir: A string. Directory where event file will be written.
graph: A `Graph` object, such as `sess.graph`.
max_queue: Integer. Size of the queue for pending events and summaries.
flush_secs: Number. How often, in seconds, to flush the
pending events and summaries to disk.
graph_def: DEPRECATED: Use the `graph` argument instead.
- - -
#### `tf.train.SummaryWriter.add_summary(summary, global_step=None)` {#SummaryWriter.add_summary}
Adds a `Summary` protocol buffer to the event file.
This method wraps the provided summary in an `Event` protocol buffer
and adds it to the event file.
#### `tf.train.SummaryWriter.add_event(event)` {#SummaryWriter.add_event}
You can pass the result of evaluating any summary op, using
[`Session.run()`](client.md#Session.run) or
[`Tensor.eval()`](framework.md#Tensor.eval), to this
function. Alternatively, you can pass a `tf.Summary` protocol
buffer that you populate with your own data. The latter is
commonly done to report evaluation results in event files.
Adds an event to the event file.
##### Args:
* <b>`summary`</b>: A `Summary` protocol buffer, optionally serialized as a string.
* <b>`global_step`</b>: Number. Optional global step value to record with the
summary.
* <b>`event`</b>: An `Event` protocol buffer.
- - -
#### `tf.train.SummaryWriter.add_session_log(session_log, global_step=None)` {#SummaryWriter.add_session_log}
#### `tf.train.SummaryWriter.add_graph(graph, global_step=None, graph_def=None)` {#SummaryWriter.add_graph}
Adds a `SessionLog` protocol buffer to the event file.
Adds a `Graph` to the event file.
This method wraps the provided session in an `Event` protocol buffer
and adds it to the event file.
The graph described by the protocol buffer will be displayed by
TensorBoard. Most users pass a graph in the constructor instead.
##### Args:
* <b>`session_log`</b>: A `SessionLog` protocol buffer.
* <b>`global_step`</b>: Number. Optional global step value to record with the
summary.
- - -
#### `tf.train.SummaryWriter.add_event(event)` {#SummaryWriter.add_event}
Adds an event to the event file.
* <b>`graph`</b>: A `Graph` object, such as `sess.graph`.
* <b>`global_step`</b>: Number. Optional global step counter to record with the
graph.
* <b>`graph_def`</b>: DEPRECATED. Use the `graph` parameter instead.
##### Args:
##### Raises:
* <b>`event`</b>: An `Event` protocol buffer.
* <b>`ValueError`</b>: If both graph and graph_def are passed to the method.
- - -
#### `tf.train.SummaryWriter.add_graph(graph, global_step=None, graph_def=None)` {#SummaryWriter.add_graph}
#### `tf.train.SummaryWriter.add_meta_graph(meta_graph_def, global_step=None)` {#SummaryWriter.add_meta_graph}
Adds a `Graph` to the event file.
Adds a `MetaGraphDef` to the event file.
The graph described by the protocol buffer will be displayed by
TensorBoard. Most users pass a graph in the constructor instead.
The `MetaGraphDef` allows running the given graph via
`saver.import_meta_graph()`.
##### Args:
* <b>`graph`</b>: A `Graph` object, such as `sess.graph`.
* <b>`meta_graph_def`</b>: A `MetaGraphDef` object, often as retured by
`saver.export_meta_graph()`.
* <b>`global_step`</b>: Number. Optional global step counter to record with the
graph.
* <b>`graph_def`</b>: DEPRECATED. Use the `graph` parameter instead.
##### Raises:
* <b>`ValueError`</b>: If both graph and graph_def are passed to the method.
* <b>`TypeError`</b>: If both `meta_graph_def` is not an instance of `MetaGraphDef`.
- - -
......@@ -150,20 +128,43 @@ Adds a metadata information for a single session.run() call.
- - -
#### `tf.train.SummaryWriter.get_logdir()` {#SummaryWriter.get_logdir}
#### `tf.train.SummaryWriter.add_session_log(session_log, global_step=None)` {#SummaryWriter.add_session_log}
Returns the directory where event file will be written.
Adds a `SessionLog` protocol buffer to the event file.
This method wraps the provided session in an `Event` protocol buffer
and adds it to the event file.
##### Args:
* <b>`session_log`</b>: A `SessionLog` protocol buffer.
* <b>`global_step`</b>: Number. Optional global step value to record with the
summary.
- - -
#### `tf.train.SummaryWriter.flush()` {#SummaryWriter.flush}
#### `tf.train.SummaryWriter.add_summary(summary, global_step=None)` {#SummaryWriter.add_summary}
Flushes the event file to disk.
Adds a `Summary` protocol buffer to the event file.
Call this method to make sure that all pending events have been written to
disk.
This method wraps the provided summary in an `Event` protocol buffer
and adds it to the event file.
You can pass the result of evaluating any summary op, using
[`Session.run()`](client.md#Session.run) or
[`Tensor.eval()`](framework.md#Tensor.eval), to this
function. Alternatively, you can pass a `tf.Summary` protocol
buffer that you populate with your own data. The latter is
commonly done to report evaluation results in event files.
##### Args:
* <b>`summary`</b>: A `Summary` protocol buffer, optionally serialized as a string.
* <b>`global_step`</b>: Number. Optional global step value to record with the
summary.
- - -
......@@ -175,8 +176,23 @@ Flushes the event file to disk and close the file.
Call this method when you do not need the summary writer anymore.
- - -
#### `tf.train.SummaryWriter.flush()` {#SummaryWriter.flush}
Flushes the event file to disk.
Call this method to make sure that all pending events have been written to
disk.
- - -
#### `tf.train.SummaryWriter.get_logdir()` {#SummaryWriter.get_logdir}
Returns the directory where event file will be written.
#### Other Methods
- - -
#### `tf.train.SummaryWriter.reopen()` {#SummaryWriter.reopen}
......
......@@ -42,14 +42,3 @@ The following standard keys are defined:
* `WEIGHTS`: weights inside neural network layers
* `BIASES`: biases inside neural network layers
* `ACTIVATIONS`: activations of neural network layers
- - -
#### `tf.GraphKeys.VARIABLES` {#GraphKeys.VARIABLES}
DEPRECATED FUNCTION
THIS FUNCTION IS DEPRECATED. It will be removed after 2017-03-02.
Instructions for updating:
VARIABLES collection name is deprecated, please use GLOBAL_VARIABLES instead
......@@ -51,12 +51,12 @@ with tf.Session() as sess:
```
The most common initialization pattern is to use the convenience function
`global_variable_initializers()` to add an Op to the graph that initializes
`global_variables_initializer()` to add an Op to the graph that initializes
all the variables. You then run that Op after launching the graph.
```python
# Add an Op to initialize global variables.
init_op = tf.global_variable_initializers()
init_op = tf.global_variables_initializer()
# Launch the graph in a session.
with tf.Session() as sess:
......@@ -301,7 +301,7 @@ more information on launching a graph and on sessions.
```python
v = tf.Variable([1, 2])
init = tf.global_variable_initializers()
init = tf.global_variables_initializer()
with tf.Session() as sess:
sess.run(init)
......
### `tf.audio_summary(tag, tensor, sample_rate, max_outputs=3, collections=None, name=None)` {#audio_summary}
Outputs a `Summary` protocol buffer with audio.
The summary has up to `max_outputs` summary values containing audio. The
audio is built from `tensor` which must be 3-D with shape `[batch_size,
frames, channels]` or 2-D with shape `[batch_size, frames]`. The values are
assumed to be in the range of `[-1.0, 1.0]` with a sample rate of
`sample_rate`.
The `tag` argument is a scalar `Tensor` of type `string`. It is used to
build the `tag` of the summary values:
* If `max_outputs` is 1, the summary value tag is '*tag*/audio'.
* If `max_outputs` is greater than 1, the summary value tags are
generated sequentially as '*tag*/audio/0', '*tag*/audio/1', etc.
##### Args:
* <b>`tag`</b>: A scalar `Tensor` of type `string`. Used to build the `tag`
of the summary values.
* <b>`tensor`</b>: A 3-D `float32` `Tensor` of shape `[batch_size, frames, channels]`
or a 2-D `float32` `Tensor` of shape `[batch_size, frames]`.
* <b>`sample_rate`</b>: A Scalar `float32` `Tensor` indicating the sample rate of the
signal in hertz.
* <b>`max_outputs`</b>: Max number of batch elements to generate audio for.
* <b>`collections`</b>: Optional list of ops.GraphKeys. The collections to add the
summary to. Defaults to [ops.GraphKeys.SUMMARIES]
* <b>`name`</b>: A name for the operation (optional).
##### Returns:
A scalar `Tensor` of type `string`. The serialized `Summary` protocol
buffer.
### `tf.audio_summary(*args, **kwargs)` {#audio_summary}
Outputs a `Summary` protocol buffer with audio. (deprecated)
THIS FUNCTION IS DEPRECATED. It will be removed after 2016-11-30.
Instructions for updating:
Please switch to tf.summary.audio. Note that tf.summary.histogram uses the node name instead of the tag. This means that TensorFlow will automatically de-duplicate summary names based on the scope they are created in.
The summary has up to `max_outputs` summary values containing audio. The
audio is built from `tensor` which must be 3-D with shape `[batch_size,
frames, channels]` or 2-D with shape `[batch_size, frames]`. The values are
assumed to be in the range of `[-1.0, 1.0]` with a sample rate of
`sample_rate`.
The `tag` argument is a scalar `Tensor` of type `string`. It is used to
build the `tag` of the summary values:
* If `max_outputs` is 1, the summary value tag is '*tag*/audio'.
* If `max_outputs` is greater than 1, the summary value tags are
generated sequentially as '*tag*/audio/0', '*tag*/audio/1', etc.
Args:
tag: A scalar `Tensor` of type `string`. Used to build the `tag`
of the summary values.
tensor: A 3-D `float32` `Tensor` of shape `[batch_size, frames, channels]`
or a 2-D `float32` `Tensor` of shape `[batch_size, frames]`.
sample_rate: A Scalar `float32` `Tensor` indicating the sample rate of the
signal in hertz.
max_outputs: Max number of batch elements to generate audio for.
collections: Optional list of ops.GraphKeys. The collections to add the
summary to. Defaults to [ops.GraphKeys.SUMMARIES]
name: A name for the operation (optional).
Returns:
A scalar `Tensor` of type `string`. The serialized `Summary` protocol
buffer.
......@@ -66,12 +66,12 @@ with tf.Session() as sess:
```
The most common initialization pattern is to use the convenience function
`global_variable_initializers()` to add an Op to the graph that initializes
`global_variables_initializer()` to add an Op to the graph that initializes
all the variables. You then run that Op after launching the graph.
```python
# Add an Op to initialize global variables.
init_op = tf.global_variable_initializers()
init_op = tf.global_variables_initializer()
# Launch the graph in a session.
with tf.Session() as sess:
......@@ -316,7 +316,7 @@ more information on launching a graph and on sessions.
```python
v = tf.Variable([1, 2])
init = tf.global_variable_initializers()
init = tf.global_variables_initializer()
with tf.Session() as sess:
sess.run(init)
......@@ -3493,7 +3493,7 @@ device assignments have not changed.
See `tf.global_variables`. (deprecated)
THIS FUNCTION IS DEPRECATED. It will be removed after 2016-03-02.
THIS FUNCTION IS DEPRECATED. It will be removed after 2017-03-02.
Instructions for updating:
Please use tf.global_variables instead.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册