Skip to content

Commit 9eee5f9

Browse files
Merge branch 'tensorflow:master' into wip
2 parents 0e20971 + ec3a1b3 commit 9eee5f9

File tree

103 files changed

+859
-925
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+859
-925
lines changed

.github/workflows/bot-pr-fix.yaml

-54
This file was deleted.

CONTRIBUTING.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ This guide shows how to make contributions to [tensorflow.org](https://www.tenso
66

77
See the
88
[TensorFlow docs contributor guide](https://www.tensorflow.org/community/contribute/docs)
9-
for guidance. For questions, the
10-
[[email protected]](https://groups.google.com/a/tensorflow.org/forum/#!forum/docs)
11-
mailing list is available.
9+
for guidance. For questions, check out [TensorFlow Forum](https://discuss.tensorflow.org/).
1210

1311
Questions about TensorFlow usage are better addressed on
1412
[Stack Overflow](https://stackoverflow.com/questions/tagged/tensorflow) or the

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ To file a docs issue, use the issue tracker in the
1616
[tensorflow/tensorflow](https://github.com/tensorflow/tensorflow/issues/new?template=20-documentation-issue.md) repo.
1717

1818
And join the TensorFlow documentation contributors on the
19-
[[email protected] mailing list](https://groups.google.com/a/tensorflow.org/forum/#!forum/docs).
19+
[TensorFlow Forum](https://discuss.tensorflow.org/).
2020

2121
## Community translations
2222

site/en/community/contribute/docs.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ To participate in the TensorFlow docs community:
3232

3333
For details, use the [TensorFlow API docs contributor guide](docs_ref.md). This
3434
shows you how to find the
35-
[source file](https://www.tensorflow.org/code/tensorflow/python/)
35+
[source file](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/)
3636
and edit the symbol's
3737
<a href="https://www.python.org/dev/peps/pep-0257/" class="external">docstring</a>.
3838
Many API reference pages on tensorflow.org include a link to the source file
@@ -53,9 +53,9 @@ main
5353
<a href="https://github.com/tensorflow/tensorflow" class="external">tensorflow/tensorflow</a>
5454
repo. The reference documentation is generated from code comments
5555
and docstrings in the source code for
56-
<a href="https://www.tensorflow.org/code/tensorflow/python/" class="external">Python</a>,
57-
<a href="https://www.tensorflow.org/code/tensorflow/cc/" class="external">C++</a>, and
58-
<a href="https://www.tensorflow.org/code/tensorflow/java/" class="external">Java</a>.
56+
<a href="https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/" class="external">Python</a>,
57+
<a href="https://github.com/tensorflow/tensorflow/blob/master/tensorflow/cc/" class="external">C++</a>, and
58+
<a href="https://github.com/tensorflow/tensorflow/blob/master/tensorflow/java/" class="external">Java</a>.
5959

6060
Previous versions of the TensorFlow documentation are available as
6161
[rX.x branches](https://github.com/tensorflow/docs/branches) in the TensorFlow

site/en/community/contribute/docs_ref.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ TensorFlow uses [DocTest](https://docs.python.org/3/library/doctest.html) to
88
test code snippets in Python docstrings. The snippet must be executable Python
99
code. To enable testing, prepend the line with `>>>` (three left-angle
1010
brackets). For example, here's a excerpt from the `tf.concat` function in the
11-
[array_ops.py](https://www.tensorflow.org/code/tensorflow/python/ops/array_ops.py)
11+
[array_ops.py](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/ops/array_ops.py)
1212
source file:
1313

1414
```
@@ -178,7 +178,7 @@ There are two ways to test the code in the docstring locally:
178178
179179
* If you are only changing the docstring of a class/function/method, then you
180180
can test it by passing that file's path to
181-
[tf_doctest.py](https://www.tensorflow.org/code/tensorflow/tools/docs/tf_doctest.py).
181+
[tf_doctest.py](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/docs/tf_doctest.py).
182182
For example:
183183
184184
<pre class="prettyprint lang-bsh">

site/en/community/contribute/docs_style.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ repository like this:
6363
* <code>\[Basics\]\(../../guide/basics.ipynb\)</code> produces
6464
[Basics](../../guide/basics.ipynb).
6565

66-
This is the prefered approach because this way the links on
66+
This is the preferred approach because this way the links on
6767
[tensorflow.org](https://www.tensorflow.org),
6868
[GitHub](https://github.com/tensorflow/docs){:.external} and
6969
[Colab](https://github.com/tensorflow/docs/tree/master/site/en/guide/bazics.ipynb){:.external}

site/en/guide/create_op.md

+34-34
Original file line numberDiff line numberDiff line change
@@ -152,17 +152,17 @@ REGISTER_KERNEL_BUILDER(Name("ZeroOut").Device(DEVICE_CPU), ZeroOutOp);
152152
> Important: Instances of your OpKernel may be accessed concurrently.
153153
> Your `Compute` method must be thread-safe. Guard any access to class
154154
> members with a mutex. Or better yet, don't share state via class members!
155-
> Consider using a [`ResourceMgr`](https://www.tensorflow.org/code/tensorflow/core/framework/resource_mgr.h)
155+
> Consider using a [`ResourceMgr`](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/framework/resource_mgr.h)
156156
> to keep track of op state.
157157
158158
### Multi-threaded CPU kernels
159159
160160
To write a multi-threaded CPU kernel, the Shard function in
161-
[`work_sharder.h`](https://www.tensorflow.org/code/tensorflow/core/util/work_sharder.h)
161+
[`work_sharder.h`](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/util/work_sharder.h)
162162
can be used. This function shards a computation function across the
163163
threads configured to be used for intra-op threading (see
164164
intra_op_parallelism_threads in
165-
[`config.proto`](https://www.tensorflow.org/code/tensorflow/core/protobuf/config.proto)).
165+
[`config.proto`](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/protobuf/config.proto)).
166166
167167
### GPU kernels
168168
@@ -519,13 +519,13 @@ This asserts that the input is a vector, and returns having set the
519519
520520
* The `context`, which can either be an `OpKernelContext` or
521521
`OpKernelConstruction` pointer (see
522-
[`tensorflow/core/framework/op_kernel.h`](https://www.tensorflow.org/code/tensorflow/core/framework/op_kernel.h)),
522+
[`tensorflow/core/framework/op_kernel.h`](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/framework/op_kernel.h)),
523523
for its `SetStatus()` method.
524524
* The condition. For example, there are functions for validating the shape
525525
of a tensor in
526-
[`tensorflow/core/framework/tensor_shape.h`](https://www.tensorflow.org/code/tensorflow/core/framework/tensor_shape.h)
526+
[`tensorflow/core/framework/tensor_shape.h`](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/framework/tensor_shape.h)
527527
* The error itself, which is represented by a `Status` object, see
528-
[`tensorflow/core/platform/status.h`](https://www.tensorflow.org/code/tensorflow/core/platform/status.h). A
528+
[`tensorflow/core/platform/status.h`](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/platform/status.h). A
529529
`Status` has both a type (frequently `InvalidArgument`, but see the list of
530530
types) and a message. Functions for constructing an error may be found in
531531
[`tensorflow/core/platform/errors.h`][validation-macros].
@@ -668,7 +668,7 @@ There are shortcuts for common type constraints:
668668

669669
The specific lists of types allowed by these are defined by the functions (like
670670
`NumberTypes()`) in
671-
[`tensorflow/core/framework/types.h`](https://www.tensorflow.org/code/tensorflow/core/framework/types.h).
671+
[`tensorflow/core/framework/types.h`](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/framework/types.h).
672672
In this example the attr `t` must be one of the numeric types:
673673

674674
```c++
@@ -1226,7 +1226,7 @@ There are several ways to preserve backwards-compatibility.
12261226
type into a list of varying types).
12271227

12281228
The full list of safe and unsafe changes can be found in
1229-
[`tensorflow/core/framework/op_compatibility_test.cc`](https://www.tensorflow.org/code/tensorflow/core/framework/op_compatibility_test.cc).
1229+
[`tensorflow/core/framework/op_compatibility_test.cc`](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/framework/op_compatibility_test.cc).
12301230
If you cannot make your change to an operation backwards compatible, then create
12311231
a new operation with a new name with the new semantics.
12321232

@@ -1243,16 +1243,16 @@ made when TensorFlow changes major versions, and must conform to the
12431243
You can implement different OpKernels and register one for CPU and another for
12441244
GPU, just like you can [register kernels for different types](#polymorphism).
12451245
There are several examples of kernels with GPU support in
1246-
[`tensorflow/core/kernels/`](https://www.tensorflow.org/code/tensorflow/core/kernels/).
1246+
[`tensorflow/core/kernels/`](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/kernels/).
12471247
Notice some kernels have a CPU version in a `.cc` file, a GPU version in a file
12481248
ending in `_gpu.cu.cc`, and some code shared in common in a `.h` file.
12491249

12501250
For example, the `tf.pad` has
12511251
everything but the GPU kernel in [`tensorflow/core/kernels/pad_op.cc`][pad_op].
12521252
The GPU kernel is in
1253-
[`tensorflow/core/kernels/pad_op_gpu.cu.cc`](https://www.tensorflow.org/code/tensorflow/core/kernels/pad_op_gpu.cu.cc),
1253+
[`tensorflow/core/kernels/pad_op_gpu.cu.cc`](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/kernels/pad_op_gpu.cu.cc),
12541254
and the shared code is a templated class defined in
1255-
[`tensorflow/core/kernels/pad_op.h`](https://www.tensorflow.org/code/tensorflow/core/kernels/pad_op.h).
1255+
[`tensorflow/core/kernels/pad_op.h`](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/kernels/pad_op.h).
12561256
We organize the code this way for two reasons: it allows you to share common
12571257
code among the CPU and GPU implementations, and it puts the GPU implementation
12581258
into a separate file so that it can be compiled only by the GPU compiler.
@@ -1273,16 +1273,16 @@ kept on the CPU, add a `HostMemory()` call to the kernel registration, e.g.:
12731273
#### Compiling the kernel for the GPU device
12741274
12751275
Look at
1276-
[cuda_op_kernel.cu.cc](https://www.tensorflow.org/code/tensorflow/examples/adding_an_op/cuda_op_kernel.cu.cc)
1276+
[cuda_op_kernel.cu.cc](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/adding_an_op/cuda_op_kernel.cu.cc)
12771277
for an example that uses a CUDA kernel to implement an op. The
12781278
`tf_custom_op_library` accepts a `gpu_srcs` argument in which the list of source
12791279
files containing the CUDA kernels (`*.cu.cc` files) can be specified. For use
12801280
with a binary installation of TensorFlow, the CUDA kernels have to be compiled
12811281
with NVIDIA's `nvcc` compiler. Here is the sequence of commands you can use to
12821282
compile the
1283-
[cuda_op_kernel.cu.cc](https://www.tensorflow.org/code/tensorflow/examples/adding_an_op/cuda_op_kernel.cu.cc)
1283+
[cuda_op_kernel.cu.cc](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/adding_an_op/cuda_op_kernel.cu.cc)
12841284
and
1285-
[cuda_op_kernel.cc](https://www.tensorflow.org/code/tensorflow/examples/adding_an_op/cuda_op_kernel.cc)
1285+
[cuda_op_kernel.cc](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/adding_an_op/cuda_op_kernel.cc)
12861286
into a single dynamically loadable library:
12871287
12881288
```bash
@@ -1412,7 +1412,7 @@ be set to the first input's shape. If the output is selected by its index as in
14121412
14131413
There are a number of common shape functions
14141414
that apply to many ops, such as `shape_inference::UnchangedShape` which can be
1415-
found in [common_shape_fns.h](https://www.tensorflow.org/code/tensorflow/core/framework/common_shape_fns.h) and used as follows:
1415+
found in [common_shape_fns.h](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/framework/common_shape_fns.h) and used as follows:
14161416
14171417
```c++
14181418
REGISTER_OP("ZeroOut")
@@ -1459,7 +1459,7 @@ provides access to the attributes of the op).
14591459

14601460
Since shape inference is an optional feature, and the shapes of tensors may vary
14611461
dynamically, shape functions must be robust to incomplete shape information for
1462-
any of the inputs. The `Merge` method in [`InferenceContext`](https://www.tensorflow.org/code/tensorflow/core/framework/shape_inference.h)
1462+
any of the inputs. The `Merge` method in [`InferenceContext`](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/framework/shape_inference.h)
14631463
allows the caller to assert that two shapes are the same, even if either
14641464
or both of them do not have complete information. Shape functions are defined
14651465
for all of the core TensorFlow ops and provide many different usage examples.
@@ -1484,7 +1484,7 @@ If you have a complicated shape function, you should consider adding a test for
14841484
validating that various input shape combinations produce the expected output
14851485
shape combinations. You can see examples of how to write these tests in some
14861486
our
1487-
[core ops tests](https://www.tensorflow.org/code/tensorflow/core/ops/array_ops_test.cc).
1487+
[core ops tests](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/ops/array_ops_test.cc).
14881488
(The syntax of `INFER_OK` and `INFER_ERROR` are a little cryptic, but try to be
14891489
compact in representing input and output shape specifications in tests. For
14901490
now, see the surrounding comments in those tests to get a sense of the shape
@@ -1497,20 +1497,20 @@ To build a `pip` package for your op, see the
14971497
guide shows how to build custom ops from the TensorFlow pip package instead
14981498
of building TensorFlow from source.
14991499

1500-
[core-array_ops]:https://www.tensorflow.org/code/tensorflow/core/ops/array_ops.cc
1501-
[python-user_ops]:https://www.tensorflow.org/code/tensorflow/python/user_ops/user_ops.py
1502-
[tf-kernels]:https://www.tensorflow.org/code/tensorflow/core/kernels/
1503-
[user_ops]:https://www.tensorflow.org/code/tensorflow/core/user_ops/
1504-
[pad_op]:https://www.tensorflow.org/code/tensorflow/core/kernels/pad_op.cc
1505-
[standard_ops-py]:https://www.tensorflow.org/code/tensorflow/python/ops/standard_ops.py
1506-
[standard_ops-cc]:https://www.tensorflow.org/code/tensorflow/cc/ops/standard_ops.h
1507-
[python-BUILD]:https://www.tensorflow.org/code/tensorflow/python/BUILD
1508-
[validation-macros]:https://www.tensorflow.org/code/tensorflow/core/platform/errors.h
1509-
[op_def_builder]:https://www.tensorflow.org/code/tensorflow/core/framework/op_def_builder.h
1510-
[register_types]:https://www.tensorflow.org/code/tensorflow/core/framework/register_types.h
1511-
[FinalizeAttr]:https://www.tensorflow.org/code/tensorflow/core/framework/op_def_builder.cc
1512-
[DataTypeString]:https://www.tensorflow.org/code/tensorflow/core/framework/types.cc
1513-
[python-BUILD]:https://www.tensorflow.org/code/tensorflow/python/BUILD
1514-
[types-proto]:https://www.tensorflow.org/code/tensorflow/core/framework/types.proto
1515-
[TensorShapeProto]:https://www.tensorflow.org/code/tensorflow/core/framework/tensor_shape.proto
1516-
[TensorProto]:https://www.tensorflow.org/code/tensorflow/core/framework/tensor.proto
1500+
[core-array_ops]:https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/ops/array_ops.cc
1501+
[python-user_ops]:https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/user_ops/user_ops.py
1502+
[tf-kernels]:https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/kernels/
1503+
[user_ops]:https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/user_ops/
1504+
[pad_op]:https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/kernels/pad_op.cc
1505+
[standard_ops-py]:https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/ops/standard_ops.py
1506+
[standard_ops-cc]:https://github.com/tensorflow/tensorflow/blob/master/tensorflow/cc/ops/standard_ops.h
1507+
[python-BUILD]:https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/BUILD
1508+
[validation-macros]:https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/platform/errors.h
1509+
[op_def_builder]:https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/framework/op_def_builder.h
1510+
[register_types]:https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/framework/register_types.h
1511+
[FinalizeAttr]:https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/framework/op_def_builder.cc
1512+
[DataTypeString]:https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/framework/types.cc
1513+
[python-BUILD]:https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/BUILD
1514+
[types-proto]:https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/framework/types.proto
1515+
[TensorShapeProto]:https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/framework/tensor_shape.proto
1516+
[TensorProto]:https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/framework/tensor.proto

site/en/guide/data.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1385,7 +1385,7 @@
13851385
"The simplest form of batching stacks `n` consecutive elements of a dataset into\n",
13861386
"a single element. The `Dataset.batch()` transformation does exactly this, with\n",
13871387
"the same constraints as the `tf.stack()` operator, applied to each component\n",
1388-
"of the elements: i.e. for each component *i*, all elements must have a tensor\n",
1388+
"of the elements: i.e., for each component *i*, all elements must have a tensor\n",
13891389
"of the exact same shape."
13901390
]
13911391
},

site/en/guide/dtensor_overview.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@
281281
"id": "Eyp_qOSyvieo"
282282
},
283283
"source": [
284-
"<img src=\"https://www.tensorflow.org/images/dtensor/dtensor_layout_rank2.png\" alt=\"A tensorr with it's first axis sharded across mesh dimension 'y' and it's second axis sharded across mesh dimension 'x'\" class=\"no-filter\">\n"
284+
"<img src=\"https://www.tensorflow.org/images/dtensor/dtensor_layout_rank2.png\" alt=\"A tensorr with its first axis sharded across mesh dimension 'y' and it's second axis sharded across mesh dimension 'x'\" class=\"no-filter\">\n"
285285
]
286286
},
287287
{
@@ -303,7 +303,7 @@
303303
"source": [
304304
"For the same `mesh_2d`, the layout `Layout([\"x\", dtensor.UNSHARDED], mesh_2d)` is a layout for a rank-2 `Tensor` that is replicated across `\"y\"`, and whose first axis is sharded on mesh dimension `x`.\n",
305305
"\n",
306-
"<img src=\"https://www.tensorflow.org/images/dtensor/dtensor_layout_hybrid.png\" alt=\"A tensor replicated across mesh-dimension y, with it's first axis sharded across mesh dimension 'x'\" class=\"no-filter\">\n"
306+
"<img src=\"https://www.tensorflow.org/images/dtensor/dtensor_layout_hybrid.png\" alt=\"A tensor replicated across mesh-dimension y, with its first axis sharded across mesh dimension 'x'\" class=\"no-filter\">\n"
307307
]
308308
},
309309
{

0 commit comments

Comments
 (0)