TensorFlow: Upstream changes to git.

Changes:
- Documentation updates.
- Relax numpy requirement to 1.9.2

Base CL: 107349632
This commit is contained in:
Manjunath Kudlur 2015-11-08 17:41:48 -08:00
parent 1d3874fe2f
commit b2dc60eaa9
34 changed files with 398 additions and 314 deletions

View File

@ -626,7 +626,7 @@ REGISTER_OP("SegmentSum")
.Doc(R"doc( .Doc(R"doc(
Computes the sum along segments of a tensor. Computes the sum along segments of a tensor.
Read [the section on Segmentation](../python/math_ops.md#segmentation) Read [the section on Segmentation](../../api_docs/python/math_ops.md#segmentation)
for an explanation of segments. for an explanation of segments.
Computes a tensor such that Computes a tensor such that
@ -653,8 +653,9 @@ REGISTER_OP("SegmentMean")
.Doc(R"doc( .Doc(R"doc(
Computes the mean along segments of a tensor. Computes the mean along segments of a tensor.
Read [the section on Segmentation](../python/math_ops.md#segmentation) Read [the section on
for an explanation of segments. Segmentation](../../api_docs/python/math_ops.md#segmentation) for an explanation
of segments.
Computes a tensor such that Computes a tensor such that
\\(output_i = \frac{\sum_j data_j}{N}\\) where `mean` is \\(output_i = \frac{\sum_j data_j}{N}\\) where `mean` is
@ -681,8 +682,9 @@ REGISTER_OP("SegmentProd")
.Doc(R"doc( .Doc(R"doc(
Computes the product along segments of a tensor. Computes the product along segments of a tensor.
Read [the section on Segmentation](../python/math_ops.md#segmentation) Read [the section on
for an explanation of segments. Segmentation](../../api_docs/python/math_ops.md#segmentation) for an explanation
of segments.
Computes a tensor such that Computes a tensor such that
\\(output_i = \prod_j data_j\\) where the product is over `j` such \\(output_i = \prod_j data_j\\) where the product is over `j` such
@ -708,8 +710,9 @@ REGISTER_OP("SegmentMin")
.Doc(R"doc( .Doc(R"doc(
Computes the minimum along segments of a tensor. Computes the minimum along segments of a tensor.
Read [the section on Segmentation](../python/math_ops.md#segmentation) Read [the section on
for an explanation of segments. Segmentation](../../api_docs/python/math_ops.md#segmentation) for an explanation
of segments.
Computes a tensor such that Computes a tensor such that
\\(output_i = \min_j(data_j)\\) where `min` is over `j` such \\(output_i = \min_j(data_j)\\) where `min` is over `j` such
@ -735,7 +738,7 @@ REGISTER_OP("SegmentMax")
.Doc(R"doc( .Doc(R"doc(
Computes the maximum along segments of a tensor. Computes the maximum along segments of a tensor.
Read [the section on Segmentation](../python/math_ops.md#segmentation) Read [the section on Segmentation](../../api_docs/python/math_ops.md#segmentation)
for an explanation of segments. for an explanation of segments.
Computes a tensor such that Computes a tensor such that
@ -763,8 +766,9 @@ REGISTER_OP("UnsortedSegmentSum")
.Doc(R"doc( .Doc(R"doc(
Computes the sum along segments of a tensor. Computes the sum along segments of a tensor.
Read [the section on Segmentation](../python/math_ops.md#segmentation) Read [the section on
for an explanation of segments. Segmentation](../../api_docs/python/math_ops.md#segmentation) for an explanation
of segments.
Computes a tensor such that Computes a tensor such that
\\(output_i = \sum_j data_j\\) where sum is over `j` such \\(output_i = \sum_j data_j\\) where sum is over `j` such
@ -797,8 +801,9 @@ REGISTER_OP("SparseSegmentSum")
.Doc(R"doc( .Doc(R"doc(
Computes the sum along sparse segments of a tensor. Computes the sum along sparse segments of a tensor.
Read [the section on Segmentation](../python/math_ops.md#segmentation) Read [the section on
for an explanation of segments. Segmentation](../../api_docs/python/math_ops.md#segmentation) for an explanation
of segments.
Like `SegmentSum`, but `segment_ids` can have rank less than `data`'s first Like `SegmentSum`, but `segment_ids` can have rank less than `data`'s first
dimension, selecting a subset of dimension_0, specified by `indices`. dimension, selecting a subset of dimension_0, specified by `indices`.
@ -843,8 +848,9 @@ REGISTER_OP("SparseSegmentMean")
.Doc(R"doc( .Doc(R"doc(
Computes the mean along sparse segments of a tensor. Computes the mean along sparse segments of a tensor.
Read [the section on Segmentation](../python/math_ops.md#segmentation) Read [the section on
for an explanation of segments. Segmentation](../../api_docs/python/math_ops.md#segmentation) for an explanation
of segments.
Like `SegmentMean`, but `segment_ids` can have rank less than `data`'s first Like `SegmentMean`, but `segment_ids` can have rank less than `data`'s first
dimension, selecting a subset of dimension_0, specified by `indices`. dimension, selecting a subset of dimension_0, specified by `indices`.

View File

@ -3,8 +3,8 @@
TensorFlow's public C++ API includes only the API for executing graphs, as of TensorFlow's public C++ API includes only the API for executing graphs, as of
version 0.5. To control the execution of a graph from C++: version 0.5. To control the execution of a graph from C++:
1. Build the computation graph using the [Python API](../python/). 1. Build the computation graph using the [Python API](../../api_docs/python/).
1. Use [tf.train.write_graph()](../python/train.md#write_graph) to 1. Use [tf.train.write_graph()](../../api_docs/python/train.md#write_graph) to
write the graph to a file. write the graph to a file.
1. Load the graph using the C++ Session API. For example: 1. Load the graph using the C++ Session API. For example:

View File

@ -2,8 +2,8 @@
# Tensor Transformations <a class="md-anchor" id="AUTOGENERATED-tensor-transformations"></a> # Tensor Transformations <a class="md-anchor" id="AUTOGENERATED-tensor-transformations"></a>
Note: Functions taking `Tensor` arguments can also take anything Note: Functions taking `Tensor` arguments can also take anything accepted by
accepted by [`tf.convert_to_tensor`](framework.md#convert_to_tensor). [`tf.convert_to_tensor`](../../api_docs/python/framework.md#convert_to_tensor).
<!-- TOC-BEGIN This section is generated by neural network: DO NOT EDIT! --> <!-- TOC-BEGIN This section is generated by neural network: DO NOT EDIT! -->
## Contents ## Contents

View File

@ -61,8 +61,8 @@ print sess.run(c)
``` ```
A session may own resources, such as A session may own resources, such as
[variables](state_ops.md#Variable), [queues](io_ops.md#QueueBase), [variables](../../api_docs/python/state_ops.md#Variable), [queues](../../api_docs/python/io_ops.md#QueueBase),
and [readers](io_ops.md#ReaderBase). It is important to release and [readers](../../api_docs/python/io_ops.md#ReaderBase). It is important to release
these resources when they are no longer required. To do this, either these resources when they are no longer required. To do this, either
invoke the [`close()`](#Session.close) method on the session, or use invoke the [`close()`](#Session.close) method on the session, or use
the session as a context manager. The following two examples are the session as a context manager. The following two examples are
@ -134,30 +134,31 @@ graph element, and these determine the return value of this
method. A graph element can be one of the following types: method. A graph element can be one of the following types:
* If the *i*th element of `fetches` is an * If the *i*th element of `fetches` is an
[`Operation`](framework.md#Operation), the *i*th return value [`Operation`](../../api_docs/python/framework.md#Operation), the *i*th
will be `None`. return value will be `None`.
* If the *i*th element of `fetches` is a * If the *i*th element of `fetches` is a
[`Tensor`](framework.md#Tensor), the *i*th return value will [`Tensor`](../../api_docs/python/framework.md#Tensor), the *i*th return
be a numpy ndarray containing the value of that tensor. value will be a numpy ndarray containing the value of that tensor.
* If the *i*th element of `fetches` is a * If the *i*th element of `fetches` is a
[`SparseTensor`](sparse_ops.md#SparseTensor), the *i*th [`SparseTensor`](../../api_docs/python/sparse_ops.md#SparseTensor),
return value will be a the *i*th return value will be a
[`SparseTensorValue`](sparse_ops.md#SparseTensorValue) [`SparseTensorValue`](../../api_docs/python/sparse_ops.md#SparseTensorValue)
containing the value of that sparse tensor. containing the value of that sparse tensor.
The optional `feed_dict` argument allows the caller to override The optional `feed_dict` argument allows the caller to override
the value of tensors in the graph. Each key in `feed_dict` can be the value of tensors in the graph. Each key in `feed_dict` can be
one of the following types: one of the following types:
* If the key is a [`Tensor`](framework.md#Tensor), the * If the key is a [`Tensor`](../../api_docs/python/framework.md#Tensor), the
value may be a Python scalar, string, list, or numpy ndarray value may be a Python scalar, string, list, or numpy ndarray
that can be converted to the same `dtype` as that that can be converted to the same `dtype` as that
tensor. Additionally, if the key is a tensor. Additionally, if the key is a
[placeholder](io_ops.md#placeholder), the shape of the value [placeholder](../../api_docs/python/io_ops.md#placeholder), the shape of
will be checked for compatibility with the placeholder. the value will be checked for compatibility with the placeholder.
* If the key is a [`SparseTensor`](sparse_ops.md#SparseTensor), * If the key is a
[`SparseTensor`](../../api_docs/python/sparse_ops.md#SparseTensor),
the value should be a the value should be a
[`SparseTensorValue`](sparse_ops.md#SparseTensorValue). [`SparseTensorValue`](../../api_docs/python/sparse_ops.md#SparseTensorValue).
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a> ##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
@ -211,9 +212,9 @@ The graph that was launched in this session.
Returns a context manager that makes this object the default session. Returns a context manager that makes this object the default session.
Use with the `with` keyword to specify that calls to Use with the `with` keyword to specify that calls to
[`Operation.run()`](framework.md#Operation.run) or [`Operation.run()`](../../api_docs/python/framework.md#Operation.run) or
[`Tensor.run()`](framework.md#Tensor.run) should be executed in [`Tensor.run()`](../../api_docs/python/framework.md#Tensor.run) should be
this session. executed in this session.
```python ```python
c = tf.constant(..) c = tf.constant(..)
@ -267,9 +268,9 @@ A TensorFlow `Session` for use in interactive contexts, such as a shell.
The only difference with a regular `Session` is that an `InteractiveSession` The only difference with a regular `Session` is that an `InteractiveSession`
installs itself as the default session on construction. installs itself as the default session on construction.
The methods [`Tensor.eval()`](framework.md#Tensor.eval) and The methods [`Tensor.eval()`](../../api_docs/python/framework.md#Tensor.eval)
[`Operation.run()`](framework.md#Operation.run) will use that session and [`Operation.run()`](../../api_docs/python/framework.md#Operation.run)
to run ops. will use that session to run ops.
This is convenient in interactive shells and [IPython This is convenient in interactive shells and [IPython
notebooks](http://ipython.org), as it avoids having to pass an explicit notebooks](http://ipython.org), as it avoids having to pass an explicit
@ -371,7 +372,7 @@ The operation that failed, if known.
*N.B.* If the failed op was synthesized at runtime, e.g. a `Send` *N.B.* If the failed op was synthesized at runtime, e.g. a `Send`
or `Recv` op, there will be no corresponding or `Recv` op, there will be no corresponding
[`Operation`](framework.md#Operation) object. In that case, this [`Operation`](../../api_docs/python/framework.md#Operation) object. In that case, this
will return `None`, and you should instead use the will return `None`, and you should instead use the
[`OpError.node_def`](#OpError.node_def) to discover information about the [`OpError.node_def`](#OpError.node_def) to discover information about the
op. op.
@ -423,11 +424,12 @@ The error message that describes the error.
Raised when an operation or step is cancelled. Raised when an operation or step is cancelled.
For example, a long-running operation (e.g. For example, a long-running operation (e.g.
[`queue.enqueue()`](io_ops.md#QueueBase.enqueue) may be cancelled by [`queue.enqueue()`](../../api_docs/python/io_ops.md#QueueBase.enqueue) may be
running another operation (e.g. cancelled by running another operation (e.g.
[`queue.close(cancel_pending_enqueues=True)`](io_ops.md#QueueBase.close), [`queue.close(cancel_pending_enqueues=True)`](../../api_docs/python/io_ops.md#QueueBase.close),
or by [closing the session](client.md#Session.close). A step that is or by [closing the session](../../api_docs/python/client.md#Session.close).
running such a long-running operation will fail by raising `CancelledError`. A step that is running such a long-running operation will fail by raising
`CancelledError`.
- - - - - -
@ -465,10 +467,10 @@ Raised when an operation receives an invalid argument.
This may occur, for example, if an operation is receives an input This may occur, for example, if an operation is receives an input
tensor that has an invalid value or shape. For example, the tensor that has an invalid value or shape. For example, the
[`tf.matmul()`](math_ops.md#matmul) op will raise this error if it [`tf.matmul()`](../../api_docs/python/math_ops.md#matmul) op will raise this
receives an input that is not a matrix, and the error if it receives an input that is not a matrix, and the
[`tf.reshape()`](array_ops.md#reshape) op will raise this error if [`tf.reshape()`](../../api_docs/python/array_ops.md#reshape) op will raise
the new shape does not match the number of elements in the input this error if the new shape does not match the number of elements in the input
tensor. tensor.
- - - - - -
@ -502,8 +504,8 @@ Creates a `DeadlineExceededError`.
Raised when a requested entity (e.g., a file or directory) was not found. Raised when a requested entity (e.g., a file or directory) was not found.
For example, running the For example, running the
[`tf.WholeFileReader.read()`](io_ops.md#WholeFileReader) operation [`tf.WholeFileReader.read()`](../../api_docs/python/io_ops.md#WholeFileReader)
could raise `NotFoundError` if it receives the name of a file that operation could raise `NotFoundError` if it receives the name of a file that
does not exist. does not exist.
- - - - - -
@ -521,8 +523,8 @@ Creates a `NotFoundError`.
Raised when an entity that we attempted to create already exists. Raised when an entity that we attempted to create already exists.
For example, running an operation that saves a file For example, running an operation that saves a file
(e.g. [`tf.train.Saver.save()`](train.md#Saver.save)) could (e.g. [`tf.train.Saver.save()`](../../api_docs/python/train.md#Saver.save))
potentially raise this exception if an explicit filename for an could potentially raise this exception if an explicit filename for an
existing file was passed. existing file was passed.
- - - - - -
@ -540,8 +542,8 @@ Creates an `AlreadyExistsError`.
Raised when the caller does not have permission to run an operation. Raised when the caller does not have permission to run an operation.
For example, running the For example, running the
[`tf.WholeFileReader.read()`](io_ops.md#WholeFileReader) operation [`tf.WholeFileReader.read()`](../../api_docs/python/io_ops.md#WholeFileReader)
could raise `PermissionDeniedError` if it receives the name of a operation could raise `PermissionDeniedError` if it receives the name of a
file for which the user does not have the read file permission. file for which the user does not have the read file permission.
- - - - - -
@ -592,8 +594,8 @@ Creates a `ResourceExhaustedError`.
Operation was rejected because the system is not in a state to execute it. Operation was rejected because the system is not in a state to execute it.
This exception is most commonly raised when running an operation This exception is most commonly raised when running an operation
that reads a [`tf.Variable`](state_ops.md#Variable) before it has that reads a [`tf.Variable`](../../api_docs/python/state_ops.md#Variable)
been initialized. before it has been initialized.
- - - - - -
@ -609,9 +611,11 @@ Creates a `FailedPreconditionError`.
The operation was aborted, typically due to a concurrent action. The operation was aborted, typically due to a concurrent action.
For example, running a [`queue.enqueue()`](io_ops.md#QueueBase.enqueue) For example, running a
[`queue.enqueue()`](../../api_docs/python/io_ops.md#QueueBase.enqueue)
operation may raise `AbortedError` if a operation may raise `AbortedError` if a
[`queue.close()`](io_ops.md#QueueBase.close) operation previously ran. [`queue.close()`](../../api_docs/python/io_ops.md#QueueBase.close) operation
previously ran.
- - - - - -
@ -628,9 +632,10 @@ Creates an `AbortedError`.
Raised when an operation executed past the valid range. Raised when an operation executed past the valid range.
This exception is raised in "end-of-file" conditions, such as when a This exception is raised in "end-of-file" conditions, such as when a
[`queue.dequeue()`](io_ops.md#QueueBase.dequeue) operation is [`queue.dequeue()`](../../api_docs/python/io_ops.md#QueueBase.dequeue)
blocked on an empty queue, and a operation is blocked on an empty queue, and a
[`queue.close()`](io_ops.md#QueueBase.close) operation executes. [`queue.close()`](../../api_docs/python/io_ops.md#QueueBase.close)
operation executes.
- - - - - -
@ -648,9 +653,9 @@ Raised when an operation has not been implemented.
Some operations may raise this error when passed otherwise-valid Some operations may raise this error when passed otherwise-valid
arguments that it does not currently support. For example, running arguments that it does not currently support. For example, running
the [`tf.nn.max_pool()`](nn.md#max_pool) operation would raise this the [`tf.nn.max_pool()`](../../api_docs/python/nn.md#max_pool) operation
error if pooling was requested on the batch dimension, because this would raise this error if pooling was requested on the batch dimension,
is not yet supported. because this is not yet supported.
- - - - - -
@ -700,8 +705,8 @@ Creates an `UnavailableError`.
Raised when unrecoverable data loss or corruption is encountered. Raised when unrecoverable data loss or corruption is encountered.
For example, this may be raised by running a For example, this may be raised by running a
[`tf.WholeFileReader.read()`](io_ops.md#WholeFileReader) operation, [`tf.WholeFileReader.read()`](../../api_docs/python/io_ops.md#WholeFileReader)
if the file is truncated while it is being read. operation, if the file is truncated while it is being read.
- - - - - -

View File

@ -2,8 +2,8 @@
# Constants, Sequences, and Random Values <a class="md-anchor" id="AUTOGENERATED-constants--sequences--and-random-values"></a> # Constants, Sequences, and Random Values <a class="md-anchor" id="AUTOGENERATED-constants--sequences--and-random-values"></a>
Note: Functions taking `Tensor` arguments can also take anything Note: Functions taking `Tensor` arguments can also take anything accepted by
accepted by [`tf.convert_to_tensor`](framework.md#convert_to_tensor). [`tf.convert_to_tensor`](../../api_docs/python/framework.md#convert_to_tensor).
<!-- TOC-BEGIN This section is generated by neural network: DO NOT EDIT! --> <!-- TOC-BEGIN This section is generated by neural network: DO NOT EDIT! -->
## Contents ## Contents
@ -313,11 +313,13 @@ time they are evaluated.
The `seed` keyword argument in these functions acts in conjunction with The `seed` keyword argument in these functions acts in conjunction with
the graph-level random seed. Changing either the graph-level seed using the graph-level random seed. Changing either the graph-level seed using
[`set_random_seed`](constant_op.md#set_random_seed) or the op-level seed [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed) or the
will change the underlying seed of these operations. Setting neither graph-level op-level seed will change the underlying seed of these operations. Setting
nor op-level seed, results in a random seed for all operations. neither graph-level nor op-level seed, results in a random seed for all
See [`set_random_seed`](constant_op.md#set_random_seed) for details on the operations.
interaction between operation-level and graph-level random seeds. See [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for details on the interaction between operation-level and graph-level random
seeds.
### Examples: <a class="md-anchor" id="AUTOGENERATED-examples-"></a> ### Examples: <a class="md-anchor" id="AUTOGENERATED-examples-"></a>
@ -373,7 +375,9 @@ Outputs random values from a normal distribution.
of the normal distribution. of the normal distribution.
* <b>dtype</b>: The type of the output. * <b>dtype</b>: The type of the output.
* <b>seed</b>: A Python integer. Used to create a random seed for the distribution. * <b>seed</b>: A Python integer. Used to create a random seed for the distribution.
See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. See
[`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
* <b>name</b>: A name for the operation (optional). * <b>name</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a> ##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
@ -401,7 +405,9 @@ deviations from the mean are dropped and re-picked.
of the truncated normal distribution. of the truncated normal distribution.
* <b>dtype</b>: The type of the output. * <b>dtype</b>: The type of the output.
* <b>seed</b>: A Python integer. Used to create a random seed for the distribution. * <b>seed</b>: A Python integer. Used to create a random seed for the distribution.
See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. See
[`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
* <b>name</b>: A name for the operation (optional). * <b>name</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a> ##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
@ -429,7 +435,9 @@ the upper bound `maxval` is excluded.
the range of random values to generate. the range of random values to generate.
* <b>dtype</b>: The type of the output. * <b>dtype</b>: The type of the output.
* <b>seed</b>: A Python integer. Used to create a random seed for the distribution. * <b>seed</b>: A Python integer. Used to create a random seed for the distribution.
See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. See
[`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
* <b>name</b>: A name for the operation (optional). * <b>name</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a> ##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
@ -458,7 +466,9 @@ to one and only one `output[i]`. For example, a mapping that might occur for a
* <b>value</b>: A Tensor to be shuffled. * <b>value</b>: A Tensor to be shuffled.
* <b>seed</b>: A Python integer. Used to create a random seed for the distribution. * <b>seed</b>: A Python integer. Used to create a random seed for the distribution.
See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. See
[`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
* <b>name</b>: A name for the operation (optional). * <b>name</b>: A name for the operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a> ##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>

View File

@ -2,8 +2,8 @@
# Control Flow <a class="md-anchor" id="AUTOGENERATED-control-flow"></a> # Control Flow <a class="md-anchor" id="AUTOGENERATED-control-flow"></a>
Note: Functions taking `Tensor` arguments can also take anything Note: Functions taking `Tensor` arguments can also take anything accepted by
accepted by [`tf.convert_to_tensor`](framework.md#convert_to_tensor). [`tf.convert_to_tensor`](../../api_docs/python/framework.md#convert_to_tensor).
<!-- TOC-BEGIN This section is generated by neural network: DO NOT EDIT! --> <!-- TOC-BEGIN This section is generated by neural network: DO NOT EDIT! -->
## Contents ## Contents

View File

@ -44,14 +44,16 @@ Classes and functions for building TensorFlow graphs.
A TensorFlow computation, represented as a dataflow graph. A TensorFlow computation, represented as a dataflow graph.
A `Graph` contains a set of [`Operation`](framework.md#Operation) objects, A `Graph` contains a set of
which represent units of computation; and [`Tensor`](framework.md#Tensor) [`Operation`](../../api_docs/python/framework.md#Operation) objects,
objects, which represent the units of data that flow between operations. which represent units of computation; and
[`Tensor`](../../api_docs/python/framework.md#Tensor) objects, which represent
the units of data that flow between operations.
A default `Graph` is always registered, and accessible by calling A default `Graph` is always registered, and accessible by calling
[`tf.get_default_graph()`](framework.md#get_default_graph). To add an [`tf.get_default_graph()`](../../api_docs/python/framework.md#get_default_graph).
operation to the default graph, simply call one of the functions that defines To add an operation to the default graph, simply call one of the functions
a new `Operation`: that defines a new `Operation`:
``` ```
c = tf.constant(4.0) c = tf.constant(4.0)
@ -59,7 +61,7 @@ assert c.graph is tf.get_default_graph()
``` ```
Another typical usage involves the Another typical usage involves the
[`Graph.as_default()`](framework.md#Graph.as_default) [`Graph.as_default()`](../../api_docs/python/framework.md#Graph.as_default)
context manager, which overrides the current default graph for the context manager, which overrides the current default graph for the
lifetime of the context: lifetime of the context:
@ -129,7 +131,7 @@ Returns a serialized `GraphDef` representation of this graph.
The serialized `GraphDef` can be imported into another `Graph` The serialized `GraphDef` can be imported into another `Graph`
(using [`import_graph_def()`](#import_graph_def)) or used with the (using [`import_graph_def()`](#import_graph_def)) or used with the
[C++ Session API](../cc/index.md). [C++ Session API](../../api_docs/cc/index.md).
This method is thread-safe. This method is thread-safe.
@ -155,7 +157,7 @@ Finalizes this graph, making it read-only.
After calling `g.finalize()`, no new operations can be added to After calling `g.finalize()`, no new operations can be added to
`g`. This method is used to ensure that no operations are added `g`. This method is used to ensure that no operations are added
to a graph when it is shared between multiple threads, for example to a graph when it is shared between multiple threads, for example
when using a [`QueueRunner`](train.md#QueueRunner). when using a [`QueueRunner`](../../api_docs/python/train.md#QueueRunner).
- - - - - -
@ -373,9 +375,9 @@ A `Graph` instance supports an arbitrary number of "collections"
that are identified by name. For convenience when building a large that are identified by name. For convenience when building a large
graph, collections can store groups of related objects: for graph, collections can store groups of related objects: for
example, the `tf.Variable` uses a collection (named example, the `tf.Variable` uses a collection (named
[`tf.GraphKeys.VARIABLES`](framework.md#GraphKeys)) for all variables that are [`tf.GraphKeys.VARIABLES`](../../api_docs/python/framework.md#GraphKeys)) for
created during the construction of a graph. The caller may define all variables that are created during the construction of a graph. The caller
additional collections by specifying a new name. may define additional collections by specifying a new name.
- - - - - -
@ -662,15 +664,17 @@ Represents a graph node that performs computation on tensors.
An `Operation` is a node in a TensorFlow `Graph` that takes zero or An `Operation` is a node in a TensorFlow `Graph` that takes zero or
more `Tensor` objects as input, and produces zero or more `Tensor` more `Tensor` objects as input, and produces zero or more `Tensor`
objects as output. Objects of type `Operation` are created by objects as output. Objects of type `Operation` are created by
calling a Python op constructor (such as [`tf.matmul()`](math_ops.md#matmul)) calling a Python op constructor (such as
or [`Graph.create_op()`](framework.md#Graph.create_op). [`tf.matmul()`](../../api_docs/python/math_ops.md#matmul))
or [`Graph.create_op()`](../../api_docs/python/framework.md#Graph.create_op).
For example `c = tf.matmul(a, b)` creates an `Operation` of type For example `c = tf.matmul(a, b)` creates an `Operation` of type
"MatMul" that takes tensors `a` and `b` as input, and produces `c` "MatMul" that takes tensors `a` and `b` as input, and produces `c`
as output. as output.
After the graph has been launched in a session, an `Operation` can After the graph has been launched in a session, an `Operation` can
be executed by passing it to [`Session.run()`](client.md#Session.run). be executed by passing it to
[`Session.run()`](../../api_docs/python/client.md#Session.run).
`op.run()` is a shortcut for calling `tf.get_default_session().run(op)`. `op.run()` is a shortcut for calling `tf.get_default_session().run(op)`.
- - - - - -
@ -748,8 +752,8 @@ available, or `session` must be specified explicitly.
* <b>feed_dict</b>: A dictionary that maps `Tensor` objects to feed values. * <b>feed_dict</b>: A dictionary that maps `Tensor` objects to feed values.
See [`Session.run()`](client.md#Session.run) for a description of the See [`Session.run()`](../../api_docs/python/client.md#Session.run)
valid feed values. for a description of the valid feed values.
* <b>session</b>: (Optional.) The `Session` to be used to run to this operation. If * <b>session</b>: (Optional.) The `Session` to be used to run to this operation. If
none, the default session will be used. none, the default session will be used.
@ -872,7 +876,7 @@ Represents a value produced by an `Operation`.
A `Tensor` is a symbolic handle to one of the outputs of an A `Tensor` is a symbolic handle to one of the outputs of an
`Operation`. It does not hold the values of that operation's output, `Operation`. It does not hold the values of that operation's output,
but instead provides a means of computing those values in a but instead provides a means of computing those values in a
TensorFlow [`Session`](client.md#Session). TensorFlow [`Session`](../../api_docs/python/client.md#Session).
This class has two primary purposes: This class has two primary purposes:
@ -883,7 +887,7 @@ This class has two primary purposes:
2. After the graph has been launched in a session, the value of the 2. After the graph has been launched in a session, the value of the
`Tensor` can be computed by passing it to `Tensor` can be computed by passing it to
[`Session.run()`](client.md#Session.run). [`Session.run()`](../../api_docs/python/client.md#Session.run).
`t.eval()` is a shortcut for calling `t.eval()` is a shortcut for calling
`tf.get_default_session().run(t)`. `tf.get_default_session().run(t)`.
@ -964,8 +968,8 @@ available, or `session` must be specified explicitly.
* <b>feed_dict</b>: A dictionary that maps `Tensor` objects to feed values. * <b>feed_dict</b>: A dictionary that maps `Tensor` objects to feed values.
See [`Session.run()`](client.md#Session.run) for a description of See [`Session.run()`](../../api_docs/python/client.md#Session.run) for a
the valid feed values. description of the valid feed values.
* <b>session</b>: (Optional.) The `Session` to be used to evaluate this tensor. If * <b>session</b>: (Optional.) The `Session` to be used to evaluate this tensor. If
none, the default session will be used. none, the default session will be used.
@ -983,8 +987,8 @@ Returns the `TensorShape` that represents the shape of this tensor.
The shape is computed using shape inference functions that are The shape is computed using shape inference functions that are
registered for each `Operation` type using `tf.RegisterShape`. registered for each `Operation` type using `tf.RegisterShape`.
See [`TensorShape`](framework.md#TensorShape) for more details of what a shape See [`TensorShape`](../../api_docs/python/framework.md#TensorShape) for more
represents. details of what a shape represents.
The inferred shape of a tensor is used to provide shape The inferred shape of a tensor is used to provide shape
information without having to launch the graph in a session. This information without having to launch the graph in a session. This
@ -1279,7 +1283,9 @@ Converts the given `type_value` to a `DType`.
Wrapper for `Graph.device()` using the default graph. Wrapper for `Graph.device()` using the default graph.
See [`Graph.name_scope()`](framework.md#Graph.name_scope) for more details. See
[`Graph.name_scope()`](../../api_docs/python/framework.md#Graph.name_scope)
for more details.
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a> ##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
@ -1299,7 +1305,9 @@ See [`Graph.name_scope()`](framework.md#Graph.name_scope) for more details.
Wrapper for `Graph.name_scope()` using the default graph. Wrapper for `Graph.name_scope()` using the default graph.
See [`Graph.name_scope()`](framework.md#Graph.name_scope) for more details. See
[`Graph.name_scope()`](../../api_docs/python/framework.md#Graph.name_scope)
for more details.
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a> ##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
@ -1318,7 +1326,7 @@ See [`Graph.name_scope()`](framework.md#Graph.name_scope) for more details.
Wrapper for `Graph.control_dependencies()` using the default graph. Wrapper for `Graph.control_dependencies()` using the default graph.
See [`Graph.control_dependencies()`](framework.md#Graph.control_dependencies) See [`Graph.control_dependencies()`](../../api_docs/python/framework.md#Graph.control_dependencies)
for more details. for more details.
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a> ##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
@ -1458,7 +1466,7 @@ protocol buffer, and extract individual objects in the `GraphDef` as
Wrapper for `Graph.add_to_collection()` using the default graph. Wrapper for `Graph.add_to_collection()` using the default graph.
See [`Graph.add_to_collection()`](framework.md#Graph.add_to_collection) See [`Graph.add_to_collection()`](../../api_docs/python/framework.md#Graph.add_to_collection)
for more details. for more details.
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a> ##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
@ -1475,7 +1483,7 @@ for more details.
Wrapper for `Graph.get_collection()` using the default graph. Wrapper for `Graph.get_collection()` using the default graph.
See [`Graph.get_collection()`](framework.md#Graph.get_collection) See [`Graph.get_collection()`](../../api_docs/python/framework.md#Graph.get_collection)
for more details. for more details.
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a> ##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
@ -1511,17 +1519,20 @@ The following standard keys are defined:
* `VARIABLES`: the `Variable` objects that comprise a model, and * `VARIABLES`: the `Variable` objects that comprise a model, and
must be saved and restored together. See must be saved and restored together. See
[`tf.all_variables()`](state_ops.md#all_variables) for more details. [`tf.all_variables()`](../../api_docs/python/state_ops.md#all_variables)
for more details.
* `TRAINABLE_VARIABLES`: the subset of `Variable` objects that will * `TRAINABLE_VARIABLES`: the subset of `Variable` objects that will
be trained by an optimizer. See be trained by an optimizer. See
[`tf.trainable_variables()`](state_ops.md#trainable_variables) [`tf.trainable_variables()`](../../api_docs/python/state_ops.md#trainable_variables)
for more details. for more details.
* `SUMMARIES`: the summary `Tensor` objects that have been created * `SUMMARIES`: the summary `Tensor` objects that have been created in the
in the graph. See [`tf.merge_all_summaries()`](train.md#merge_all_summaries) graph. See
[`tf.merge_all_summaries()`](../../api_docs/python/train.md#merge_all_summaries)
for more details. for more details.
* `QUEUE_RUNNERS`: the `QueueRunner` objects that are used to * `QUEUE_RUNNERS`: the `QueueRunner` objects that are used to
produce input for a computation. See produce input for a computation. See
[`tf.start_queue_runners()`](train.md#start_queue_runners) for more details. [`tf.start_queue_runners()`](../../api_docs/python/train.md#start_queue_runners)
for more details.
## Defining new operations <a class="md-anchor" id="AUTOGENERATED-defining-new-operations"></a> ## Defining new operations <a class="md-anchor" id="AUTOGENERATED-defining-new-operations"></a>
@ -1643,10 +1654,10 @@ A `TensorShape` represents a possibly-partial shape specification for a
If a tensor is produced by an operation of type `"Foo"`, its shape If a tensor is produced by an operation of type `"Foo"`, its shape
may be inferred if there is a registered shape function for may be inferred if there is a registered shape function for
`"Foo"`. See [`tf.RegisterShape()`](framework.md#RegisterShape) `"Foo"`. See [`tf.RegisterShape()`](../../api_docs/python/framework.md#RegisterShape)
for details of shape for details of shape
functions and how to register them. Alternatively, the shape may be set functions and how to register them. Alternatively, the shape may be set
explicitly using [`Tensor.set_shape()`](framework.md#Tensor.set_shape). explicitly using [`Tensor.set_shape()`](../../api_docs/python/framework.md#Tensor.set_shape).
- - - - - -
@ -2068,7 +2079,7 @@ internally use the two seeds to allow user to change the seed globally for a
graph, or for only specific operations. graph, or for only specific operations.
For details on how the graph-level seed interacts with op seeds, see For details on how the graph-level seed interacts with op seeds, see
[`set_random_seed`](constant_op.md#set_random_seed). [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed).
##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a> ##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>

View File

@ -2,8 +2,8 @@
# Images <a class="md-anchor" id="AUTOGENERATED-images"></a> # Images <a class="md-anchor" id="AUTOGENERATED-images"></a>
Note: Functions taking `Tensor` arguments can also take anything Note: Functions taking `Tensor` arguments can also take anything accepted by
accepted by [`tf.convert_to_tensor`](framework.md#convert_to_tensor). [`tf.convert_to_tensor`](../../api_docs/python/framework.md#convert_to_tensor).
<!-- TOC-BEGIN This section is generated by neural network: DO NOT EDIT! --> <!-- TOC-BEGIN This section is generated by neural network: DO NOT EDIT! -->
## Contents ## Contents
@ -497,8 +497,9 @@ fully contains the result.
* <b>image</b>: 3-D tensor of shape `[height, width, channels]` * <b>image</b>: 3-D tensor of shape `[height, width, channels]`
* <b>size</b>: 1-D tensor with two elements, specifying target `[height, width]` * <b>size</b>: 1-D tensor with two elements, specifying target `[height, width]`
* <b>seed</b>: A Python integer. Used to create a random seed. * <b>seed</b>: A Python integer. Used to create a random seed. See
See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
* <b>name</b>: A name for this operation (optional). * <b>name</b>: A name for this operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a> ##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
@ -601,8 +602,9 @@ dimension, which is `height`. Otherwise output the image as-is.
* <b>image</b>: A 3-D tensor of shape `[height, width, channels].` * <b>image</b>: A 3-D tensor of shape `[height, width, channels].`
* <b>seed</b>: A Python integer. Used to create a random seed. * <b>seed</b>: A Python integer. Used to create a random seed. See
See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a> ##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
@ -654,8 +656,9 @@ second dimension, which is `width`. Otherwise output the image as-is.
* <b>image</b>: A 3-D tensor of shape `[height, width, channels].` * <b>image</b>: A 3-D tensor of shape `[height, width, channels].`
* <b>seed</b>: A Python integer. Used to create a random seed. * <b>seed</b>: A Python integer. Used to create a random seed. See
See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a> ##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
@ -744,8 +747,9 @@ have modifications in the range `[-max_delta,max_delta]`.
* <b>image</b>: 3-D tensor of shape `[height, width, channels]`. * <b>image</b>: 3-D tensor of shape `[height, width, channels]`.
* <b>max_delta</b>: float, must be non-negative. * <b>max_delta</b>: float, must be non-negative.
* <b>seed</b>: A Python integer. Used to create a random seed. * <b>seed</b>: A Python integer. Used to create a random seed. See
See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a> ##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
@ -814,8 +818,9 @@ picked in the interval `[lower, upper]`.
* <b>image</b>: 3-D tensor of shape `[height, width, channels]`. * <b>image</b>: 3-D tensor of shape `[height, width, channels]`.
* <b>lower</b>: float. Lower bound for the random contrast factor. * <b>lower</b>: float. Lower bound for the random contrast factor.
* <b>upper</b>: float. Upper bound for the random contrast factor. * <b>upper</b>: float. Upper bound for the random contrast factor.
* <b>seed</b>: A Python integer. Used to create a random seed. * <b>seed</b>: A Python integer. Used to create a random seed. See
See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a> ##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>

View File

@ -2,8 +2,8 @@
# Inputs and Readers <a class="md-anchor" id="AUTOGENERATED-inputs-and-readers"></a> # Inputs and Readers <a class="md-anchor" id="AUTOGENERATED-inputs-and-readers"></a>
Note: Functions taking `Tensor` arguments can also take anything Note: Functions taking `Tensor` arguments can also take anything accepted by
accepted by [`tf.convert_to_tensor`](framework.md#convert_to_tensor). [`tf.convert_to_tensor`](../../api_docs/python/framework.md#convert_to_tensor).
<!-- TOC-BEGIN This section is generated by neural network: DO NOT EDIT! --> <!-- TOC-BEGIN This section is generated by neural network: DO NOT EDIT! -->
## Contents ## Contents
@ -1591,8 +1591,9 @@ queue has been closed.
the number of tensors in each queue element. the number of tensors in each queue element.
* <b>shapes</b>: (Optional.) A list of fully-defined `TensorShape` objects, * <b>shapes</b>: (Optional.) A list of fully-defined `TensorShape` objects,
with the same length as `dtypes` or `None`. with the same length as `dtypes` or `None`.
* <b>seed</b>: A Python integer. Used to create a random seed. * <b>seed</b>: A Python integer. Used to create a random seed. See
See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
* <b>shared_name</b>: (Optional.) If non-empty, this queue will be shared under * <b>shared_name</b>: (Optional.) If non-empty, this queue will be shared under
the given name across multiple sessions. the given name across multiple sessions.
* <b>name</b>: Optional name for the queue operation. * <b>name</b>: Optional name for the queue operation.

View File

@ -2,8 +2,8 @@
# Math <a class="md-anchor" id="AUTOGENERATED-math"></a> # Math <a class="md-anchor" id="AUTOGENERATED-math"></a>
Note: Functions taking `Tensor` arguments can also take anything Note: Functions taking `Tensor` arguments can also take anything accepted by
accepted by [`tf.convert_to_tensor`](framework.md#convert_to_tensor). [`tf.convert_to_tensor`](../../api_docs/python/framework.md#convert_to_tensor).
<!-- TOC-BEGIN This section is generated by neural network: DO NOT EDIT! --> <!-- TOC-BEGIN This section is generated by neural network: DO NOT EDIT! -->
## Contents ## Contents
@ -1322,7 +1322,7 @@ tf.segment_sum(c, tf.constant([0, 0, 1]))
Computes the sum along segments of a tensor. Computes the sum along segments of a tensor.
Read [the section on Segmentation](../python/math_ops.md#segmentation) Read [the section on Segmentation](../../api_docs/python/math_ops.md#segmentation)
for an explanation of segments. for an explanation of segments.
Computes a tensor such that Computes a tensor such that
@ -1355,8 +1355,9 @@ that `segment_ids[j] == i`.
Computes the product along segments of a tensor. Computes the product along segments of a tensor.
Read [the section on Segmentation](../python/math_ops.md#segmentation) Read [the section on
for an explanation of segments. Segmentation](../../api_docs/python/math_ops.md#segmentation) for an explanation
of segments.
Computes a tensor such that Computes a tensor such that
\\(output_i = \prod_j data_j\\) where the product is over `j` such \\(output_i = \prod_j data_j\\) where the product is over `j` such
@ -1388,8 +1389,9 @@ that `segment_ids[j] == i`.
Computes the minimum along segments of a tensor. Computes the minimum along segments of a tensor.
Read [the section on Segmentation](../python/math_ops.md#segmentation) Read [the section on
for an explanation of segments. Segmentation](../../api_docs/python/math_ops.md#segmentation) for an explanation
of segments.
Computes a tensor such that Computes a tensor such that
\\(output_i = \min_j(data_j)\\) where `min` is over `j` such \\(output_i = \min_j(data_j)\\) where `min` is over `j` such
@ -1421,7 +1423,7 @@ that `segment_ids[j] == i`.
Computes the maximum along segments of a tensor. Computes the maximum along segments of a tensor.
Read [the section on Segmentation](../python/math_ops.md#segmentation) Read [the section on Segmentation](../../api_docs/python/math_ops.md#segmentation)
for an explanation of segments. for an explanation of segments.
Computes a tensor such that Computes a tensor such that
@ -1454,8 +1456,9 @@ that `segment_ids[j] == i`.
Computes the mean along segments of a tensor. Computes the mean along segments of a tensor.
Read [the section on Segmentation](../python/math_ops.md#segmentation) Read [the section on
for an explanation of segments. Segmentation](../../api_docs/python/math_ops.md#segmentation) for an explanation
of segments.
Computes a tensor such that Computes a tensor such that
\\(output_i = \frac{\sum_j data_j}{N}\\) where `mean` is \\(output_i = \frac{\sum_j data_j}{N}\\) where `mean` is
@ -1489,8 +1492,9 @@ values summed.
Computes the sum along segments of a tensor. Computes the sum along segments of a tensor.
Read [the section on Segmentation](../python/math_ops.md#segmentation) Read [the section on
for an explanation of segments. Segmentation](../../api_docs/python/math_ops.md#segmentation) for an explanation
of segments.
Computes a tensor such that Computes a tensor such that
\\(output_i = \sum_j data_j\\) where sum is over `j` such \\(output_i = \sum_j data_j\\) where sum is over `j` such
@ -1530,8 +1534,9 @@ If the sum is empty for a given segment ID `i`, `output[i] = 0`.
Computes the sum along sparse segments of a tensor. Computes the sum along sparse segments of a tensor.
Read [the section on Segmentation](../python/math_ops.md#segmentation) Read [the section on
for an explanation of segments. Segmentation](../../api_docs/python/math_ops.md#segmentation) for an explanation
of segments.
Like `SegmentSum`, but `segment_ids` can have rank less than `data`'s first Like `SegmentSum`, but `segment_ids` can have rank less than `data`'s first
dimension, selecting a subset of dimension_0, specified by `indices`. dimension, selecting a subset of dimension_0, specified by `indices`.
@ -1582,8 +1587,9 @@ tf.segment_sum(c, tf.constant([0, 0, 1]))
Computes the mean along sparse segments of a tensor. Computes the mean along sparse segments of a tensor.
Read [the section on Segmentation](../python/math_ops.md#segmentation) Read [the section on
for an explanation of segments. Segmentation](../../api_docs/python/math_ops.md#segmentation) for an explanation
of segments.
Like `SegmentMean`, but `segment_ids` can have rank less than `data`'s first Like `SegmentMean`, but `segment_ids` can have rank less than `data`'s first
dimension, selecting a subset of dimension_0, specified by `indices`. dimension, selecting a subset of dimension_0, specified by `indices`.

View File

@ -2,8 +2,8 @@
# Neural Network <a class="md-anchor" id="AUTOGENERATED-neural-network"></a> # Neural Network <a class="md-anchor" id="AUTOGENERATED-neural-network"></a>
Note: Functions taking `Tensor` arguments can also take anything Note: Functions taking `Tensor` arguments can also take anything accepted by
accepted by [`tf.convert_to_tensor`](framework.md#convert_to_tensor). [`tf.convert_to_tensor`](../../api_docs/python/framework.md#convert_to_tensor).
<!-- TOC-BEGIN This section is generated by neural network: DO NOT EDIT! --> <!-- TOC-BEGIN This section is generated by neural network: DO NOT EDIT! -->
## Contents ## Contents
@ -142,8 +142,9 @@ kept independently and each row and column will be kept or not kept together.
* <b>keep_prob</b>: A Python float. The probability that each element is kept. * <b>keep_prob</b>: A Python float. The probability that each element is kept.
* <b>noise_shape</b>: A 1-D `Tensor` of type `int32`, representing the * <b>noise_shape</b>: A 1-D `Tensor` of type `int32`, representing the
shape for randomly generated keep/drop flags. shape for randomly generated keep/drop flags.
* <b>seed</b>: A Python integer. Used to create a random seed. * <b>seed</b>: A Python integer. Used to create random seeds. See
See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
* <b>name</b>: A name for this operation (optional). * <b>name</b>: A name for this operation (optional).
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a> ##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
@ -734,8 +735,8 @@ Looks up `ids` in a list of embedding tensors.
This function is used to perform parallel lookups on the list of This function is used to perform parallel lookups on the list of
tensors in `params`. It is a generalization of tensors in `params`. It is a generalization of
[`tf.gather()`](array_ops.md#gather), where `params` is interpreted [`tf.gather()`](../../api_docs/python/array_ops.md#gather), where `params` is
as a partition of a larger embedding tensor. interpreted as a partition of a larger embedding tensor.
If `len(params) > 1`, each element `id` of `ids` is partitioned between If `len(params) > 1`, each element `id` of `ids` is partitioned between
the elements of `params` by computing `p = id % len(params)`, and is the elements of `params` by computing `p = id % len(params)`, and is

View File

@ -2,8 +2,8 @@
# Sparse Tensors <a class="md-anchor" id="AUTOGENERATED-sparse-tensors"></a> # Sparse Tensors <a class="md-anchor" id="AUTOGENERATED-sparse-tensors"></a>
Note: Functions taking `Tensor` arguments can also take anything Note: Functions taking `Tensor` arguments can also take anything accepted by
accepted by [`tf.convert_to_tensor`](framework.md#convert_to_tensor). [`tf.convert_to_tensor`](../../api_docs/python/framework.md#convert_to_tensor).
<!-- TOC-BEGIN This section is generated by neural network: DO NOT EDIT! --> <!-- TOC-BEGIN This section is generated by neural network: DO NOT EDIT! -->
## Contents ## Contents

View File

@ -2,8 +2,8 @@
# Variables <a class="md-anchor" id="AUTOGENERATED-variables"></a> # Variables <a class="md-anchor" id="AUTOGENERATED-variables"></a>
Note: Functions taking `Tensor` arguments can also take anything Note: Functions taking `Tensor` arguments can also take anything accepted by
accepted by [`tf.convert_to_tensor`](framework.md#convert_to_tensor). [`tf.convert_to_tensor`](../../api_docs/python/framework.md#convert_to_tensor).
<!-- TOC-BEGIN This section is generated by neural network: DO NOT EDIT! --> <!-- TOC-BEGIN This section is generated by neural network: DO NOT EDIT! -->
## Contents ## Contents
@ -330,7 +330,7 @@ This is not a graph construction method, it does not add ops to the graph.
This convenience method requires a session where the graph containing this This convenience method requires a session where the graph containing this
variable has been launched. If no session is passed, the default session is variable has been launched. If no session is passed, the default session is
used. See the [Session class](client.md#Session) for more information on used. See the [Session class](../../api_docs/python/client.md#Session) for more information on
launching a graph and on sessions. launching a graph and on sessions.
```python ```python
@ -1008,8 +1008,9 @@ Returns an initializer that generates Tensors with a normal distribution.
to generate. to generate.
* <b>stddev</b>: a python scalar or a scalar tensor. Standard deviation of the * <b>stddev</b>: a python scalar or a scalar tensor. Standard deviation of the
random values to generate. random values to generate.
* <b>seed</b>: A Python integer. Used to create random seeds. * <b>seed</b>: A Python integer. Used to create random seeds. See
See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a> ##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
@ -1034,8 +1035,9 @@ neural network weights and filters.
to generate. to generate.
* <b>stddev</b>: a python scalar or a scalar tensor. Standard deviation of the * <b>stddev</b>: a python scalar or a scalar tensor. Standard deviation of the
random values to generate. random values to generate.
* <b>seed</b>: A Python integer. Used to create random seeds. * <b>seed</b>: A Python integer. Used to create random seeds. See
See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a> ##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
@ -1056,8 +1058,9 @@ Returns an initializer that generates Tensors with a uniform distribution.
of random values to generate. of random values to generate.
* <b>maxval</b>: a python scalar or a scalar tensor. upper bound of the range * <b>maxval</b>: a python scalar or a scalar tensor. upper bound of the range
of random values to generate. of random values to generate.
* <b>seed</b>: A Python integer. Used to create random seeds. * <b>seed</b>: A Python integer. Used to create random seeds. See
See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a> ##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
@ -1089,8 +1092,9 @@ numerically computed: for a linear layer it's 1.0, relu: ~1.43, tanh: ~1.15.
* <b>factor</b>: Float. A multiplicative factor by which the values will be scaled. * <b>factor</b>: Float. A multiplicative factor by which the values will be scaled.
* <b>seed</b>: A Python integer. Used to create random seeds. * <b>seed</b>: A Python integer. Used to create random seeds. See
See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a> ##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
@ -1113,7 +1117,8 @@ useful for training embedding models and similar lookup-based networks, since
only a small subset of embedding vectors change in any given step. only a small subset of embedding vectors change in any given step.
Since a sparse update of a large tensor may be generated automatically during Since a sparse update of a large tensor may be generated automatically during
gradient computation (as in the gradient of [`tf.gather`](array_ops.md#gather)), gradient computation (as in the gradient of
[`tf.gather`](../../api_docs/python/array_ops.md#gather)),
an [`IndexedSlices`](#IndexedSlices) class is provided that encapsulates a set an [`IndexedSlices`](#IndexedSlices) class is provided that encapsulates a set
of sparse indices and values. `IndexedSlices` objects are detected and handled of sparse indices and values. `IndexedSlices` objects are detected and handled
automatically by the optimizers in most cases. automatically by the optimizers in most cases.
@ -1328,10 +1333,10 @@ dense[slices.indices[i], :, :, :, ...] = slices.values[i, :, :, :, ...]
The `IndexedSlices` class is used principally in the definition of The `IndexedSlices` class is used principally in the definition of
gradients for operations that have sparse gradients gradients for operations that have sparse gradients
(e.g. [`tf.gather`](array_ops.md#gather)). (e.g. [`tf.gather`](../../api_docs/python/array_ops.md#gather)).
Contrast this representation with Contrast this representation with
[`SparseTensor`](sparse_ops.md#SparseTensor), [`SparseTensor`](../../api_docs/python/sparse_ops.md#SparseTensor),
which uses multi-dimensional indices and scalar values. which uses multi-dimensional indices and scalar values.
- - - - - -

View File

@ -950,8 +950,8 @@ There are two ways to use the moving averages for evaluations:
for a given variable. for a given variable.
* Build a model normally but load the checkpoint files to evaluate by using * Build a model normally but load the checkpoint files to evaluate by using
the shadow variable names. For this use the `average_name()` method. See the shadow variable names. For this use the `average_name()` method. See
the [Saver class](train.md#Saver) for more information on restoring saved the [Saver class](../../api_docs/python/train.md#Saver) for more
variables. information on restoring saved variables.
Example of restoring the shadow variable values: Example of restoring the shadow variable values:
@ -1407,8 +1407,8 @@ The following ops output
protocol buffers as serialized string tensors. protocol buffers as serialized string tensors.
You can fetch the output of a summary op in a session, and pass it to You can fetch the output of a summary op in a session, and pass it to
a [SummaryWriter](train.md#SummaryWriter) to append it to an event a [SummaryWriter](../../api_docs/python/train.md#SummaryWriter) to append it
file. Event files contain to an event file. Event files contain
[`Event`](https://tensorflow.googlesource.com/tensorflow/+/master/tensorflow/core/util/event.proto) [`Event`](https://tensorflow.googlesource.com/tensorflow/+/master/tensorflow/core/util/event.proto)
protos that can contain `Summary` protos along with the timestamp and protos that can contain `Summary` protos along with the timestamp and
step. You can then use TensorBoard to visualize the contents of the step. You can then use TensorBoard to visualize the contents of the

View File

@ -8,10 +8,7 @@ your TensorFlow graph, plot quantitative metrics about the execution of your
graph, and show additional data like images that pass through it. When graph, and show additional data like images that pass through it. When
TensorBoard is fully configured, it looks like this: TensorBoard is fully configured, it looks like this:
![MNIST TensorBoard](./mnist_tensorboard.png "MNIST TensorBoard") If you're on ![MNIST TensorBoard](./mnist_tensorboard.png "MNIST TensorBoard")
desktop Chrome or Firefox, try playing around with [this live
TensorBoard](/tensorboard/cifar.html).
## Serializing the data <a class="md-anchor" id="AUTOGENERATED-serializing-the-data"></a> ## Serializing the data <a class="md-anchor" id="AUTOGENERATED-serializing-the-data"></a>

View File

@ -199,7 +199,6 @@ loss and all these weight decay terms, as returned by the `loss()` function.
We visualize it in TensorBoard with a [scalar_summary](../../api_docs/python/train.md#scalar_summary): We visualize it in TensorBoard with a [scalar_summary](../../api_docs/python/train.md#scalar_summary):
![CIFAR-10 Loss](./cifar_loss.png "CIFAR-10 Total Loss") ![CIFAR-10 Loss](./cifar_loss.png "CIFAR-10 Total Loss")
###### [View this TensorBoard live! (Chrome/FF)](/tensorboard/cifar.html) <a class="md-anchor" id="AUTOGENERATED--view-this-tensorboard-live---chrome-ff----tensorboard-cifar.html-"></a>
We train the model using standard We train the model using standard
[gradient descent](https://en.wikipedia.org/wiki/Gradient_descent) [gradient descent](https://en.wikipedia.org/wiki/Gradient_descent)
@ -209,7 +208,6 @@ with a learning rate that
over time. over time.
![CIFAR-10 Learning Rate Decay](./cifar_lr_decay.png "CIFAR-10 Learning Rate Decay") ![CIFAR-10 Learning Rate Decay](./cifar_lr_decay.png "CIFAR-10 Learning Rate Decay")
###### [View this TensorBoard live! (Chrome/FF)](/tensorboard/cifar.html) <a class="md-anchor" id="AUTOGENERATED--view-this-tensorboard-live---chrome-ff----tensorboard-cifar.html-"></a>
The `train()` function adds the operations needed to minimize the objective by The `train()` function adds the operations needed to minimize the objective by
calculating the gradient and updating the learned variables (see calculating the gradient and updating the learned variables (see
@ -459,6 +457,3 @@ components to build address your image classification problem.
[Street View House Numbers (SVHN)](http://ufldl.stanford.edu/housenumbers/) data set. [Street View House Numbers (SVHN)](http://ufldl.stanford.edu/housenumbers/) data set.
Fork the CIFAR-10 tutorial and swap in the SVHN as the input data. Try adapting Fork the CIFAR-10 tutorial and swap in the SVHN as the input data. Try adapting
the network architecture to improve predictive performance. the network architecture to improve predictive performance.

View File

@ -132,9 +132,9 @@ class BaseSession(SessionInterface):
"""Returns a context manager that makes this object the default session. """Returns a context manager that makes this object the default session.
Use with the `with` keyword to specify that calls to Use with the `with` keyword to specify that calls to
[`Operation.run()`](framework.md#Operation.run) or [`Operation.run()`](../../api_docs/python/framework.md#Operation.run) or
[`Tensor.run()`](framework.md#Tensor.run) should be executed in [`Tensor.run()`](../../api_docs/python/framework.md#Tensor.run) should be
this session. executed in this session.
```python ```python
c = tf.constant(..) c = tf.constant(..)
@ -219,30 +219,31 @@ class BaseSession(SessionInterface):
method. A graph element can be one of the following types: method. A graph element can be one of the following types:
* If the *i*th element of `fetches` is an * If the *i*th element of `fetches` is an
[`Operation`](framework.md#Operation), the *i*th return value [`Operation`](../../api_docs/python/framework.md#Operation), the *i*th
will be `None`. return value will be `None`.
* If the *i*th element of `fetches` is a * If the *i*th element of `fetches` is a
[`Tensor`](framework.md#Tensor), the *i*th return value will [`Tensor`](../../api_docs/python/framework.md#Tensor), the *i*th return
be a numpy ndarray containing the value of that tensor. value will be a numpy ndarray containing the value of that tensor.
* If the *i*th element of `fetches` is a * If the *i*th element of `fetches` is a
[`SparseTensor`](sparse_ops.md#SparseTensor), the *i*th [`SparseTensor`](../../api_docs/python/sparse_ops.md#SparseTensor),
return value will be a the *i*th return value will be a
[`SparseTensorValue`](sparse_ops.md#SparseTensorValue) [`SparseTensorValue`](../../api_docs/python/sparse_ops.md#SparseTensorValue)
containing the value of that sparse tensor. containing the value of that sparse tensor.
The optional `feed_dict` argument allows the caller to override The optional `feed_dict` argument allows the caller to override
the value of tensors in the graph. Each key in `feed_dict` can be the value of tensors in the graph. Each key in `feed_dict` can be
one of the following types: one of the following types:
* If the key is a [`Tensor`](framework.md#Tensor), the * If the key is a [`Tensor`](../../api_docs/python/framework.md#Tensor), the
value may be a Python scalar, string, list, or numpy ndarray value may be a Python scalar, string, list, or numpy ndarray
that can be converted to the same `dtype` as that that can be converted to the same `dtype` as that
tensor. Additionally, if the key is a tensor. Additionally, if the key is a
[placeholder](io_ops.md#placeholder), the shape of the value [placeholder](../../api_docs/python/io_ops.md#placeholder), the shape of
will be checked for compatibility with the placeholder. the value will be checked for compatibility with the placeholder.
* If the key is a [`SparseTensor`](sparse_ops.md#SparseTensor), * If the key is a
[`SparseTensor`](../../api_docs/python/sparse_ops.md#SparseTensor),
the value should be a the value should be a
[`SparseTensorValue`](sparse_ops.md#SparseTensorValue). [`SparseTensorValue`](../../api_docs/python/sparse_ops.md#SparseTensorValue).
Args: Args:
fetches: A single graph element, or a list of graph elements fetches: A single graph element, or a list of graph elements
@ -441,8 +442,8 @@ class Session(BaseSession):
``` ```
A session may own resources, such as A session may own resources, such as
[variables](state_ops.md#Variable), [queues](io_ops.md#QueueBase), [variables](../../api_docs/python/state_ops.md#Variable), [queues](../../api_docs/python/io_ops.md#QueueBase),
and [readers](io_ops.md#ReaderBase). It is important to release and [readers](../../api_docs/python/io_ops.md#ReaderBase). It is important to release
these resources when they are no longer required. To do this, either these resources when they are no longer required. To do this, either
invoke the [`close()`](#Session.close) method on the session, or use invoke the [`close()`](#Session.close) method on the session, or use
the session as a context manager. The following two examples are the session as a context manager. The following two examples are
@ -526,9 +527,9 @@ class InteractiveSession(BaseSession):
The only difference with a regular `Session` is that an `InteractiveSession` The only difference with a regular `Session` is that an `InteractiveSession`
installs itself as the default session on construction. installs itself as the default session on construction.
The methods [`Tensor.eval()`](framework.md#Tensor.eval) and The methods [`Tensor.eval()`](../../api_docs/python/framework.md#Tensor.eval)
[`Operation.run()`](framework.md#Operation.run) will use that session and [`Operation.run()`](../../api_docs/python/framework.md#Operation.run)
to run ops. will use that session to run ops.
This is convenient in interactive shells and [IPython This is convenient in interactive shells and [IPython
notebooks](http://ipython.org), as it avoids having to pass an explicit notebooks](http://ipython.org), as it avoids having to pass an explicit

View File

@ -41,7 +41,7 @@ class OpError(Exception):
*N.B.* If the failed op was synthesized at runtime, e.g. a `Send` *N.B.* If the failed op was synthesized at runtime, e.g. a `Send`
or `Recv` op, there will be no corresponding or `Recv` op, there will be no corresponding
[`Operation`](framework.md#Operation) object. In that case, this [`Operation`](../../api_docs/python/framework.md#Operation) object. In that case, this
will return `None`, and you should instead use the will return `None`, and you should instead use the
[`OpError.node_def`](#OpError.node_def) to discover information about the [`OpError.node_def`](#OpError.node_def) to discover information about the
op. op.
@ -129,11 +129,12 @@ class CancelledError(OpError):
"""Raised when an operation or step is cancelled. """Raised when an operation or step is cancelled.
For example, a long-running operation (e.g. For example, a long-running operation (e.g.
[`queue.enqueue()`](io_ops.md#QueueBase.enqueue) may be cancelled by [`queue.enqueue()`](../../api_docs/python/io_ops.md#QueueBase.enqueue) may be
running another operation (e.g. cancelled by running another operation (e.g.
[`queue.close(cancel_pending_enqueues=True)`](io_ops.md#QueueBase.close), [`queue.close(cancel_pending_enqueues=True)`](../../api_docs/python/io_ops.md#QueueBase.close),
or by [closing the session](client.md#Session.close). A step that is or by [closing the session](../../api_docs/python/client.md#Session.close).
running such a long-running operation will fail by raising `CancelledError`. A step that is running such a long-running operation will fail by raising
`CancelledError`.
@@__init__ @@__init__
""" """
@ -165,10 +166,10 @@ class InvalidArgumentError(OpError):
This may occur, for example, if an operation is receives an input This may occur, for example, if an operation is receives an input
tensor that has an invalid value or shape. For example, the tensor that has an invalid value or shape. For example, the
[`tf.matmul()`](math_ops.md#matmul) op will raise this error if it [`tf.matmul()`](../../api_docs/python/math_ops.md#matmul) op will raise this
receives an input that is not a matrix, and the error if it receives an input that is not a matrix, and the
[`tf.reshape()`](array_ops.md#reshape) op will raise this error if [`tf.reshape()`](../../api_docs/python/array_ops.md#reshape) op will raise
the new shape does not match the number of elements in the input this error if the new shape does not match the number of elements in the input
tensor. tensor.
@@__init__ @@__init__
@ -198,8 +199,8 @@ class NotFoundError(OpError):
"""Raised when a requested entity (e.g., a file or directory) was not found. """Raised when a requested entity (e.g., a file or directory) was not found.
For example, running the For example, running the
[`tf.WholeFileReader.read()`](io_ops.md#WholeFileReader) operation [`tf.WholeFileReader.read()`](../../api_docs/python/io_ops.md#WholeFileReader)
could raise `NotFoundError` if it receives the name of a file that operation could raise `NotFoundError` if it receives the name of a file that
does not exist. does not exist.
@@__init__ @@__init__
@ -214,8 +215,8 @@ class AlreadyExistsError(OpError):
"""Raised when an entity that we attempted to create already exists. """Raised when an entity that we attempted to create already exists.
For example, running an operation that saves a file For example, running an operation that saves a file
(e.g. [`tf.train.Saver.save()`](train.md#Saver.save)) could (e.g. [`tf.train.Saver.save()`](../../api_docs/python/train.md#Saver.save))
potentially raise this exception if an explicit filename for an could potentially raise this exception if an explicit filename for an
existing file was passed. existing file was passed.
@@__init__ @@__init__
@ -231,8 +232,8 @@ class PermissionDeniedError(OpError):
"""Raised when the caller does not have permission to run an operation. """Raised when the caller does not have permission to run an operation.
For example, running the For example, running the
[`tf.WholeFileReader.read()`](io_ops.md#WholeFileReader) operation [`tf.WholeFileReader.read()`](../../api_docs/python/io_ops.md#WholeFileReader)
could raise `PermissionDeniedError` if it receives the name of a operation could raise `PermissionDeniedError` if it receives the name of a
file for which the user does not have the read file permission. file for which the user does not have the read file permission.
@@__init__ @@__init__
@ -277,8 +278,8 @@ class FailedPreconditionError(OpError):
"""Operation was rejected because the system is not in a state to execute it. """Operation was rejected because the system is not in a state to execute it.
This exception is most commonly raised when running an operation This exception is most commonly raised when running an operation
that reads a [`tf.Variable`](state_ops.md#Variable) before it has that reads a [`tf.Variable`](../../api_docs/python/state_ops.md#Variable)
been initialized. before it has been initialized.
@@__init__ @@__init__
""" """
@ -292,9 +293,11 @@ class FailedPreconditionError(OpError):
class AbortedError(OpError): class AbortedError(OpError):
"""The operation was aborted, typically due to a concurrent action. """The operation was aborted, typically due to a concurrent action.
For example, running a [`queue.enqueue()`](io_ops.md#QueueBase.enqueue) For example, running a
[`queue.enqueue()`](../../api_docs/python/io_ops.md#QueueBase.enqueue)
operation may raise `AbortedError` if a operation may raise `AbortedError` if a
[`queue.close()`](io_ops.md#QueueBase.close) operation previously ran. [`queue.close()`](../../api_docs/python/io_ops.md#QueueBase.close) operation
previously ran.
@@__init__ @@__init__
""" """
@ -308,9 +311,10 @@ class OutOfRangeError(OpError):
"""Raised when an operation executed past the valid range. """Raised when an operation executed past the valid range.
This exception is raised in "end-of-file" conditions, such as when a This exception is raised in "end-of-file" conditions, such as when a
[`queue.dequeue()`](io_ops.md#QueueBase.dequeue) operation is [`queue.dequeue()`](../../api_docs/python/io_ops.md#QueueBase.dequeue)
blocked on an empty queue, and a operation is blocked on an empty queue, and a
[`queue.close()`](io_ops.md#QueueBase.close) operation executes. [`queue.close()`](../../api_docs/python/io_ops.md#QueueBase.close)
operation executes.
@@__init__ @@__init__
""" """
@ -326,9 +330,9 @@ class UnimplementedError(OpError):
Some operations may raise this error when passed otherwise-valid Some operations may raise this error when passed otherwise-valid
arguments that it does not currently support. For example, running arguments that it does not currently support. For example, running
the [`tf.nn.max_pool()`](nn.md#max_pool) operation would raise this the [`tf.nn.max_pool()`](../../api_docs/python/nn.md#max_pool) operation
error if pooling was requested on the batch dimension, because this would raise this error if pooling was requested on the batch dimension,
is not yet supported. because this is not yet supported.
@@__init__ @@__init__
""" """
@ -371,8 +375,8 @@ class DataLossError(OpError):
"""Raised when unrecoverable data loss or corruption is encountered. """Raised when unrecoverable data loss or corruption is encountered.
For example, this may be raised by running a For example, this may be raised by running a
[`tf.WholeFileReader.read()`](io_ops.md#WholeFileReader) operation, [`tf.WholeFileReader.read()`](../../api_docs/python/io_ops.md#WholeFileReader)
if the file is truncated while it is being read. operation, if the file is truncated while it is being read.
@@__init__ @@__init__
""" """

View File

@ -18,9 +18,11 @@ tf.flags.DEFINE_boolean("print_hidden_regex", False,
FLAGS = tf.flags.FLAGS FLAGS = tf.flags.FLAGS
# TODO(josh11b,wicke): Remove the ../../api_docs/python/ once the
# website can handle it.
PREFIX_TEXT = """ PREFIX_TEXT = """
Note: Functions taking `Tensor` arguments can also take anything Note: Functions taking `Tensor` arguments can also take anything accepted by
accepted by [`tf.convert_to_tensor`](framework.md#convert_to_tensor). [`tf.convert_to_tensor`](../../api_docs/python/framework.md#convert_to_tensor).
""" """

View File

@ -79,7 +79,7 @@ class Tensor(object):
A `Tensor` is a symbolic handle to one of the outputs of an A `Tensor` is a symbolic handle to one of the outputs of an
`Operation`. It does not hold the values of that operation's output, `Operation`. It does not hold the values of that operation's output,
but instead provides a means of computing those values in a but instead provides a means of computing those values in a
TensorFlow [`Session`](client.md#Session). TensorFlow [`Session`](../../api_docs/python/client.md#Session).
This class has two primary purposes: This class has two primary purposes:
@ -90,7 +90,7 @@ class Tensor(object):
2. After the graph has been launched in a session, the value of the 2. After the graph has been launched in a session, the value of the
`Tensor` can be computed by passing it to `Tensor` can be computed by passing it to
[`Session.run()`](client.md#Session.run). [`Session.run()`](../../api_docs/python/client.md#Session.run).
`t.eval()` is a shortcut for calling `t.eval()` is a shortcut for calling
`tf.get_default_session().run(t)`. `tf.get_default_session().run(t)`.
@ -204,8 +204,8 @@ class Tensor(object):
The shape is computed using shape inference functions that are The shape is computed using shape inference functions that are
registered for each `Operation` type using `tf.RegisterShape`. registered for each `Operation` type using `tf.RegisterShape`.
See [`TensorShape`](framework.md#TensorShape) for more details of what a shape See [`TensorShape`](../../api_docs/python/framework.md#TensorShape) for more
represents. details of what a shape represents.
The inferred shape of a tensor is used to provide shape The inferred shape of a tensor is used to provide shape
information without having to launch the graph in a session. This information without having to launch the graph in a session. This
@ -393,8 +393,8 @@ class Tensor(object):
Args: Args:
feed_dict: A dictionary that maps `Tensor` objects to feed values. feed_dict: A dictionary that maps `Tensor` objects to feed values.
See [`Session.run()`](client.md#Session.run) for a description of See [`Session.run()`](../../api_docs/python/client.md#Session.run) for a
the valid feed values. description of the valid feed values.
session: (Optional.) The `Session` to be used to evaluate this tensor. If session: (Optional.) The `Session` to be used to evaluate this tensor. If
none, the default session will be used. none, the default session will be used.
@ -614,10 +614,10 @@ class IndexedSlices(object):
The `IndexedSlices` class is used principally in the definition of The `IndexedSlices` class is used principally in the definition of
gradients for operations that have sparse gradients gradients for operations that have sparse gradients
(e.g. [`tf.gather`](array_ops.md#gather)). (e.g. [`tf.gather`](../../api_docs/python/array_ops.md#gather)).
Contrast this representation with Contrast this representation with
[`SparseTensor`](sparse_ops.md#SparseTensor), [`SparseTensor`](../../api_docs/python/sparse_ops.md#SparseTensor),
which uses multi-dimensional indices and scalar values. which uses multi-dimensional indices and scalar values.
@@__init__ @@__init__
@ -869,15 +869,17 @@ class Operation(object):
An `Operation` is a node in a TensorFlow `Graph` that takes zero or An `Operation` is a node in a TensorFlow `Graph` that takes zero or
more `Tensor` objects as input, and produces zero or more `Tensor` more `Tensor` objects as input, and produces zero or more `Tensor`
objects as output. Objects of type `Operation` are created by objects as output. Objects of type `Operation` are created by
calling a Python op constructor (such as [`tf.matmul()`](math_ops.md#matmul)) calling a Python op constructor (such as
or [`Graph.create_op()`](framework.md#Graph.create_op). [`tf.matmul()`](../../api_docs/python/math_ops.md#matmul))
or [`Graph.create_op()`](../../api_docs/python/framework.md#Graph.create_op).
For example `c = tf.matmul(a, b)` creates an `Operation` of type For example `c = tf.matmul(a, b)` creates an `Operation` of type
"MatMul" that takes tensors `a` and `b` as input, and produces `c` "MatMul" that takes tensors `a` and `b` as input, and produces `c`
as output. as output.
After the graph has been launched in a session, an `Operation` can After the graph has been launched in a session, an `Operation` can
be executed by passing it to [`Session.run()`](client.md#Session.run). be executed by passing it to
[`Session.run()`](../../api_docs/python/client.md#Session.run).
`op.run()` is a shortcut for calling `tf.get_default_session().run(op)`. `op.run()` is a shortcut for calling `tf.get_default_session().run(op)`.
@@name @@name
@ -1257,8 +1259,8 @@ class Operation(object):
Args: Args:
feed_dict: A dictionary that maps `Tensor` objects to feed values. feed_dict: A dictionary that maps `Tensor` objects to feed values.
See [`Session.run()`](client.md#Session.run) for a description of the See [`Session.run()`](../../api_docs/python/client.md#Session.run)
valid feed values. for a description of the valid feed values.
session: (Optional.) The `Session` to be used to run to this operation. If session: (Optional.) The `Session` to be used to run to this operation. If
none, the default session will be used. none, the default session will be used.
""" """
@ -1424,14 +1426,16 @@ def set_shapes_for_outputs(op):
class Graph(object): class Graph(object):
"""A TensorFlow computation, represented as a dataflow graph. """A TensorFlow computation, represented as a dataflow graph.
A `Graph` contains a set of [`Operation`](framework.md#Operation) objects, A `Graph` contains a set of
which represent units of computation; and [`Tensor`](framework.md#Tensor) [`Operation`](../../api_docs/python/framework.md#Operation) objects,
objects, which represent the units of data that flow between operations. which represent units of computation; and
[`Tensor`](../../api_docs/python/framework.md#Tensor) objects, which represent
the units of data that flow between operations.
A default `Graph` is always registered, and accessible by calling A default `Graph` is always registered, and accessible by calling
[`tf.get_default_graph()`](framework.md#get_default_graph). To add an [`tf.get_default_graph()`](../../api_docs/python/framework.md#get_default_graph).
operation to the default graph, simply call one of the functions that defines To add an operation to the default graph, simply call one of the functions
a new `Operation`: that defines a new `Operation`:
``` ```
c = tf.constant(4.0) c = tf.constant(4.0)
@ -1439,7 +1443,7 @@ class Graph(object):
``` ```
Another typical usage involves the Another typical usage involves the
[`Graph.as_default()`](framework.md#Graph.as_default) [`Graph.as_default()`](../../api_docs/python/framework.md#Graph.as_default)
context manager, which overrides the current default graph for the context manager, which overrides the current default graph for the
lifetime of the context: lifetime of the context:
@ -1470,9 +1474,9 @@ class Graph(object):
that are identified by name. For convenience when building a large that are identified by name. For convenience when building a large
graph, collections can store groups of related objects: for graph, collections can store groups of related objects: for
example, the `tf.Variable` uses a collection (named example, the `tf.Variable` uses a collection (named
[`tf.GraphKeys.VARIABLES`](framework.md#GraphKeys)) for all variables that are [`tf.GraphKeys.VARIABLES`](../../api_docs/python/framework.md#GraphKeys)) for
created during the construction of a graph. The caller may define all variables that are created during the construction of a graph. The caller
additional collections by specifying a new name. may define additional collections by specifying a new name.
@@add_to_collection @@add_to_collection
@@get_collection @@get_collection
@ -1581,7 +1585,7 @@ class Graph(object):
After calling `g.finalize()`, no new operations can be added to After calling `g.finalize()`, no new operations can be added to
`g`. This method is used to ensure that no operations are added `g`. This method is used to ensure that no operations are added
to a graph when it is shared between multiple threads, for example to a graph when it is shared between multiple threads, for example
when using a [`QueueRunner`](train.md#QueueRunner). when using a [`QueueRunner`](../../api_docs/python/train.md#QueueRunner).
""" """
self._finalized = True self._finalized = True
@ -1606,7 +1610,7 @@ class Graph(object):
The serialized `GraphDef` can be imported into another `Graph` The serialized `GraphDef` can be imported into another `Graph`
(using [`import_graph_def()`](#import_graph_def)) or used with the (using [`import_graph_def()`](#import_graph_def)) or used with the
[C++ Session API](../cc/index.md). [C++ Session API](../../api_docs/cc/index.md).
This method is thread-safe. This method is thread-safe.
@ -2532,7 +2536,9 @@ class Graph(object):
def device(dev): def device(dev):
"""Wrapper for `Graph.device()` using the default graph. """Wrapper for `Graph.device()` using the default graph.
See [`Graph.name_scope()`](framework.md#Graph.name_scope) for more details. See
[`Graph.name_scope()`](../../api_docs/python/framework.md#Graph.name_scope)
for more details.
Args: Args:
device_name_or_function: The device name or function to use in device_name_or_function: The device name or function to use in
@ -2548,7 +2554,9 @@ def device(dev):
def name_scope(name): def name_scope(name):
"""Wrapper for `Graph.name_scope()` using the default graph. """Wrapper for `Graph.name_scope()` using the default graph.
See [`Graph.name_scope()`](framework.md#Graph.name_scope) for more details. See
[`Graph.name_scope()`](../../api_docs/python/framework.md#Graph.name_scope)
for more details.
Args: Args:
name: A name for the scope. name: A name for the scope.
@ -2563,7 +2571,7 @@ def name_scope(name):
def control_dependencies(control_inputs): def control_dependencies(control_inputs):
"""Wrapper for `Graph.control_dependencies()` using the default graph. """Wrapper for `Graph.control_dependencies()` using the default graph.
See [`Graph.control_dependencies()`](framework.md#Graph.control_dependencies) See [`Graph.control_dependencies()`](../../api_docs/python/framework.md#Graph.control_dependencies)
for more details. for more details.
Args: Args:
@ -2890,17 +2898,20 @@ class GraphKeys(object):
* `VARIABLES`: the `Variable` objects that comprise a model, and * `VARIABLES`: the `Variable` objects that comprise a model, and
must be saved and restored together. See must be saved and restored together. See
[`tf.all_variables()`](state_ops.md#all_variables) for more details. [`tf.all_variables()`](../../api_docs/python/state_ops.md#all_variables)
for more details.
* `TRAINABLE_VARIABLES`: the subset of `Variable` objects that will * `TRAINABLE_VARIABLES`: the subset of `Variable` objects that will
be trained by an optimizer. See be trained by an optimizer. See
[`tf.trainable_variables()`](state_ops.md#trainable_variables) [`tf.trainable_variables()`](../../api_docs/python/state_ops.md#trainable_variables)
for more details. for more details.
* `SUMMARIES`: the summary `Tensor` objects that have been created * `SUMMARIES`: the summary `Tensor` objects that have been created in the
in the graph. See [`tf.merge_all_summaries()`](train.md#merge_all_summaries) graph. See
[`tf.merge_all_summaries()`](../../api_docs/python/train.md#merge_all_summaries)
for more details. for more details.
* `QUEUE_RUNNERS`: the `QueueRunner` objects that are used to * `QUEUE_RUNNERS`: the `QueueRunner` objects that are used to
produce input for a computation. See produce input for a computation. See
[`tf.start_queue_runners()`](train.md#start_queue_runners) for more details. [`tf.start_queue_runners()`](../../api_docs/python/train.md#start_queue_runners)
for more details.
""" """
# Key to collect variables.Variable objects that must be saved and restored # Key to collect variables.Variable objects that must be saved and restored
@ -2920,7 +2931,7 @@ class GraphKeys(object):
def add_to_collection(name, value): def add_to_collection(name, value):
"""Wrapper for `Graph.add_to_collection()` using the default graph. """Wrapper for `Graph.add_to_collection()` using the default graph.
See [`Graph.add_to_collection()`](framework.md#Graph.add_to_collection) See [`Graph.add_to_collection()`](../../api_docs/python/framework.md#Graph.add_to_collection)
for more details. for more details.
Args: Args:
@ -2934,7 +2945,7 @@ def add_to_collection(name, value):
def get_collection(key, scope=None): def get_collection(key, scope=None):
"""Wrapper for `Graph.get_collection()` using the default graph. """Wrapper for `Graph.get_collection()` using the default graph.
See [`Graph.get_collection()`](framework.md#Graph.get_collection) See [`Graph.get_collection()`](../../api_docs/python/framework.md#Graph.get_collection)
for more details. for more details.
Args: Args:

View File

@ -16,7 +16,7 @@ def get_seed(op_seed):
graph, or for only specific operations. graph, or for only specific operations.
For details on how the graph-level seed interacts with op seeds, see For details on how the graph-level seed interacts with op seeds, see
[`set_random_seed`](constant_op.md#set_random_seed). [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed).
Args: Args:
op_seed: integer. op_seed: integer.

View File

@ -334,10 +334,10 @@ class TensorShape(object):
If a tensor is produced by an operation of type `"Foo"`, its shape If a tensor is produced by an operation of type `"Foo"`, its shape
may be inferred if there is a registered shape function for may be inferred if there is a registered shape function for
`"Foo"`. See [`tf.RegisterShape()`](framework.md#RegisterShape) `"Foo"`. See [`tf.RegisterShape()`](../../api_docs/python/framework.md#RegisterShape)
for details of shape for details of shape
functions and how to register them. Alternatively, the shape may be set functions and how to register them. Alternatively, the shape may be set
explicitly using [`Tensor.set_shape()`](framework.md#Tensor.set_shape). explicitly using [`Tensor.set_shape()`](../../api_docs/python/framework.md#Tensor.set_shape).
@@merge_with @@merge_with
@@concatenate @@concatenate

View File

@ -26,11 +26,13 @@ time they are evaluated.
The `seed` keyword argument in these functions acts in conjunction with The `seed` keyword argument in these functions acts in conjunction with
the graph-level random seed. Changing either the graph-level seed using the graph-level random seed. Changing either the graph-level seed using
[`set_random_seed`](constant_op.md#set_random_seed) or the op-level seed [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed) or the
will change the underlying seed of these operations. Setting neither graph-level op-level seed will change the underlying seed of these operations. Setting
nor op-level seed, results in a random seed for all operations. neither graph-level nor op-level seed, results in a random seed for all
See [`set_random_seed`](constant_op.md#set_random_seed) for details on the operations.
interaction between operation-level and graph-level random seeds. See [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for details on the interaction between operation-level and graph-level random
seeds.
### Examples: ### Examples:

View File

@ -337,8 +337,9 @@ class RandomShuffleQueue(QueueBase):
the number of tensors in each queue element. the number of tensors in each queue element.
shapes: (Optional.) A list of fully-defined `TensorShape` objects, shapes: (Optional.) A list of fully-defined `TensorShape` objects,
with the same length as `dtypes` or `None`. with the same length as `dtypes` or `None`.
seed: A Python integer. Used to create a random seed. seed: A Python integer. Used to create a random seed. See
See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
shared_name: (Optional.) If non-empty, this queue will be shared under shared_name: (Optional.) If non-empty, this queue will be shared under
the given name across multiple sessions. the given name across multiple sessions.
name: Optional name for the queue operation. name: Optional name for the queue operation.

View File

@ -12,8 +12,8 @@ def embedding_lookup(params, ids, name=None):
This function is used to perform parallel lookups on the list of This function is used to perform parallel lookups on the list of
tensors in `params`. It is a generalization of tensors in `params`. It is a generalization of
[`tf.gather()`](array_ops.md#gather), where `params` is interpreted [`tf.gather()`](../../api_docs/python/array_ops.md#gather), where `params` is
as a partition of a larger embedding tensor. interpreted as a partition of a larger embedding tensor.
If `len(params) > 1`, each element `id` of `ids` is partitioned between If `len(params) > 1`, each element `id` of `ids` is partitioned between
the elements of `params` by computing `p = id % len(params)`, and is the elements of `params` by computing `p = id % len(params)`, and is

View File

@ -172,8 +172,9 @@ def random_flip_up_down(image, seed=None):
Args: Args:
image: A 3-D tensor of shape `[height, width, channels].` image: A 3-D tensor of shape `[height, width, channels].`
seed: A Python integer. Used to create a random seed. seed: A Python integer. Used to create a random seed. See
See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
Returns: Returns:
A 3-D tensor of the same type and shape as `image`. A 3-D tensor of the same type and shape as `image`.
@ -195,8 +196,9 @@ def random_flip_left_right(image, seed=None):
Args: Args:
image: A 3-D tensor of shape `[height, width, channels].` image: A 3-D tensor of shape `[height, width, channels].`
seed: A Python integer. Used to create a random seed. seed: A Python integer. Used to create a random seed. See
See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
Returns: Returns:
A 3-D tensor of the same type and shape as `image`. A 3-D tensor of the same type and shape as `image`.
@ -563,8 +565,9 @@ def random_brightness(image, max_delta, seed=None):
Args: Args:
image: 3-D tensor of shape `[height, width, channels]`. image: 3-D tensor of shape `[height, width, channels]`.
max_delta: float, must be non-negative. max_delta: float, must be non-negative.
seed: A Python integer. Used to create a random seed. seed: A Python integer. Used to create a random seed. See
See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
Returns: Returns:
3-D tensor of images of shape `[height, width, channels]` 3-D tensor of images of shape `[height, width, channels]`
@ -591,8 +594,9 @@ def random_contrast(image, lower, upper, seed=None):
image: 3-D tensor of shape `[height, width, channels]`. image: 3-D tensor of shape `[height, width, channels]`.
lower: float. Lower bound for the random contrast factor. lower: float. Lower bound for the random contrast factor.
upper: float. Upper bound for the random contrast factor. upper: float. Upper bound for the random contrast factor.
seed: A Python integer. Used to create a random seed. seed: A Python integer. Used to create a random seed. See
See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
Returns: Returns:
3-D tensor of shape `[height, width, channels]`. 3-D tensor of shape `[height, width, channels]`.
@ -775,8 +779,9 @@ def random_crop(image, size, seed=None, name=None):
Args: Args:
image: 3-D tensor of shape `[height, width, channels]` image: 3-D tensor of shape `[height, width, channels]`
size: 1-D tensor with two elements, specifying target `[height, width]` size: 1-D tensor with two elements, specifying target `[height, width]`
seed: A Python integer. Used to create a random seed. seed: A Python integer. Used to create a random seed. See
See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
name: A name for this operation (optional). name: A name for this operation (optional).
Returns: Returns:

View File

@ -32,8 +32,9 @@ def random_uniform_initializer(minval=0.0, maxval=1.0, seed=None):
of random values to generate. of random values to generate.
maxval: a python scalar or a scalar tensor. upper bound of the range maxval: a python scalar or a scalar tensor. upper bound of the range
of random values to generate. of random values to generate.
seed: A Python integer. Used to create random seeds. seed: A Python integer. Used to create random seeds. See
See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
Returns: Returns:
An initializer that generates Tensors with a uniform distribution. An initializer that generates Tensors with a uniform distribution.
@ -50,8 +51,9 @@ def random_normal_initializer(mean=0.0, stddev=1.0, seed=None):
to generate. to generate.
stddev: a python scalar or a scalar tensor. Standard deviation of the stddev: a python scalar or a scalar tensor. Standard deviation of the
random values to generate. random values to generate.
seed: A Python integer. Used to create random seeds. seed: A Python integer. Used to create random seeds. See
See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
Returns: Returns:
An initializer that generates Tensors with a normal distribution. An initializer that generates Tensors with a normal distribution.
@ -73,8 +75,9 @@ def truncated_normal_initializer(mean=0.0, stddev=1.0, seed=None):
to generate. to generate.
stddev: a python scalar or a scalar tensor. Standard deviation of the stddev: a python scalar or a scalar tensor. Standard deviation of the
random values to generate. random values to generate.
seed: A Python integer. Used to create random seeds. seed: A Python integer. Used to create random seeds. See
See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
Returns: Returns:
An initializer that generates Tensors with a truncated normal An initializer that generates Tensors with a truncated normal
@ -104,8 +107,9 @@ def uniform_unit_scaling_initializer(factor=1.0, seed=None):
Args: Args:
factor: Float. A multiplicative factor by which the values will be scaled. factor: Float. A multiplicative factor by which the values will be scaled.
seed: A Python integer. Used to create random seeds. seed: A Python integer. Used to create random seeds. See
See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
Returns: Returns:
An initializer that generates tensors with unit variance. An initializer that generates tensors with unit variance.
@ -132,8 +136,9 @@ def _random_walk(shape, nonlinearity, dtype=types.float32, seed=None,
nonlinearity: the brain python function for implementing the nonlinearity: the brain python function for implementing the
nonlinearity in tensor flow. nonlinearity in tensor flow.
dtype: The type of the output. dtype: The type of the output.
seed: A Python integer. Used to create random seeds. seed: A Python integer. Used to create random seeds. See
See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
name: string. Optional name for the op. name: string. Optional name for the op.
Returns: Returns:
@ -169,8 +174,9 @@ class _RandomWalkInitializer(object):
Args: Args:
nonlinearity: the python tensorflow function that computes a nonlinearity nonlinearity: the python tensorflow function that computes a nonlinearity
in the graph, typically after a Wx+b type operation. in the graph, typically after a Wx+b type operation.
seed: A Python integer. Used to create random seeds. seed: A Python integer. Used to create random seeds. See
See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
""" """
self._nonlinearity = nonlinearity self._nonlinearity = nonlinearity
self._seed = seed self._seed = seed

View File

@ -346,8 +346,9 @@ def dropout(x, keep_prob, noise_shape=None, seed=None, name=None):
keep_prob: A Python float. The probability that each element is kept. keep_prob: A Python float. The probability that each element is kept.
noise_shape: A 1-D `Tensor` of type `int32`, representing the noise_shape: A 1-D `Tensor` of type `int32`, representing the
shape for randomly generated keep/drop flags. shape for randomly generated keep/drop flags.
seed: A Python integer. Used to create a random seed. seed: A Python integer. Used to create random seeds. See
See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
name: A name for this operation (optional). name: A name for this operation (optional).
Returns: Returns:

View File

@ -34,7 +34,9 @@ def random_normal(shape, mean=0.0, stddev=1.0, dtype=types.float32,
of the normal distribution. of the normal distribution.
dtype: The type of the output. dtype: The type of the output.
seed: A Python integer. Used to create a random seed for the distribution. seed: A Python integer. Used to create a random seed for the distribution.
See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. See
[`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
name: A name for the operation (optional). name: A name for the operation (optional).
Returns: Returns:
@ -74,7 +76,9 @@ def truncated_normal(shape, mean=0.0, stddev=1.0, dtype=types.float32,
of the truncated normal distribution. of the truncated normal distribution.
dtype: The type of the output. dtype: The type of the output.
seed: A Python integer. Used to create a random seed for the distribution. seed: A Python integer. Used to create a random seed for the distribution.
See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. See
[`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
name: A name for the operation (optional). name: A name for the operation (optional).
Returns: Returns:
@ -115,7 +119,9 @@ def random_uniform(shape, minval=0.0, maxval=1.0,
the range of random values to generate. the range of random values to generate.
dtype: The type of the output. dtype: The type of the output.
seed: A Python integer. Used to create a random seed for the distribution. seed: A Python integer. Used to create a random seed for the distribution.
See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. See
[`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
name: A name for the operation (optional). name: A name for the operation (optional).
Returns: Returns:
@ -151,7 +157,9 @@ def random_shuffle(value, seed=None, name=None):
Args: Args:
value: A Tensor to be shuffled. value: A Tensor to be shuffled.
seed: A Python integer. Used to create a random seed for the distribution. seed: A Python integer. Used to create a random seed for the distribution.
See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. See
[`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
name: A name for the operation (optional). name: A name for the operation (optional).
Returns: Returns:

View File

@ -47,7 +47,8 @@ useful for training embedding models and similar lookup-based networks, since
only a small subset of embedding vectors change in any given step. only a small subset of embedding vectors change in any given step.
Since a sparse update of a large tensor may be generated automatically during Since a sparse update of a large tensor may be generated automatically during
gradient computation (as in the gradient of [`tf.gather`](array_ops.md#gather)), gradient computation (as in the gradient of
[`tf.gather`](../../api_docs/python/array_ops.md#gather)),
an [`IndexedSlices`](#IndexedSlices) class is provided that encapsulates a set an [`IndexedSlices`](#IndexedSlices) class is provided that encapsulates a set
of sparse indices and values. `IndexedSlices` objects are detected and handled of sparse indices and values. `IndexedSlices` objects are detected and handled
automatically by the optimizers in most cases. automatically by the optimizers in most cases.

View File

@ -207,7 +207,7 @@ class Variable(object):
This convenience method requires a session where the graph containing this This convenience method requires a session where the graph containing this
variable has been launched. If no session is passed, the default session is variable has been launched. If no session is passed, the default session is
used. See the [Session class](client.md#Session) for more information on used. See the [Session class](../../api_docs/python/client.md#Session) for more information on
launching a graph and on sessions. launching a graph and on sessions.
```python ```python

View File

@ -107,8 +107,8 @@ class ExponentialMovingAverage(object):
for a given variable. for a given variable.
* Build a model normally but load the checkpoint files to evaluate by using * Build a model normally but load the checkpoint files to evaluate by using
the shadow variable names. For this use the `average_name()` method. See the shadow variable names. For this use the `average_name()` method. See
the [Saver class](train.md#Saver) for more information on restoring saved the [Saver class](../../api_docs/python/train.md#Saver) for more
variables. information on restoring saved variables.
Example of restoring the shadow variable values: Example of restoring the shadow variable values:

View File

@ -75,8 +75,8 @@ The following ops output
protocol buffers as serialized string tensors. protocol buffers as serialized string tensors.
You can fetch the output of a summary op in a session, and pass it to You can fetch the output of a summary op in a session, and pass it to
a [SummaryWriter](train.md#SummaryWriter) to append it to an event a [SummaryWriter](../../api_docs/python/train.md#SummaryWriter) to append it
file. Event files contain to an event file. Event files contain
[`Event`](https://tensorflow.googlesource.com/tensorflow/+/master/tensorflow/core/util/event.proto) [`Event`](https://tensorflow.googlesource.com/tensorflow/+/master/tensorflow/core/util/event.proto)
protos that can contain `Summary` protos along with the timestamp and protos that can contain `Summary` protos along with the timestamp and
step. You can then use TensorBoard to visualize the contents of the step. You can then use TensorBoard to visualize the contents of the

View File

@ -6,7 +6,7 @@ from setuptools.dist import Distribution
_VERSION = '0.5.0' _VERSION = '0.5.0'
REQUIRED_PACKAGES = [ REQUIRED_PACKAGES = [
'numpy >= 1.10.1', 'numpy >= 1.9.2',
'six >= 1.10.0', 'six >= 1.10.0',
] ]