From b2dc60eaa9c00421293b87824a2047fdcf6fa331 Mon Sep 17 00:00:00 2001 From: Manjunath Kudlur Date: Sun, 8 Nov 2015 17:41:48 -0800 Subject: [PATCH] TensorFlow: Upstream changes to git. Changes: - Documentation updates. - Relax numpy requirement to 1.9.2 Base CL: 107349632 --- tensorflow/core/ops/math_ops.cc | 34 +++--- tensorflow/g3doc/api_docs/cc/index.md | 4 +- tensorflow/g3doc/api_docs/python/array_ops.md | 4 +- tensorflow/g3doc/api_docs/python/client.md | 101 +++++++++--------- .../g3doc/api_docs/python/constant_op.md | 32 ++++-- .../g3doc/api_docs/python/control_flow_ops.md | 4 +- tensorflow/g3doc/api_docs/python/framework.md | 83 +++++++------- tensorflow/g3doc/api_docs/python/image.md | 29 ++--- tensorflow/g3doc/api_docs/python/io_ops.md | 9 +- tensorflow/g3doc/api_docs/python/math_ops.md | 38 ++++--- tensorflow/g3doc/api_docs/python/nn.md | 13 +-- .../g3doc/api_docs/python/sparse_ops.md | 4 +- tensorflow/g3doc/api_docs/python/state_ops.md | 33 +++--- tensorflow/g3doc/api_docs/python/train.md | 8 +- .../summaries_and_tensorboard/index.md | 5 +- tensorflow/g3doc/tutorials/deep_cnn/index.md | 5 - tensorflow/python/client/session.py | 41 +++---- tensorflow/python/framework/errors.py | 60 ++++++----- .../python/framework/gen_docs_combined.py | 6 +- tensorflow/python/framework/ops.py | 81 ++++++++------ tensorflow/python/framework/random_seed.py | 2 +- tensorflow/python/framework/tensor_shape.py | 4 +- tensorflow/python/ops/constant_op.py | 12 ++- tensorflow/python/ops/data_flow_ops.py | 5 +- tensorflow/python/ops/embedding_ops.py | 4 +- tensorflow/python/ops/image_ops.py | 25 +++-- tensorflow/python/ops/init_ops.py | 30 +++--- tensorflow/python/ops/nn.py | 5 +- tensorflow/python/ops/random_ops.py | 16 ++- tensorflow/python/ops/state_ops.py | 3 +- tensorflow/python/ops/variables.py | 2 +- tensorflow/python/training/moving_averages.py | 4 +- tensorflow/python/training/training.py | 4 +- tensorflow/tools/pip_package/setup.py | 2 +- 34 files changed, 398 insertions(+), 314 deletions(-) diff --git a/tensorflow/core/ops/math_ops.cc b/tensorflow/core/ops/math_ops.cc index 20e56316eac..58c091bc9f0 100644 --- a/tensorflow/core/ops/math_ops.cc +++ b/tensorflow/core/ops/math_ops.cc @@ -626,7 +626,7 @@ REGISTER_OP("SegmentSum") .Doc(R"doc( 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. Computes a tensor such that @@ -653,8 +653,9 @@ REGISTER_OP("SegmentMean") .Doc(R"doc( Computes the mean along segments of a tensor. -Read [the section on Segmentation](../python/math_ops.md#segmentation) -for an explanation of segments. +Read [the section on +Segmentation](../../api_docs/python/math_ops.md#segmentation) for an explanation +of segments. Computes a tensor such that \\(output_i = \frac{\sum_j data_j}{N}\\) where `mean` is @@ -681,8 +682,9 @@ REGISTER_OP("SegmentProd") .Doc(R"doc( Computes the product along segments of a tensor. -Read [the section on Segmentation](../python/math_ops.md#segmentation) -for an explanation of segments. +Read [the section on +Segmentation](../../api_docs/python/math_ops.md#segmentation) for an explanation +of segments. Computes a tensor such that \\(output_i = \prod_j data_j\\) where the product is over `j` such @@ -708,8 +710,9 @@ REGISTER_OP("SegmentMin") .Doc(R"doc( Computes the minimum along segments of a tensor. -Read [the section on Segmentation](../python/math_ops.md#segmentation) -for an explanation of segments. +Read [the section on +Segmentation](../../api_docs/python/math_ops.md#segmentation) for an explanation +of segments. Computes a tensor such that \\(output_i = \min_j(data_j)\\) where `min` is over `j` such @@ -735,7 +738,7 @@ REGISTER_OP("SegmentMax") .Doc(R"doc( 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. Computes a tensor such that @@ -763,8 +766,9 @@ REGISTER_OP("UnsortedSegmentSum") .Doc(R"doc( Computes the sum along segments of a tensor. -Read [the section on Segmentation](../python/math_ops.md#segmentation) -for an explanation of segments. +Read [the section on +Segmentation](../../api_docs/python/math_ops.md#segmentation) for an explanation +of segments. Computes a tensor such that \\(output_i = \sum_j data_j\\) where sum is over `j` such @@ -797,8 +801,9 @@ REGISTER_OP("SparseSegmentSum") .Doc(R"doc( Computes the sum along sparse segments of a tensor. -Read [the section on Segmentation](../python/math_ops.md#segmentation) -for an explanation of segments. +Read [the section on +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 dimension, selecting a subset of dimension_0, specified by `indices`. @@ -843,8 +848,9 @@ REGISTER_OP("SparseSegmentMean") .Doc(R"doc( Computes the mean along sparse segments of a tensor. -Read [the section on Segmentation](../python/math_ops.md#segmentation) -for an explanation of segments. +Read [the section on +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 dimension, selecting a subset of dimension_0, specified by `indices`. diff --git a/tensorflow/g3doc/api_docs/cc/index.md b/tensorflow/g3doc/api_docs/cc/index.md index 97a213e50d7..c4bd0cd32a6 100644 --- a/tensorflow/g3doc/api_docs/cc/index.md +++ b/tensorflow/g3doc/api_docs/cc/index.md @@ -3,8 +3,8 @@ 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++: -1. Build the computation graph using the [Python API](../python/). -1. Use [tf.train.write_graph()](../python/train.md#write_graph) to +1. Build the computation graph using the [Python API](../../api_docs/python/). +1. Use [tf.train.write_graph()](../../api_docs/python/train.md#write_graph) to write the graph to a file. 1. Load the graph using the C++ Session API. For example: diff --git a/tensorflow/g3doc/api_docs/python/array_ops.md b/tensorflow/g3doc/api_docs/python/array_ops.md index 44b32ecc8e7..b0e71a89192 100644 --- a/tensorflow/g3doc/api_docs/python/array_ops.md +++ b/tensorflow/g3doc/api_docs/python/array_ops.md @@ -2,8 +2,8 @@ # Tensor Transformations -Note: Functions taking `Tensor` arguments can also take anything -accepted by [`tf.convert_to_tensor`](framework.md#convert_to_tensor). +Note: Functions taking `Tensor` arguments can also take anything accepted by +[`tf.convert_to_tensor`](../../api_docs/python/framework.md#convert_to_tensor). ## Contents diff --git a/tensorflow/g3doc/api_docs/python/client.md b/tensorflow/g3doc/api_docs/python/client.md index 738225a656a..7f7f87913af 100644 --- a/tensorflow/g3doc/api_docs/python/client.md +++ b/tensorflow/g3doc/api_docs/python/client.md @@ -61,8 +61,8 @@ print sess.run(c) ``` A session may own resources, such as -[variables](state_ops.md#Variable), [queues](io_ops.md#QueueBase), -and [readers](io_ops.md#ReaderBase). It is important to release +[variables](../../api_docs/python/state_ops.md#Variable), [queues](../../api_docs/python/io_ops.md#QueueBase), +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 invoke the [`close()`](#Session.close) method on the session, or use 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: * If the *i*th element of `fetches` is an - [`Operation`](framework.md#Operation), the *i*th return value - will be `None`. + [`Operation`](../../api_docs/python/framework.md#Operation), the *i*th + return value will be `None`. * If the *i*th element of `fetches` is a - [`Tensor`](framework.md#Tensor), the *i*th return value will - be a numpy ndarray containing the value of that tensor. + [`Tensor`](../../api_docs/python/framework.md#Tensor), the *i*th return + value will be a numpy ndarray containing the value of that tensor. * If the *i*th element of `fetches` is a - [`SparseTensor`](sparse_ops.md#SparseTensor), the *i*th - return value will be a - [`SparseTensorValue`](sparse_ops.md#SparseTensorValue) + [`SparseTensor`](../../api_docs/python/sparse_ops.md#SparseTensor), + the *i*th return value will be a + [`SparseTensorValue`](../../api_docs/python/sparse_ops.md#SparseTensorValue) containing the value of that sparse tensor. The optional `feed_dict` argument allows the caller to override the value of tensors in the graph. Each key in `feed_dict` can be 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 that can be converted to the same `dtype` as that tensor. Additionally, if the key is a - [placeholder](io_ops.md#placeholder), the shape of the value - will be checked for compatibility with the placeholder. -* If the key is a [`SparseTensor`](sparse_ops.md#SparseTensor), + [placeholder](../../api_docs/python/io_ops.md#placeholder), the shape of + the value will be checked for compatibility with the placeholder. +* If the key is a + [`SparseTensor`](../../api_docs/python/sparse_ops.md#SparseTensor), the value should be a - [`SparseTensorValue`](sparse_ops.md#SparseTensorValue). + [`SparseTensorValue`](../../api_docs/python/sparse_ops.md#SparseTensorValue). ##### Args: @@ -211,9 +212,9 @@ The graph that was launched in this session. Returns a context manager that makes this object the default session. Use with the `with` keyword to specify that calls to -[`Operation.run()`](framework.md#Operation.run) or -[`Tensor.run()`](framework.md#Tensor.run) should be executed in -this session. +[`Operation.run()`](../../api_docs/python/framework.md#Operation.run) or +[`Tensor.run()`](../../api_docs/python/framework.md#Tensor.run) should be +executed in this session. ```python 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` installs itself as the default session on construction. -The methods [`Tensor.eval()`](framework.md#Tensor.eval) and -[`Operation.run()`](framework.md#Operation.run) will use that session -to run ops. +The methods [`Tensor.eval()`](../../api_docs/python/framework.md#Tensor.eval) +and [`Operation.run()`](../../api_docs/python/framework.md#Operation.run) +will use that session to run ops. This is convenient in interactive shells and [IPython 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` 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 [`OpError.node_def`](#OpError.node_def) to discover information about the op. @@ -423,11 +424,12 @@ The error message that describes the error. Raised when an operation or step is cancelled. For example, a long-running operation (e.g. -[`queue.enqueue()`](io_ops.md#QueueBase.enqueue) may be cancelled by -running another operation (e.g. -[`queue.close(cancel_pending_enqueues=True)`](io_ops.md#QueueBase.close), -or by [closing the session](client.md#Session.close). A step that is -running such a long-running operation will fail by raising `CancelledError`. +[`queue.enqueue()`](../../api_docs/python/io_ops.md#QueueBase.enqueue) may be +cancelled by running another operation (e.g. +[`queue.close(cancel_pending_enqueues=True)`](../../api_docs/python/io_ops.md#QueueBase.close), +or by [closing the session](../../api_docs/python/client.md#Session.close). +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 tensor that has an invalid value or shape. For example, the -[`tf.matmul()`](math_ops.md#matmul) op will raise this 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 -the new shape does not match the number of elements in the input +[`tf.matmul()`](../../api_docs/python/math_ops.md#matmul) op will raise this +error if it receives an input that is not a matrix, and the +[`tf.reshape()`](../../api_docs/python/array_ops.md#reshape) op will raise +this error if the new shape does not match the number of elements in the input tensor. - - - @@ -502,8 +504,8 @@ Creates a `DeadlineExceededError`. Raised when a requested entity (e.g., a file or directory) was not found. For example, running the -[`tf.WholeFileReader.read()`](io_ops.md#WholeFileReader) operation -could raise `NotFoundError` if it receives the name of a file that +[`tf.WholeFileReader.read()`](../../api_docs/python/io_ops.md#WholeFileReader) +operation could raise `NotFoundError` if it receives the name of a file that does not exist. - - - @@ -521,8 +523,8 @@ Creates a `NotFoundError`. Raised when an entity that we attempted to create already exists. For example, running an operation that saves a file -(e.g. [`tf.train.Saver.save()`](train.md#Saver.save)) could -potentially raise this exception if an explicit filename for an +(e.g. [`tf.train.Saver.save()`](../../api_docs/python/train.md#Saver.save)) +could potentially raise this exception if an explicit filename for an existing file was passed. - - - @@ -540,8 +542,8 @@ Creates an `AlreadyExistsError`. Raised when the caller does not have permission to run an operation. For example, running the -[`tf.WholeFileReader.read()`](io_ops.md#WholeFileReader) operation -could raise `PermissionDeniedError` if it receives the name of a +[`tf.WholeFileReader.read()`](../../api_docs/python/io_ops.md#WholeFileReader) +operation could raise `PermissionDeniedError` if it receives the name of a 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. This exception is most commonly raised when running an operation -that reads a [`tf.Variable`](state_ops.md#Variable) before it has -been initialized. +that reads a [`tf.Variable`](../../api_docs/python/state_ops.md#Variable) +before it has been initialized. - - - @@ -609,9 +611,11 @@ Creates a `FailedPreconditionError`. 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 -[`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. This exception is raised in "end-of-file" conditions, such as when a -[`queue.dequeue()`](io_ops.md#QueueBase.dequeue) operation is -blocked on an empty queue, and a -[`queue.close()`](io_ops.md#QueueBase.close) operation executes. +[`queue.dequeue()`](../../api_docs/python/io_ops.md#QueueBase.dequeue) +operation is blocked on an empty queue, and a +[`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 arguments that it does not currently support. For example, running -the [`tf.nn.max_pool()`](nn.md#max_pool) operation would raise this -error if pooling was requested on the batch dimension, because this -is not yet supported. +the [`tf.nn.max_pool()`](../../api_docs/python/nn.md#max_pool) operation +would raise this error if pooling was requested on the batch dimension, +because this is not yet supported. - - - @@ -700,8 +705,8 @@ Creates an `UnavailableError`. Raised when unrecoverable data loss or corruption is encountered. For example, this may be raised by running a -[`tf.WholeFileReader.read()`](io_ops.md#WholeFileReader) operation, -if the file is truncated while it is being read. +[`tf.WholeFileReader.read()`](../../api_docs/python/io_ops.md#WholeFileReader) +operation, if the file is truncated while it is being read. - - - diff --git a/tensorflow/g3doc/api_docs/python/constant_op.md b/tensorflow/g3doc/api_docs/python/constant_op.md index 59053a576e7..da0657353d1 100644 --- a/tensorflow/g3doc/api_docs/python/constant_op.md +++ b/tensorflow/g3doc/api_docs/python/constant_op.md @@ -2,8 +2,8 @@ # Constants, Sequences, and Random Values -Note: Functions taking `Tensor` arguments can also take anything -accepted by [`tf.convert_to_tensor`](framework.md#convert_to_tensor). +Note: Functions taking `Tensor` arguments can also take anything accepted by +[`tf.convert_to_tensor`](../../api_docs/python/framework.md#convert_to_tensor). ## Contents @@ -313,11 +313,13 @@ time they are evaluated. The `seed` keyword argument in these functions acts in conjunction with 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 -will change the underlying seed of these operations. Setting neither graph-level -nor op-level seed, results in a random seed for all operations. -See [`set_random_seed`](constant_op.md#set_random_seed) for details on the -interaction between operation-level and graph-level random seeds. +[`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed) or the +op-level seed will change the underlying seed of these operations. Setting +neither graph-level nor op-level seed, results in a random seed for all +operations. +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: @@ -373,7 +375,9 @@ Outputs random values from a normal distribution. of the normal distribution. * dtype: The type of the output. * 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). ##### Returns: @@ -401,7 +405,9 @@ deviations from the mean are dropped and re-picked. of the truncated normal distribution. * dtype: The type of the output. * 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). ##### Returns: @@ -429,7 +435,9 @@ the upper bound `maxval` is excluded. the range of random values to generate. * dtype: The type of the output. * 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). ##### Returns: @@ -458,7 +466,9 @@ to one and only one `output[i]`. For example, a mapping that might occur for a * value: A Tensor to be shuffled. * 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). ##### Returns: diff --git a/tensorflow/g3doc/api_docs/python/control_flow_ops.md b/tensorflow/g3doc/api_docs/python/control_flow_ops.md index eda97dc2223..27f104b359d 100644 --- a/tensorflow/g3doc/api_docs/python/control_flow_ops.md +++ b/tensorflow/g3doc/api_docs/python/control_flow_ops.md @@ -2,8 +2,8 @@ # Control Flow -Note: Functions taking `Tensor` arguments can also take anything -accepted by [`tf.convert_to_tensor`](framework.md#convert_to_tensor). +Note: Functions taking `Tensor` arguments can also take anything accepted by +[`tf.convert_to_tensor`](../../api_docs/python/framework.md#convert_to_tensor). ## Contents diff --git a/tensorflow/g3doc/api_docs/python/framework.md b/tensorflow/g3doc/api_docs/python/framework.md index 1900af97a28..6134745482e 100644 --- a/tensorflow/g3doc/api_docs/python/framework.md +++ b/tensorflow/g3doc/api_docs/python/framework.md @@ -44,14 +44,16 @@ Classes and functions for building TensorFlow graphs. A TensorFlow computation, represented as a dataflow graph. -A `Graph` contains a set of [`Operation`](framework.md#Operation) objects, -which represent units of computation; and [`Tensor`](framework.md#Tensor) -objects, which represent the units of data that flow between operations. +A `Graph` contains a set of +[`Operation`](../../api_docs/python/framework.md#Operation) objects, +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 -[`tf.get_default_graph()`](framework.md#get_default_graph). To add an -operation to the default graph, simply call one of the functions that defines -a new `Operation`: +[`tf.get_default_graph()`](../../api_docs/python/framework.md#get_default_graph). +To add an operation to the default graph, simply call one of the functions +that defines a new `Operation`: ``` c = tf.constant(4.0) @@ -59,7 +61,7 @@ assert c.graph is tf.get_default_graph() ``` 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 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` (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. @@ -155,7 +157,7 @@ Finalizes this graph, making it read-only. After calling `g.finalize()`, no new operations can be added to `g`. This method is used to ensure that no operations are added 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 graph, collections can store groups of related objects: for example, the `tf.Variable` uses a collection (named -[`tf.GraphKeys.VARIABLES`](framework.md#GraphKeys)) for all variables that are -created during the construction of a graph. The caller may define -additional collections by specifying a new name. +[`tf.GraphKeys.VARIABLES`](../../api_docs/python/framework.md#GraphKeys)) for +all variables that are created during the construction of a graph. The caller +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 more `Tensor` objects as input, and produces zero or more `Tensor` objects as output. Objects of type `Operation` are created by -calling a Python op constructor (such as [`tf.matmul()`](math_ops.md#matmul)) -or [`Graph.create_op()`](framework.md#Graph.create_op). +calling a Python op constructor (such as +[`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 "MatMul" that takes tensors `a` and `b` as input, and produces `c` as output. 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)`. - - - @@ -748,8 +752,8 @@ available, or `session` must be specified explicitly. * feed_dict: A dictionary that maps `Tensor` objects to feed values. - See [`Session.run()`](client.md#Session.run) for a description of the - valid feed values. + See [`Session.run()`](../../api_docs/python/client.md#Session.run) + for a description of the valid feed values. * session: (Optional.) The `Session` to be used to run to this operation. If 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 `Operation`. It does not hold the values of that operation's output, 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: @@ -883,7 +887,7 @@ This class has two primary purposes: 2. After the graph has been launched in a session, the value of the `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 `tf.get_default_session().run(t)`. @@ -964,8 +968,8 @@ available, or `session` must be specified explicitly. * feed_dict: A dictionary that maps `Tensor` objects to feed values. - See [`Session.run()`](client.md#Session.run) for a description of - the valid feed values. + See [`Session.run()`](../../api_docs/python/client.md#Session.run) for a + description of the valid feed values. * session: (Optional.) The `Session` to be used to evaluate this tensor. If 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 registered for each `Operation` type using `tf.RegisterShape`. -See [`TensorShape`](framework.md#TensorShape) for more details of what a shape -represents. +See [`TensorShape`](../../api_docs/python/framework.md#TensorShape) for more +details of what a shape represents. The inferred shape of a tensor is used to provide shape 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. -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: @@ -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. -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: @@ -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. -See [`Graph.control_dependencies()`](framework.md#Graph.control_dependencies) +See [`Graph.control_dependencies()`](../../api_docs/python/framework.md#Graph.control_dependencies) for more details. ##### Args: @@ -1458,7 +1466,7 @@ protocol buffer, and extract individual objects in the `GraphDef` as 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. ##### Args: @@ -1475,7 +1483,7 @@ for more details. 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. ##### Args: @@ -1511,17 +1519,20 @@ The following standard keys are defined: * `VARIABLES`: the `Variable` objects that comprise a model, and 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 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. -* `SUMMARIES`: the summary `Tensor` objects that have been created - in the graph. See [`tf.merge_all_summaries()`](train.md#merge_all_summaries) +* `SUMMARIES`: the summary `Tensor` objects that have been created in the + graph. See + [`tf.merge_all_summaries()`](../../api_docs/python/train.md#merge_all_summaries) for more details. * `QUEUE_RUNNERS`: the `QueueRunner` objects that are used to 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 @@ -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 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 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. 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: diff --git a/tensorflow/g3doc/api_docs/python/image.md b/tensorflow/g3doc/api_docs/python/image.md index c631af9c97d..82c2a913c1b 100644 --- a/tensorflow/g3doc/api_docs/python/image.md +++ b/tensorflow/g3doc/api_docs/python/image.md @@ -2,8 +2,8 @@ # Images -Note: Functions taking `Tensor` arguments can also take anything -accepted by [`tf.convert_to_tensor`](framework.md#convert_to_tensor). +Note: Functions taking `Tensor` arguments can also take anything accepted by +[`tf.convert_to_tensor`](../../api_docs/python/framework.md#convert_to_tensor). ## Contents @@ -497,8 +497,9 @@ fully contains the result. * image: 3-D tensor of shape `[height, width, channels]` * size: 1-D tensor with two elements, specifying target `[height, width]` -* seed: A Python integer. Used to create a random seed. - See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. +* seed: A Python integer. Used to create a random seed. See + [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed) + for behavior. * name: A name for this operation (optional). ##### Returns: @@ -601,8 +602,9 @@ dimension, which is `height`. Otherwise output the image as-is. * image: A 3-D tensor of shape `[height, width, channels].` -* seed: A Python integer. Used to create a random seed. - See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. +* seed: A Python integer. Used to create a random seed. See + [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed) + for behavior. ##### Returns: @@ -654,8 +656,9 @@ second dimension, which is `width`. Otherwise output the image as-is. * image: A 3-D tensor of shape `[height, width, channels].` -* seed: A Python integer. Used to create a random seed. - See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. +* seed: A Python integer. Used to create a random seed. See + [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed) + for behavior. ##### Returns: @@ -744,8 +747,9 @@ have modifications in the range `[-max_delta,max_delta]`. * image: 3-D tensor of shape `[height, width, channels]`. * max_delta: float, must be non-negative. -* seed: A Python integer. Used to create a random seed. - See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. +* seed: A Python integer. Used to create a random seed. See + [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed) + for behavior. ##### Returns: @@ -814,8 +818,9 @@ picked in the interval `[lower, upper]`. * image: 3-D tensor of shape `[height, width, channels]`. * lower: float. Lower 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. - See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. +* seed: A Python integer. Used to create a random seed. See + [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed) + for behavior. ##### Returns: diff --git a/tensorflow/g3doc/api_docs/python/io_ops.md b/tensorflow/g3doc/api_docs/python/io_ops.md index 3fbcf3634b2..de47ef615e3 100644 --- a/tensorflow/g3doc/api_docs/python/io_ops.md +++ b/tensorflow/g3doc/api_docs/python/io_ops.md @@ -2,8 +2,8 @@ # Inputs and Readers -Note: Functions taking `Tensor` arguments can also take anything -accepted by [`tf.convert_to_tensor`](framework.md#convert_to_tensor). +Note: Functions taking `Tensor` arguments can also take anything accepted by +[`tf.convert_to_tensor`](../../api_docs/python/framework.md#convert_to_tensor). ## Contents @@ -1591,8 +1591,9 @@ queue has been closed. the number of tensors in each queue element. * shapes: (Optional.) A list of fully-defined `TensorShape` objects, with the same length as `dtypes` or `None`. -* seed: A Python integer. Used to create a random seed. - See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. +* seed: A Python integer. Used to create a random seed. See + [`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 the given name across multiple sessions. * name: Optional name for the queue operation. diff --git a/tensorflow/g3doc/api_docs/python/math_ops.md b/tensorflow/g3doc/api_docs/python/math_ops.md index 42730255435..554433d868c 100644 --- a/tensorflow/g3doc/api_docs/python/math_ops.md +++ b/tensorflow/g3doc/api_docs/python/math_ops.md @@ -2,8 +2,8 @@ # Math -Note: Functions taking `Tensor` arguments can also take anything -accepted by [`tf.convert_to_tensor`](framework.md#convert_to_tensor). +Note: Functions taking `Tensor` arguments can also take anything accepted by +[`tf.convert_to_tensor`](../../api_docs/python/framework.md#convert_to_tensor). ## Contents @@ -1322,7 +1322,7 @@ tf.segment_sum(c, tf.constant([0, 0, 1])) 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. Computes a tensor such that @@ -1355,8 +1355,9 @@ that `segment_ids[j] == i`. Computes the product along segments of a tensor. -Read [the section on Segmentation](../python/math_ops.md#segmentation) -for an explanation of segments. +Read [the section on +Segmentation](../../api_docs/python/math_ops.md#segmentation) for an explanation +of segments. Computes a tensor such that \\(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. -Read [the section on Segmentation](../python/math_ops.md#segmentation) -for an explanation of segments. +Read [the section on +Segmentation](../../api_docs/python/math_ops.md#segmentation) for an explanation +of segments. Computes a tensor such that \\(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. -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. Computes a tensor such that @@ -1454,8 +1456,9 @@ that `segment_ids[j] == i`. Computes the mean along segments of a tensor. -Read [the section on Segmentation](../python/math_ops.md#segmentation) -for an explanation of segments. +Read [the section on +Segmentation](../../api_docs/python/math_ops.md#segmentation) for an explanation +of segments. Computes a tensor such that \\(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. -Read [the section on Segmentation](../python/math_ops.md#segmentation) -for an explanation of segments. +Read [the section on +Segmentation](../../api_docs/python/math_ops.md#segmentation) for an explanation +of segments. Computes a tensor such that \\(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. -Read [the section on Segmentation](../python/math_ops.md#segmentation) -for an explanation of segments. +Read [the section on +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 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. -Read [the section on Segmentation](../python/math_ops.md#segmentation) -for an explanation of segments. +Read [the section on +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 dimension, selecting a subset of dimension_0, specified by `indices`. diff --git a/tensorflow/g3doc/api_docs/python/nn.md b/tensorflow/g3doc/api_docs/python/nn.md index ada49a6b11f..91aa8ccc9b7 100644 --- a/tensorflow/g3doc/api_docs/python/nn.md +++ b/tensorflow/g3doc/api_docs/python/nn.md @@ -2,8 +2,8 @@ # Neural Network -Note: Functions taking `Tensor` arguments can also take anything -accepted by [`tf.convert_to_tensor`](framework.md#convert_to_tensor). +Note: Functions taking `Tensor` arguments can also take anything accepted by +[`tf.convert_to_tensor`](../../api_docs/python/framework.md#convert_to_tensor). ## Contents @@ -142,8 +142,9 @@ kept independently and each row and column will be kept or not kept together. * keep_prob: A Python float. The probability that each element is kept. * noise_shape: A 1-D `Tensor` of type `int32`, representing the shape for randomly generated keep/drop flags. -* seed: A Python integer. Used to create a random seed. - See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. +* seed: A Python integer. Used to create random seeds. See + [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed) + for behavior. * name: A name for this operation (optional). ##### Returns: @@ -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 tensors in `params`. It is a generalization of -[`tf.gather()`](array_ops.md#gather), where `params` is interpreted -as a partition of a larger embedding tensor. +[`tf.gather()`](../../api_docs/python/array_ops.md#gather), where `params` is +interpreted as a partition of a larger embedding tensor. If `len(params) > 1`, each element `id` of `ids` is partitioned between the elements of `params` by computing `p = id % len(params)`, and is diff --git a/tensorflow/g3doc/api_docs/python/sparse_ops.md b/tensorflow/g3doc/api_docs/python/sparse_ops.md index 7d338f2efbf..a77131d5820 100644 --- a/tensorflow/g3doc/api_docs/python/sparse_ops.md +++ b/tensorflow/g3doc/api_docs/python/sparse_ops.md @@ -2,8 +2,8 @@ # Sparse Tensors -Note: Functions taking `Tensor` arguments can also take anything -accepted by [`tf.convert_to_tensor`](framework.md#convert_to_tensor). +Note: Functions taking `Tensor` arguments can also take anything accepted by +[`tf.convert_to_tensor`](../../api_docs/python/framework.md#convert_to_tensor). ## Contents diff --git a/tensorflow/g3doc/api_docs/python/state_ops.md b/tensorflow/g3doc/api_docs/python/state_ops.md index 2c6ca5e7aa4..09f951c0746 100644 --- a/tensorflow/g3doc/api_docs/python/state_ops.md +++ b/tensorflow/g3doc/api_docs/python/state_ops.md @@ -2,8 +2,8 @@ # Variables -Note: Functions taking `Tensor` arguments can also take anything -accepted by [`tf.convert_to_tensor`](framework.md#convert_to_tensor). +Note: Functions taking `Tensor` arguments can also take anything accepted by +[`tf.convert_to_tensor`](../../api_docs/python/framework.md#convert_to_tensor). ## 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 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. ```python @@ -1008,8 +1008,9 @@ Returns an initializer that generates Tensors with a normal distribution. to generate. * stddev: a python scalar or a scalar tensor. Standard deviation of the random values to generate. -* seed: A Python integer. Used to create random seeds. - See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. +* seed: A Python integer. Used to create random seeds. See + [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed) + for behavior. ##### Returns: @@ -1034,8 +1035,9 @@ neural network weights and filters. to generate. * stddev: a python scalar or a scalar tensor. Standard deviation of the random values to generate. -* seed: A Python integer. Used to create random seeds. - See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. +* seed: A Python integer. Used to create random seeds. See + [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed) + for behavior. ##### Returns: @@ -1056,8 +1058,9 @@ Returns an initializer that generates Tensors with a uniform distribution. of random values to generate. * maxval: a python scalar or a scalar tensor. upper bound of the range of random values to generate. -* seed: A Python integer. Used to create random seeds. - See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. +* seed: A Python integer. Used to create random seeds. See + [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed) + for behavior. ##### Returns: @@ -1089,8 +1092,9 @@ numerically computed: for a linear layer it's 1.0, relu: ~1.43, tanh: ~1.15. * factor: Float. A multiplicative factor by which the values will be scaled. -* seed: A Python integer. Used to create random seeds. - See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. +* seed: A Python integer. Used to create random seeds. See + [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed) + for behavior. ##### Returns: @@ -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. 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 of sparse indices and values. `IndexedSlices` objects are detected and handled 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 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 -[`SparseTensor`](sparse_ops.md#SparseTensor), +[`SparseTensor`](../../api_docs/python/sparse_ops.md#SparseTensor), which uses multi-dimensional indices and scalar values. - - - diff --git a/tensorflow/g3doc/api_docs/python/train.md b/tensorflow/g3doc/api_docs/python/train.md index c0199a020e4..2c1cc57ac7d 100644 --- a/tensorflow/g3doc/api_docs/python/train.md +++ b/tensorflow/g3doc/api_docs/python/train.md @@ -950,8 +950,8 @@ There are two ways to use the moving averages for evaluations: for a given variable. * 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 [Saver class](train.md#Saver) for more information on restoring saved - variables. + the [Saver class](../../api_docs/python/train.md#Saver) for more + information on restoring saved variables. Example of restoring the shadow variable values: @@ -1407,8 +1407,8 @@ The following ops output protocol buffers as serialized string tensors. 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 -file. Event files contain +a [SummaryWriter](../../api_docs/python/train.md#SummaryWriter) to append it +to an event file. Event files contain [`Event`](https://tensorflow.googlesource.com/tensorflow/+/master/tensorflow/core/util/event.proto) protos that can contain `Summary` protos along with the timestamp and step. You can then use TensorBoard to visualize the contents of the diff --git a/tensorflow/g3doc/how_tos/summaries_and_tensorboard/index.md b/tensorflow/g3doc/how_tos/summaries_and_tensorboard/index.md index 75a23d10956..f7c87284af8 100644 --- a/tensorflow/g3doc/how_tos/summaries_and_tensorboard/index.md +++ b/tensorflow/g3doc/how_tos/summaries_and_tensorboard/index.md @@ -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 TensorBoard is fully configured, it looks like this: -![MNIST TensorBoard](./mnist_tensorboard.png "MNIST TensorBoard") If you're on -desktop Chrome or Firefox, try playing around with [this live -TensorBoard](/tensorboard/cifar.html). - +![MNIST TensorBoard](./mnist_tensorboard.png "MNIST TensorBoard") ## Serializing the data diff --git a/tensorflow/g3doc/tutorials/deep_cnn/index.md b/tensorflow/g3doc/tutorials/deep_cnn/index.md index 44ffe879b8f..26b2906e0ad 100644 --- a/tensorflow/g3doc/tutorials/deep_cnn/index.md +++ b/tensorflow/g3doc/tutorials/deep_cnn/index.md @@ -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): ![CIFAR-10 Loss](./cifar_loss.png "CIFAR-10 Total Loss") -###### [View this TensorBoard live! (Chrome/FF)](/tensorboard/cifar.html) We train the model using standard [gradient descent](https://en.wikipedia.org/wiki/Gradient_descent) @@ -209,7 +208,6 @@ with a learning rate that over time. ![CIFAR-10 Learning Rate Decay](./cifar_lr_decay.png "CIFAR-10 Learning Rate Decay") -###### [View this TensorBoard live! (Chrome/FF)](/tensorboard/cifar.html) The `train()` function adds the operations needed to minimize the objective by 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. Fork the CIFAR-10 tutorial and swap in the SVHN as the input data. Try adapting the network architecture to improve predictive performance. - - - diff --git a/tensorflow/python/client/session.py b/tensorflow/python/client/session.py index 571030de67c..0ac7f52df96 100644 --- a/tensorflow/python/client/session.py +++ b/tensorflow/python/client/session.py @@ -132,9 +132,9 @@ class BaseSession(SessionInterface): """Returns a context manager that makes this object the default session. Use with the `with` keyword to specify that calls to - [`Operation.run()`](framework.md#Operation.run) or - [`Tensor.run()`](framework.md#Tensor.run) should be executed in - this session. + [`Operation.run()`](../../api_docs/python/framework.md#Operation.run) or + [`Tensor.run()`](../../api_docs/python/framework.md#Tensor.run) should be + executed in this session. ```python c = tf.constant(..) @@ -219,30 +219,31 @@ class BaseSession(SessionInterface): method. A graph element can be one of the following types: * If the *i*th element of `fetches` is an - [`Operation`](framework.md#Operation), the *i*th return value - will be `None`. + [`Operation`](../../api_docs/python/framework.md#Operation), the *i*th + return value will be `None`. * If the *i*th element of `fetches` is a - [`Tensor`](framework.md#Tensor), the *i*th return value will - be a numpy ndarray containing the value of that tensor. + [`Tensor`](../../api_docs/python/framework.md#Tensor), the *i*th return + value will be a numpy ndarray containing the value of that tensor. * If the *i*th element of `fetches` is a - [`SparseTensor`](sparse_ops.md#SparseTensor), the *i*th - return value will be a - [`SparseTensorValue`](sparse_ops.md#SparseTensorValue) + [`SparseTensor`](../../api_docs/python/sparse_ops.md#SparseTensor), + the *i*th return value will be a + [`SparseTensorValue`](../../api_docs/python/sparse_ops.md#SparseTensorValue) containing the value of that sparse tensor. The optional `feed_dict` argument allows the caller to override the value of tensors in the graph. Each key in `feed_dict` can be 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 that can be converted to the same `dtype` as that tensor. Additionally, if the key is a - [placeholder](io_ops.md#placeholder), the shape of the value - will be checked for compatibility with the placeholder. - * If the key is a [`SparseTensor`](sparse_ops.md#SparseTensor), + [placeholder](../../api_docs/python/io_ops.md#placeholder), the shape of + the value will be checked for compatibility with the placeholder. + * If the key is a + [`SparseTensor`](../../api_docs/python/sparse_ops.md#SparseTensor), the value should be a - [`SparseTensorValue`](sparse_ops.md#SparseTensorValue). + [`SparseTensorValue`](../../api_docs/python/sparse_ops.md#SparseTensorValue). Args: 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 - [variables](state_ops.md#Variable), [queues](io_ops.md#QueueBase), - and [readers](io_ops.md#ReaderBase). It is important to release + [variables](../../api_docs/python/state_ops.md#Variable), [queues](../../api_docs/python/io_ops.md#QueueBase), + 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 invoke the [`close()`](#Session.close) method on the session, or use 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` installs itself as the default session on construction. - The methods [`Tensor.eval()`](framework.md#Tensor.eval) and - [`Operation.run()`](framework.md#Operation.run) will use that session - to run ops. + The methods [`Tensor.eval()`](../../api_docs/python/framework.md#Tensor.eval) + and [`Operation.run()`](../../api_docs/python/framework.md#Operation.run) + will use that session to run ops. This is convenient in interactive shells and [IPython notebooks](http://ipython.org), as it avoids having to pass an explicit diff --git a/tensorflow/python/framework/errors.py b/tensorflow/python/framework/errors.py index b3f9a78a0fe..948057b8aa4 100644 --- a/tensorflow/python/framework/errors.py +++ b/tensorflow/python/framework/errors.py @@ -41,7 +41,7 @@ class OpError(Exception): *N.B.* If the failed op was synthesized at runtime, e.g. a `Send` 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 [`OpError.node_def`](#OpError.node_def) to discover information about the op. @@ -129,11 +129,12 @@ class CancelledError(OpError): """Raised when an operation or step is cancelled. For example, a long-running operation (e.g. - [`queue.enqueue()`](io_ops.md#QueueBase.enqueue) may be cancelled by - running another operation (e.g. - [`queue.close(cancel_pending_enqueues=True)`](io_ops.md#QueueBase.close), - or by [closing the session](client.md#Session.close). A step that is - running such a long-running operation will fail by raising `CancelledError`. + [`queue.enqueue()`](../../api_docs/python/io_ops.md#QueueBase.enqueue) may be + cancelled by running another operation (e.g. + [`queue.close(cancel_pending_enqueues=True)`](../../api_docs/python/io_ops.md#QueueBase.close), + or by [closing the session](../../api_docs/python/client.md#Session.close). + A step that is running such a long-running operation will fail by raising + `CancelledError`. @@__init__ """ @@ -165,10 +166,10 @@ class InvalidArgumentError(OpError): This may occur, for example, if an operation is receives an input tensor that has an invalid value or shape. For example, the - [`tf.matmul()`](math_ops.md#matmul) op will raise this 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 - the new shape does not match the number of elements in the input + [`tf.matmul()`](../../api_docs/python/math_ops.md#matmul) op will raise this + error if it receives an input that is not a matrix, and the + [`tf.reshape()`](../../api_docs/python/array_ops.md#reshape) op will raise + this error if the new shape does not match the number of elements in the input tensor. @@__init__ @@ -198,8 +199,8 @@ class NotFoundError(OpError): """Raised when a requested entity (e.g., a file or directory) was not found. For example, running the - [`tf.WholeFileReader.read()`](io_ops.md#WholeFileReader) operation - could raise `NotFoundError` if it receives the name of a file that + [`tf.WholeFileReader.read()`](../../api_docs/python/io_ops.md#WholeFileReader) + operation could raise `NotFoundError` if it receives the name of a file that does not exist. @@__init__ @@ -214,8 +215,8 @@ class AlreadyExistsError(OpError): """Raised when an entity that we attempted to create already exists. For example, running an operation that saves a file - (e.g. [`tf.train.Saver.save()`](train.md#Saver.save)) could - potentially raise this exception if an explicit filename for an + (e.g. [`tf.train.Saver.save()`](../../api_docs/python/train.md#Saver.save)) + could potentially raise this exception if an explicit filename for an existing file was passed. @@__init__ @@ -231,8 +232,8 @@ class PermissionDeniedError(OpError): """Raised when the caller does not have permission to run an operation. For example, running the - [`tf.WholeFileReader.read()`](io_ops.md#WholeFileReader) operation - could raise `PermissionDeniedError` if it receives the name of a + [`tf.WholeFileReader.read()`](../../api_docs/python/io_ops.md#WholeFileReader) + operation could raise `PermissionDeniedError` if it receives the name of a file for which the user does not have the read file permission. @@__init__ @@ -277,8 +278,8 @@ class FailedPreconditionError(OpError): """Operation was rejected because the system is not in a state to execute it. This exception is most commonly raised when running an operation - that reads a [`tf.Variable`](state_ops.md#Variable) before it has - been initialized. + that reads a [`tf.Variable`](../../api_docs/python/state_ops.md#Variable) + before it has been initialized. @@__init__ """ @@ -292,9 +293,11 @@ class FailedPreconditionError(OpError): class AbortedError(OpError): """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 - [`queue.close()`](io_ops.md#QueueBase.close) operation previously ran. + [`queue.close()`](../../api_docs/python/io_ops.md#QueueBase.close) operation + previously ran. @@__init__ """ @@ -308,9 +311,10 @@ class OutOfRangeError(OpError): """Raised when an operation executed past the valid range. This exception is raised in "end-of-file" conditions, such as when a - [`queue.dequeue()`](io_ops.md#QueueBase.dequeue) operation is - blocked on an empty queue, and a - [`queue.close()`](io_ops.md#QueueBase.close) operation executes. + [`queue.dequeue()`](../../api_docs/python/io_ops.md#QueueBase.dequeue) + operation is blocked on an empty queue, and a + [`queue.close()`](../../api_docs/python/io_ops.md#QueueBase.close) + operation executes. @@__init__ """ @@ -326,9 +330,9 @@ class UnimplementedError(OpError): Some operations may raise this error when passed otherwise-valid arguments that it does not currently support. For example, running - the [`tf.nn.max_pool()`](nn.md#max_pool) operation would raise this - error if pooling was requested on the batch dimension, because this - is not yet supported. + the [`tf.nn.max_pool()`](../../api_docs/python/nn.md#max_pool) operation + would raise this error if pooling was requested on the batch dimension, + because this is not yet supported. @@__init__ """ @@ -371,8 +375,8 @@ class DataLossError(OpError): """Raised when unrecoverable data loss or corruption is encountered. For example, this may be raised by running a - [`tf.WholeFileReader.read()`](io_ops.md#WholeFileReader) operation, - if the file is truncated while it is being read. + [`tf.WholeFileReader.read()`](../../api_docs/python/io_ops.md#WholeFileReader) + operation, if the file is truncated while it is being read. @@__init__ """ diff --git a/tensorflow/python/framework/gen_docs_combined.py b/tensorflow/python/framework/gen_docs_combined.py index ed9c2e24a87..873e48d85d4 100644 --- a/tensorflow/python/framework/gen_docs_combined.py +++ b/tensorflow/python/framework/gen_docs_combined.py @@ -18,9 +18,11 @@ tf.flags.DEFINE_boolean("print_hidden_regex", False, FLAGS = tf.flags.FLAGS +# TODO(josh11b,wicke): Remove the ../../api_docs/python/ once the +# website can handle it. PREFIX_TEXT = """ -Note: Functions taking `Tensor` arguments can also take anything -accepted by [`tf.convert_to_tensor`](framework.md#convert_to_tensor). +Note: Functions taking `Tensor` arguments can also take anything accepted by +[`tf.convert_to_tensor`](../../api_docs/python/framework.md#convert_to_tensor). """ diff --git a/tensorflow/python/framework/ops.py b/tensorflow/python/framework/ops.py index d5e6e3bcd99..024cd69b60c 100644 --- a/tensorflow/python/framework/ops.py +++ b/tensorflow/python/framework/ops.py @@ -79,7 +79,7 @@ class Tensor(object): 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, 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: @@ -90,7 +90,7 @@ class Tensor(object): 2. After the graph has been launched in a session, the value of the `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 `tf.get_default_session().run(t)`. @@ -204,8 +204,8 @@ class Tensor(object): The shape is computed using shape inference functions that are registered for each `Operation` type using `tf.RegisterShape`. - See [`TensorShape`](framework.md#TensorShape) for more details of what a shape - represents. + See [`TensorShape`](../../api_docs/python/framework.md#TensorShape) for more + details of what a shape represents. The inferred shape of a tensor is used to provide shape information without having to launch the graph in a session. This @@ -393,8 +393,8 @@ class Tensor(object): Args: feed_dict: A dictionary that maps `Tensor` objects to feed values. - See [`Session.run()`](client.md#Session.run) for a description of - the valid feed values. + See [`Session.run()`](../../api_docs/python/client.md#Session.run) for a + description of the valid feed values. session: (Optional.) The `Session` to be used to evaluate this tensor. If none, the default session will be used. @@ -614,10 +614,10 @@ class IndexedSlices(object): The `IndexedSlices` class is used principally in the definition of 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 - [`SparseTensor`](sparse_ops.md#SparseTensor), + [`SparseTensor`](../../api_docs/python/sparse_ops.md#SparseTensor), which uses multi-dimensional indices and scalar values. @@__init__ @@ -869,15 +869,17 @@ class Operation(object): An `Operation` is a node in a TensorFlow `Graph` that takes zero or more `Tensor` objects as input, and produces zero or more `Tensor` objects as output. Objects of type `Operation` are created by - calling a Python op constructor (such as [`tf.matmul()`](math_ops.md#matmul)) - or [`Graph.create_op()`](framework.md#Graph.create_op). + calling a Python op constructor (such as + [`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 "MatMul" that takes tensors `a` and `b` as input, and produces `c` as output. 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)`. @@name @@ -1257,8 +1259,8 @@ class Operation(object): Args: feed_dict: A dictionary that maps `Tensor` objects to feed values. - See [`Session.run()`](client.md#Session.run) for a description of the - valid feed values. + See [`Session.run()`](../../api_docs/python/client.md#Session.run) + for a description of the valid feed values. session: (Optional.) The `Session` to be used to run to this operation. If none, the default session will be used. """ @@ -1424,14 +1426,16 @@ def set_shapes_for_outputs(op): class Graph(object): """A TensorFlow computation, represented as a dataflow graph. - A `Graph` contains a set of [`Operation`](framework.md#Operation) objects, - which represent units of computation; and [`Tensor`](framework.md#Tensor) - objects, which represent the units of data that flow between operations. + A `Graph` contains a set of + [`Operation`](../../api_docs/python/framework.md#Operation) objects, + 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 - [`tf.get_default_graph()`](framework.md#get_default_graph). To add an - operation to the default graph, simply call one of the functions that defines - a new `Operation`: + [`tf.get_default_graph()`](../../api_docs/python/framework.md#get_default_graph). + To add an operation to the default graph, simply call one of the functions + that defines a new `Operation`: ``` c = tf.constant(4.0) @@ -1439,7 +1443,7 @@ class Graph(object): ``` 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 lifetime of the context: @@ -1470,9 +1474,9 @@ class Graph(object): that are identified by name. For convenience when building a large graph, collections can store groups of related objects: for example, the `tf.Variable` uses a collection (named - [`tf.GraphKeys.VARIABLES`](framework.md#GraphKeys)) for all variables that are - created during the construction of a graph. The caller may define - additional collections by specifying a new name. + [`tf.GraphKeys.VARIABLES`](../../api_docs/python/framework.md#GraphKeys)) for + all variables that are created during the construction of a graph. The caller + may define additional collections by specifying a new name. @@add_to_collection @@get_collection @@ -1581,7 +1585,7 @@ class Graph(object): After calling `g.finalize()`, no new operations can be added to `g`. This method is used to ensure that no operations are added 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 @@ -1606,7 +1610,7 @@ class Graph(object): The serialized `GraphDef` can be imported into another `Graph` (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. @@ -2532,7 +2536,9 @@ class Graph(object): def device(dev): """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: device_name_or_function: The device name or function to use in @@ -2548,7 +2554,9 @@ def device(dev): def name_scope(name): """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: name: A name for the scope. @@ -2563,7 +2571,7 @@ def name_scope(name): def control_dependencies(control_inputs): """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. Args: @@ -2890,17 +2898,20 @@ class GraphKeys(object): * `VARIABLES`: the `Variable` objects that comprise a model, and 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 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. - * `SUMMARIES`: the summary `Tensor` objects that have been created - in the graph. See [`tf.merge_all_summaries()`](train.md#merge_all_summaries) + * `SUMMARIES`: the summary `Tensor` objects that have been created in the + graph. See + [`tf.merge_all_summaries()`](../../api_docs/python/train.md#merge_all_summaries) for more details. * `QUEUE_RUNNERS`: the `QueueRunner` objects that are used to 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 @@ -2920,7 +2931,7 @@ class GraphKeys(object): def add_to_collection(name, value): """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. Args: @@ -2934,7 +2945,7 @@ def add_to_collection(name, value): def get_collection(key, scope=None): """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. Args: diff --git a/tensorflow/python/framework/random_seed.py b/tensorflow/python/framework/random_seed.py index d0ffee70424..11a49195c24 100644 --- a/tensorflow/python/framework/random_seed.py +++ b/tensorflow/python/framework/random_seed.py @@ -16,7 +16,7 @@ def get_seed(op_seed): graph, or for only specific operations. 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: op_seed: integer. diff --git a/tensorflow/python/framework/tensor_shape.py b/tensorflow/python/framework/tensor_shape.py index d4f27696d42..1fef77e479c 100644 --- a/tensorflow/python/framework/tensor_shape.py +++ b/tensorflow/python/framework/tensor_shape.py @@ -334,10 +334,10 @@ class TensorShape(object): If a tensor is produced by an operation of type `"Foo"`, its shape 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 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 @@concatenate diff --git a/tensorflow/python/ops/constant_op.py b/tensorflow/python/ops/constant_op.py index 7d9044b6893..b1b1675455a 100644 --- a/tensorflow/python/ops/constant_op.py +++ b/tensorflow/python/ops/constant_op.py @@ -26,11 +26,13 @@ time they are evaluated. The `seed` keyword argument in these functions acts in conjunction with 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 -will change the underlying seed of these operations. Setting neither graph-level -nor op-level seed, results in a random seed for all operations. -See [`set_random_seed`](constant_op.md#set_random_seed) for details on the -interaction between operation-level and graph-level random seeds. +[`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed) or the +op-level seed will change the underlying seed of these operations. Setting +neither graph-level nor op-level seed, results in a random seed for all +operations. +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: diff --git a/tensorflow/python/ops/data_flow_ops.py b/tensorflow/python/ops/data_flow_ops.py index 5c8ab662971..1f299fd551e 100644 --- a/tensorflow/python/ops/data_flow_ops.py +++ b/tensorflow/python/ops/data_flow_ops.py @@ -337,8 +337,9 @@ class RandomShuffleQueue(QueueBase): the number of tensors in each queue element. shapes: (Optional.) A list of fully-defined `TensorShape` objects, with the same length as `dtypes` or `None`. - seed: A Python integer. Used to create a random seed. - See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. + seed: A Python integer. Used to create a random seed. See + [`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 the given name across multiple sessions. name: Optional name for the queue operation. diff --git a/tensorflow/python/ops/embedding_ops.py b/tensorflow/python/ops/embedding_ops.py index d9a377bab53..6c73e687d6f 100644 --- a/tensorflow/python/ops/embedding_ops.py +++ b/tensorflow/python/ops/embedding_ops.py @@ -12,8 +12,8 @@ def embedding_lookup(params, ids, name=None): This function is used to perform parallel lookups on the list of tensors in `params`. It is a generalization of - [`tf.gather()`](array_ops.md#gather), where `params` is interpreted - as a partition of a larger embedding tensor. + [`tf.gather()`](../../api_docs/python/array_ops.md#gather), where `params` is + interpreted as a partition of a larger embedding tensor. If `len(params) > 1`, each element `id` of `ids` is partitioned between the elements of `params` by computing `p = id % len(params)`, and is diff --git a/tensorflow/python/ops/image_ops.py b/tensorflow/python/ops/image_ops.py index 89f982141c6..189b72e0c74 100644 --- a/tensorflow/python/ops/image_ops.py +++ b/tensorflow/python/ops/image_ops.py @@ -172,8 +172,9 @@ def random_flip_up_down(image, seed=None): Args: image: A 3-D tensor of shape `[height, width, channels].` - seed: A Python integer. Used to create a random seed. - See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. + seed: A Python integer. Used to create a random seed. See + [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed) + for behavior. Returns: 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: image: A 3-D tensor of shape `[height, width, channels].` - seed: A Python integer. Used to create a random seed. - See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. + seed: A Python integer. Used to create a random seed. See + [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed) + for behavior. Returns: 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: image: 3-D tensor of shape `[height, width, channels]`. max_delta: float, must be non-negative. - seed: A Python integer. Used to create a random seed. - See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. + seed: A Python integer. Used to create a random seed. See + [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed) + for behavior. Returns: 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]`. lower: float. Lower 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. - See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. + seed: A Python integer. Used to create a random seed. See + [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed) + for behavior. Returns: 3-D tensor of shape `[height, width, channels]`. @@ -775,8 +779,9 @@ def random_crop(image, size, seed=None, name=None): Args: image: 3-D tensor of shape `[height, width, channels]` size: 1-D tensor with two elements, specifying target `[height, width]` - seed: A Python integer. Used to create a random seed. - See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. + seed: A Python integer. Used to create a random seed. See + [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed) + for behavior. name: A name for this operation (optional). Returns: diff --git a/tensorflow/python/ops/init_ops.py b/tensorflow/python/ops/init_ops.py index 09c8801e0ef..fe074d25561 100644 --- a/tensorflow/python/ops/init_ops.py +++ b/tensorflow/python/ops/init_ops.py @@ -32,8 +32,9 @@ def random_uniform_initializer(minval=0.0, maxval=1.0, seed=None): of random values to generate. maxval: a python scalar or a scalar tensor. upper bound of the range of random values to generate. - seed: A Python integer. Used to create random seeds. - See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. + seed: A Python integer. Used to create random seeds. See + [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed) + for behavior. Returns: 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. stddev: a python scalar or a scalar tensor. Standard deviation of the random values to generate. - seed: A Python integer. Used to create random seeds. - See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. + seed: A Python integer. Used to create random seeds. See + [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed) + for behavior. Returns: 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. stddev: a python scalar or a scalar tensor. Standard deviation of the random values to generate. - seed: A Python integer. Used to create random seeds. - See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. + seed: A Python integer. Used to create random seeds. See + [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed) + for behavior. Returns: An initializer that generates Tensors with a truncated normal @@ -104,8 +107,9 @@ def uniform_unit_scaling_initializer(factor=1.0, seed=None): Args: factor: Float. A multiplicative factor by which the values will be scaled. - seed: A Python integer. Used to create random seeds. - See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. + seed: A Python integer. Used to create random seeds. See + [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed) + for behavior. Returns: 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 in tensor flow. dtype: The type of the output. - seed: A Python integer. Used to create random seeds. - See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. + seed: A Python integer. Used to create random seeds. See + [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed) + for behavior. name: string. Optional name for the op. Returns: @@ -169,8 +174,9 @@ class _RandomWalkInitializer(object): Args: nonlinearity: the python tensorflow function that computes a nonlinearity in the graph, typically after a Wx+b type operation. - seed: A Python integer. Used to create random seeds. - See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. + seed: A Python integer. Used to create random seeds. See + [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed) + for behavior. """ self._nonlinearity = nonlinearity self._seed = seed diff --git a/tensorflow/python/ops/nn.py b/tensorflow/python/ops/nn.py index 004ceb51c6e..1ad08ca4c9a 100644 --- a/tensorflow/python/ops/nn.py +++ b/tensorflow/python/ops/nn.py @@ -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. noise_shape: A 1-D `Tensor` of type `int32`, representing the shape for randomly generated keep/drop flags. - seed: A Python integer. Used to create a random seed. - See [`set_random_seed`](constant_op.md#set_random_seed) for behavior. + seed: A Python integer. Used to create random seeds. See + [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed) + for behavior. name: A name for this operation (optional). Returns: diff --git a/tensorflow/python/ops/random_ops.py b/tensorflow/python/ops/random_ops.py index 6bd8dd9e3d2..07af214d6c0 100644 --- a/tensorflow/python/ops/random_ops.py +++ b/tensorflow/python/ops/random_ops.py @@ -34,7 +34,9 @@ def random_normal(shape, mean=0.0, stddev=1.0, dtype=types.float32, of the normal distribution. dtype: The type of the output. 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). Returns: @@ -74,7 +76,9 @@ def truncated_normal(shape, mean=0.0, stddev=1.0, dtype=types.float32, of the truncated normal distribution. dtype: The type of the output. 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). Returns: @@ -115,7 +119,9 @@ def random_uniform(shape, minval=0.0, maxval=1.0, the range of random values to generate. dtype: The type of the output. 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). Returns: @@ -151,7 +157,9 @@ def random_shuffle(value, seed=None, name=None): Args: value: A Tensor to be shuffled. 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). Returns: diff --git a/tensorflow/python/ops/state_ops.py b/tensorflow/python/ops/state_ops.py index 2e77bfafc4b..011761904e9 100644 --- a/tensorflow/python/ops/state_ops.py +++ b/tensorflow/python/ops/state_ops.py @@ -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. 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 of sparse indices and values. `IndexedSlices` objects are detected and handled automatically by the optimizers in most cases. diff --git a/tensorflow/python/ops/variables.py b/tensorflow/python/ops/variables.py index ac202bb6e26..2f30c85da22 100644 --- a/tensorflow/python/ops/variables.py +++ b/tensorflow/python/ops/variables.py @@ -207,7 +207,7 @@ class Variable(object): This convenience method requires a session where the graph containing this 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. ```python diff --git a/tensorflow/python/training/moving_averages.py b/tensorflow/python/training/moving_averages.py index 49fadb83c78..e0062a902bb 100644 --- a/tensorflow/python/training/moving_averages.py +++ b/tensorflow/python/training/moving_averages.py @@ -107,8 +107,8 @@ class ExponentialMovingAverage(object): for a given variable. * 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 [Saver class](train.md#Saver) for more information on restoring saved - variables. + the [Saver class](../../api_docs/python/train.md#Saver) for more + information on restoring saved variables. Example of restoring the shadow variable values: diff --git a/tensorflow/python/training/training.py b/tensorflow/python/training/training.py index 84c8156c266..cb6b93bfd0d 100644 --- a/tensorflow/python/training/training.py +++ b/tensorflow/python/training/training.py @@ -75,8 +75,8 @@ The following ops output protocol buffers as serialized string tensors. 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 -file. Event files contain +a [SummaryWriter](../../api_docs/python/train.md#SummaryWriter) to append it +to an event file. Event files contain [`Event`](https://tensorflow.googlesource.com/tensorflow/+/master/tensorflow/core/util/event.proto) protos that can contain `Summary` protos along with the timestamp and step. You can then use TensorBoard to visualize the contents of the diff --git a/tensorflow/tools/pip_package/setup.py b/tensorflow/tools/pip_package/setup.py index 55db7ce6bdf..e5d25c52ee5 100644 --- a/tensorflow/tools/pip_package/setup.py +++ b/tensorflow/tools/pip_package/setup.py @@ -6,7 +6,7 @@ from setuptools.dist import Distribution _VERSION = '0.5.0' REQUIRED_PACKAGES = [ - 'numpy >= 1.10.1', + 'numpy >= 1.9.2', 'six >= 1.10.0', ] -- GitLab