aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/docs_src/extend
diff options
context:
space:
mode:
authorGravatar Mark Daoust <markdaoust@google.com>2018-08-07 14:28:32 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-08-07 14:32:57 -0700
commit02df0f46d562a0c48b6f24803eba6330d13d7213 (patch)
tree3a39933e12b7300ddcefb5afb90db053f295d824 /tensorflow/docs_src/extend
parent452f995e2c23cbd67c14b15b678bb3a352212633 (diff)
Remove usage of magic-api-link syntax from docs.
Back-ticks are now converted to links in the api_docs generator. With the new docs repo we're moving to simplify the docs pipeline, and make everything more readable. By doing this we no longer get test failures for symbols that don't exist (`tf.does_not_exist` will not get a link). There is also no way to set custom link text now. That's okay. This is the result of the following regex replacement (+ a couple of manual edits.): re: @\{([^$].*?)(\$.+?)?} sub: `\1` Which does the following replacements: "@{tf.symbol}" --> "`tf.symbol`" "@{tf.symbol$link_text}" --> "`tf.symbol`" PiperOrigin-RevId: 207780049
Diffstat (limited to 'tensorflow/docs_src/extend')
-rw-r--r--tensorflow/docs_src/extend/adding_an_op.md25
-rw-r--r--tensorflow/docs_src/extend/architecture.md4
-rw-r--r--tensorflow/docs_src/extend/new_data_formats.md33
3 files changed, 30 insertions, 32 deletions
diff --git a/tensorflow/docs_src/extend/adding_an_op.md b/tensorflow/docs_src/extend/adding_an_op.md
index 1b028be4ea..6e96cfc532 100644
--- a/tensorflow/docs_src/extend/adding_an_op.md
+++ b/tensorflow/docs_src/extend/adding_an_op.md
@@ -46,7 +46,7 @@ To incorporate your custom op you'll need to:
4. Write a function to compute gradients for the op (optional).
5. Test the op. We usually do this in Python for convenience, but you can also
test the op in C++. If you define gradients, you can verify them with the
- Python @{tf.test.compute_gradient_error$gradient checker}.
+ Python `tf.test.compute_gradient_error`.
See
[`relu_op_test.py`](https://www.tensorflow.org/code/tensorflow/python/kernel_tests/relu_op_test.py) as
an example that tests the forward functions of Relu-like operators and
@@ -388,7 +388,7 @@ $ bazel build --config opt //tensorflow/core/user_ops:zero_out.so
## Use the op in Python
TensorFlow Python API provides the
-@{tf.load_op_library} function to
+`tf.load_op_library` function to
load the dynamic library and register the op with the TensorFlow
framework. `load_op_library` returns a Python module that contains the Python
wrappers for the op and the kernel. Thus, once you have built the op, you can
@@ -538,7 +538,7 @@ REGISTER_OP("ZeroOut")
```
(Note that the set of [attribute types](#attr_types) is different from the
-@{tf.DType$tensor types} used for inputs and outputs.)
+`tf.DType` used for inputs and outputs.)
Your kernel can then access this attr in its constructor via the `context`
parameter:
@@ -615,7 +615,7 @@ define an attr with constraints, you can use the following `<attr-type-expr>`s:
* `{<type1>, <type2>}`: The value is of type `type`, and must be one of
`<type1>` or `<type2>`, where `<type1>` and `<type2>` are supported
- @{tf.DType$tensor types}. You don't specify
+ `tf.DType`. You don't specify
that the type of the attr is `type`. This is implied when you have a list of
types in `{...}`. For example, in this case the attr `t` is a type that must
be an `int32`, a `float`, or a `bool`:
@@ -714,7 +714,7 @@ REGISTER_OP("AttrDefaultExampleForAllTypes")
```
Note in particular that the values of type `type`
-use @{tf.DType$the `DT_*` names for the types}.
+use `tf.DType`.
#### Polymorphism
@@ -1056,7 +1056,7 @@ expressions:
`string`). This specifies a single tensor of the given type.
See
- @{tf.DType$the list of supported Tensor types}.
+ `tf.DType`.
```c++
REGISTER_OP("BuiltInTypesExample")
@@ -1098,8 +1098,7 @@ expressions:
* For a sequence of tensors with the same type: `<number> * <type>`, where
`<number>` is the name of an [Attr](#attrs) with type `int`. The `<type>` can
- either be
- @{tf.DType$a specific type like `int32` or `float`},
+ either be a `tf.DType`,
or the name of an attr with type `type`. As an example of the first, this
op accepts a list of `int32` tensors:
@@ -1202,7 +1201,7 @@ There are several examples of kernels with GPU support in
Notice some kernels have a CPU version in a `.cc` file, a GPU version in a file
ending in `_gpu.cu.cc`, and some code shared in common in a `.h` file.
-For example, the @{tf.pad} has
+For example, the `tf.pad` has
everything but the GPU kernel in [`tensorflow/core/kernels/pad_op.cc`][pad_op].
The GPU kernel is in
[`tensorflow/core/kernels/pad_op_gpu.cu.cc`](https://www.tensorflow.org/code/tensorflow/core/kernels/pad_op_gpu.cu.cc),
@@ -1307,16 +1306,16 @@ def _zero_out_grad(op, grad):
```
Details about registering gradient functions with
-@{tf.RegisterGradient}:
+`tf.RegisterGradient`:
* For an op with one output, the gradient function will take an
- @{tf.Operation} `op` and a
- @{tf.Tensor} `grad` and build new ops
+ `tf.Operation` `op` and a
+ `tf.Tensor` `grad` and build new ops
out of the tensors
[`op.inputs[i]`](../../api_docs/python/framework.md#Operation.inputs),
[`op.outputs[i]`](../../api_docs/python/framework.md#Operation.outputs), and `grad`. Information
about any attrs can be found via
- @{tf.Operation.get_attr}.
+ `tf.Operation.get_attr`.
* If the op has multiple outputs, the gradient function will take `op` and
`grads`, where `grads` is a list of gradients with respect to each output.
diff --git a/tensorflow/docs_src/extend/architecture.md b/tensorflow/docs_src/extend/architecture.md
index 84435a57f2..83d70c9468 100644
--- a/tensorflow/docs_src/extend/architecture.md
+++ b/tensorflow/docs_src/extend/architecture.md
@@ -81,7 +81,7 @@ implementation from all client languages. Most of the training libraries are
still Python-only, but C++ does have support for efficient inference.
The client creates a session, which sends the graph definition to the
-distributed master as a @{tf.GraphDef}
+distributed master as a `tf.GraphDef`
protocol buffer. When the client evaluates a node or nodes in the
graph, the evaluation triggers a call to the distributed master to initiate
computation.
@@ -96,7 +96,7 @@ feature vector (x), adds a bias term (b) and saves the result in a variable
### Code
-* @{tf.Session}
+* `tf.Session`
## Distributed master
diff --git a/tensorflow/docs_src/extend/new_data_formats.md b/tensorflow/docs_src/extend/new_data_formats.md
index abbf47910e..47a8344b70 100644
--- a/tensorflow/docs_src/extend/new_data_formats.md
+++ b/tensorflow/docs_src/extend/new_data_formats.md
@@ -15,25 +15,24 @@ We divide the task of supporting a file format into two pieces:
* Record formats: We use decoder or parsing ops to turn a string record
into tensors usable by TensorFlow.
-For example, to read a
-[CSV file](https://en.wikipedia.org/wiki/Comma-separated_values), we use
-@{tf.data.TextLineDataset$a dataset for reading text files line-by-line}
-and then @{tf.data.Dataset.map$map} an
-@{tf.decode_csv$op} that parses CSV data from each line of text in the dataset.
+For example, to re-implement `tf.contrib.data.make_csv_dataset` function, we
+could use `tf.data.TextLineDataset` to extract the records, and then
+use `tf.data.Dataset.map` and `tf.decode_csv` to parses the CSV records from
+each line of text in the dataset.
[TOC]
## Writing a `Dataset` for a file format
-A @{tf.data.Dataset} represents a sequence of *elements*, which can be the
+A `tf.data.Dataset` represents a sequence of *elements*, which can be the
individual records in a file. There are several examples of "reader" datasets
that are already built into TensorFlow:
-* @{tf.data.TFRecordDataset}
+* `tf.data.TFRecordDataset`
([source in `kernels/data/reader_dataset_ops.cc`](https://www.tensorflow.org/code/tensorflow/core/kernels/data/reader_dataset_ops.cc))
-* @{tf.data.FixedLengthRecordDataset}
+* `tf.data.FixedLengthRecordDataset`
([source in `kernels/data/reader_dataset_ops.cc`](https://www.tensorflow.org/code/tensorflow/core/kernels/data/reader_dataset_ops.cc))
-* @{tf.data.TextLineDataset}
+* `tf.data.TextLineDataset`
([source in `kernels/data/reader_dataset_ops.cc`](https://www.tensorflow.org/code/tensorflow/core/kernels/data/reader_dataset_ops.cc))
Each of these implementations comprises three related classes:
@@ -64,7 +63,7 @@ need to:
that implement the reading logic.
2. In C++, register a new reader op and kernel with the name
`"MyReaderDataset"`.
-3. In Python, define a subclass of @{tf.data.Dataset} called `MyReaderDataset`.
+3. In Python, define a subclass of `tf.data.Dataset` called `MyReaderDataset`.
You can put all the C++ code in a single file, such as
`my_reader_dataset_op.cc`. It will help if you are
@@ -230,7 +229,7 @@ REGISTER_KERNEL_BUILDER(Name("MyReaderDataset").Device(tensorflow::DEVICE_CPU),
The last step is to build the C++ code and add a Python wrapper. The easiest way
to do this is by @{$adding_an_op#build_the_op_library$compiling a dynamic
library} (e.g. called `"my_reader_dataset_op.so"`), and adding a Python class
-that subclasses @{tf.data.Dataset} to wrap it. An example Python program is
+that subclasses `tf.data.Dataset` to wrap it. An example Python program is
given here:
```python
@@ -293,14 +292,14 @@ track down where the bad data came from.
Examples of Ops useful for decoding records:
-* @{tf.parse_single_example} (and @{tf.parse_example})
-* @{tf.decode_csv}
-* @{tf.decode_raw}
+* `tf.parse_single_example` (and `tf.parse_example`)
+* `tf.decode_csv`
+* `tf.decode_raw`
Note that it can be useful to use multiple Ops to decode a particular record
format. For example, you may have an image saved as a string in
[a `tf.train.Example` protocol buffer](https://www.tensorflow.org/code/tensorflow/core/example/example.proto).
Depending on the format of that image, you might take the corresponding output
-from a @{tf.parse_single_example} op and call @{tf.image.decode_jpeg},
-@{tf.image.decode_png}, or @{tf.decode_raw}. It is common to take the output
-of `tf.decode_raw` and use @{tf.slice} and @{tf.reshape} to extract pieces.
+from a `tf.parse_single_example` op and call `tf.image.decode_jpeg`,
+`tf.image.decode_png`, or `tf.decode_raw`. It is common to take the output
+of `tf.decode_raw` and use `tf.slice` and `tf.reshape` to extract pieces.