Skip to content

Commit

Permalink
TensorFlow: Upstream changes to git.
Browse files Browse the repository at this point in the history
Changes:
- Documentation updates.
- Relax numpy requirement to 1.9.2

Base CL: 107349632
  • Loading branch information
keveman committed Nov 9, 2015
1 parent 5c6acf7 commit ad9b3be
Show file tree
Hide file tree
Showing 34 changed files with 398 additions and 314 deletions.
34 changes: 20 additions & 14 deletions tensorflow/core/ops/math_ops.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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`.
Expand Down Expand Up @@ -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`.
Expand Down
4 changes: 2 additions & 2 deletions tensorflow/g3doc/api_docs/cc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
4 changes: 2 additions & 2 deletions tensorflow/g3doc/api_docs/python/array_ops.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

# Tensor Transformations <a class="md-anchor" id="AUTOGENERATED-tensor-transformations"></a>

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).

<!-- TOC-BEGIN This section is generated by neural network: DO NOT EDIT! -->
## Contents
Expand Down
101 changes: 53 additions & 48 deletions tensorflow/g3doc/api_docs/python/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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: <a class="md-anchor" id="AUTOGENERATED-args-"></a>

Expand Down Expand Up @@ -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(..)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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`.

- - -

Expand Down Expand Up @@ -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.

- - -
Expand Down Expand Up @@ -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.

- - -
Expand All @@ -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.

- - -
Expand All @@ -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.

- - -
Expand Down Expand Up @@ -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.

- - -

Expand All @@ -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.

- - -

Expand All @@ -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.

- - -

Expand All @@ -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.

- - -

Expand Down Expand Up @@ -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.

- - -

Expand Down
Loading

0 comments on commit ad9b3be

Please sign in to comment.