aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Vijay Vasudevan <vrv@google.com>2015-11-18 10:47:35 -0800
committerGravatar Vijay Vasudevan <vrv@google.com>2015-11-18 10:47:35 -0800
commitab34d55ce7618e52069a2e1c9e51aac5a1ea81c3 (patch)
tree9c79427b45ff6501e8374ceb7b4fc3bdb2828e15
parent9eb88d56ab6a9a361662d73a258593d8fbf10b62 (diff)
TensorFlow: more features, performance improvements, and doc fixes.
Changes: - Add Split/Concat() methods to TensorUtil (meant for convenience, not speed) by Chris. - Changes to linear algebra ops interface by Rasmus - Tests for tensorboard by Daniel - Fix bug in histogram calculation by Cassandra - Added tool for backwards compatibility of OpDefs. Tool Checks in history of opdefs and their changes, checks for backwards-incompatible changes. All done by @josh11b - Fix some protobuf example proto docs by Oliver - Add derivative of MatrixDeterminant by @yaroslavvb - Add a priority queue queue by @ebrevdo - Doc and typo fixes by Aurelien and @dave-andersen - Speed improvements to ConvBackwardFilter by @andydavis - Improve speed of Alexnet on TitanX by @zheng-xq - Add some host memory annotations to some GPU kernels by Yuan. - Add support for doubles in histogram summary by @jmchen-g Base CL: 108158338
-rw-r--r--tensorflow/core/example/example.proto24
-rw-r--r--tensorflow/core/example/feature.proto24
-rw-r--r--tensorflow/core/framework/tensor_util.cc102
-rw-r--r--tensorflow/core/framework/tensor_util.h22
-rw-r--r--tensorflow/core/framework/tensor_util_test.cc76
-rw-r--r--tensorflow/core/framework/types.h5
-rw-r--r--tensorflow/core/kernels/bias_op_gpu.cu.cc35
-rw-r--r--tensorflow/core/kernels/cholesky_op.cc10
-rw-r--r--tensorflow/core/kernels/conv_2d.h18
-rw-r--r--tensorflow/core/kernels/conv_grad_ops.cc72
-rw-r--r--tensorflow/core/kernels/conv_ops_gpu_3.cu.cc238
-rw-r--r--tensorflow/core/kernels/determinant_op.cc10
-rw-r--r--tensorflow/core/kernels/in_topk_op.cc13
-rw-r--r--tensorflow/core/kernels/linalg_ops_common.cc46
-rw-r--r--tensorflow/core/kernels/linalg_ops_common.h44
-rw-r--r--tensorflow/core/kernels/matrix_inverse_op.cc11
-rw-r--r--tensorflow/core/kernels/pad_op.cc11
-rw-r--r--tensorflow/core/kernels/pooling_ops_common.cc22
-rw-r--r--tensorflow/core/kernels/queue_ops.cc3
-rw-r--r--tensorflow/core/kernels/shape_ops.cc9
-rw-r--r--tensorflow/core/kernels/summary_op.cc15
-rw-r--r--tensorflow/core/kernels/summary_op_test.cc40
-rw-r--r--tensorflow/core/kernels/typed_queue.h7
-rw-r--r--tensorflow/core/lib/histogram/histogram.cc47
-rw-r--r--tensorflow/core/lib/histogram/histogram.h2
-rw-r--r--tensorflow/core/lib/histogram/histogram_test.cc30
-rw-r--r--tensorflow/core/ops/nn_ops.cc17
-rw-r--r--tensorflow/core/ops/ops.pbtxt8072
-rw-r--r--tensorflow/core/ops/summary_ops.cc3
-rw-r--r--tensorflow/core/platform/protobuf.h4
-rw-r--r--tensorflow/core/public/version.h24
-rw-r--r--tensorflow/core/util/cuda_kernel_helper.h52
-rw-r--r--tensorflow/g3doc/api_docs/cc/ClassEnv.md38
-rw-r--r--tensorflow/g3doc/api_docs/cc/ClassEnvWrapper.md38
-rw-r--r--tensorflow/g3doc/api_docs/cc/ClassRandomAccessFile.md12
-rw-r--r--tensorflow/g3doc/api_docs/cc/ClassSession.md16
-rw-r--r--tensorflow/g3doc/api_docs/cc/ClassStatus.md32
-rw-r--r--tensorflow/g3doc/api_docs/cc/ClassTensor.md96
-rw-r--r--tensorflow/g3doc/api_docs/cc/ClassTensorShape.md54
-rw-r--r--tensorflow/g3doc/api_docs/cc/ClassTensorShapeUtils.md26
-rw-r--r--tensorflow/g3doc/api_docs/cc/ClassThread.md10
-rw-r--r--tensorflow/g3doc/api_docs/cc/ClassWritableFile.md18
-rw-r--r--tensorflow/g3doc/api_docs/cc/StructSessionOptions.md14
-rw-r--r--tensorflow/g3doc/api_docs/cc/StructState.md10
-rw-r--r--tensorflow/g3doc/api_docs/cc/StructTensorShapeDim.md10
-rw-r--r--tensorflow/g3doc/api_docs/cc/StructThreadOptions.md10
-rw-r--r--tensorflow/g3doc/api_docs/cc/index.md12
-rw-r--r--tensorflow/g3doc/api_docs/index.md2
-rw-r--r--tensorflow/g3doc/api_docs/python/array_ops.md216
-rw-r--r--tensorflow/g3doc/api_docs/python/client.md153
-rw-r--r--tensorflow/g3doc/api_docs/python/constant_op.md112
-rw-r--r--tensorflow/g3doc/api_docs/python/control_flow_ops.md200
-rw-r--r--tensorflow/g3doc/api_docs/python/framework.md487
-rw-r--r--tensorflow/g3doc/api_docs/python/image.md220
-rw-r--r--tensorflow/g3doc/api_docs/python/index.md2
-rw-r--r--tensorflow/g3doc/api_docs/python/io_ops.md501
-rw-r--r--tensorflow/g3doc/api_docs/python/math_ops.md484
-rw-r--r--tensorflow/g3doc/api_docs/python/nn.md261
-rw-r--r--tensorflow/g3doc/api_docs/python/python_io.md39
-rw-r--r--tensorflow/g3doc/api_docs/python/sparse_ops.md111
-rw-r--r--tensorflow/g3doc/api_docs/python/state_ops.md286
-rw-r--r--tensorflow/g3doc/api_docs/python/train.md375
-rw-r--r--tensorflow/g3doc/get_started/basic_usage.md22
-rw-r--r--tensorflow/g3doc/get_started/index.md8
-rw-r--r--tensorflow/g3doc/get_started/os_setup.md72
-rw-r--r--tensorflow/g3doc/how_tos/adding_an_op/index.md65
-rw-r--r--tensorflow/g3doc/how_tos/graph_viz/index.md6
-rw-r--r--tensorflow/g3doc/how_tos/new_data_formats/index.md15
-rw-r--r--tensorflow/g3doc/how_tos/reading_data/index.md52
-rw-r--r--tensorflow/g3doc/how_tos/summaries_and_tensorboard/index.md6
-rw-r--r--tensorflow/g3doc/how_tos/threading_and_queues/index.md10
-rw-r--r--tensorflow/g3doc/how_tos/using_gpu/index.md12
-rw-r--r--tensorflow/g3doc/how_tos/variable_scope/index.md20
-rw-r--r--tensorflow/g3doc/how_tos/variables/index.md20
-rw-r--r--tensorflow/g3doc/index.md6
-rw-r--r--tensorflow/g3doc/resources/bib.md2
-rw-r--r--tensorflow/g3doc/resources/dims_types.md8
-rw-r--r--tensorflow/g3doc/resources/faq.md76
-rw-r--r--tensorflow/g3doc/resources/glossary.md2
-rw-r--r--tensorflow/g3doc/resources/index.md16
-rw-r--r--tensorflow/g3doc/resources/uses.md2
-rw-r--r--tensorflow/g3doc/tutorials/deep_cnn/index.md32
-rwxr-xr-xtensorflow/g3doc/tutorials/mandelbrot/index.md8
-rw-r--r--tensorflow/g3doc/tutorials/mnist/beginners/index.md12
-rw-r--r--tensorflow/g3doc/tutorials/mnist/download/index.md12
-rw-r--r--tensorflow/g3doc/tutorials/mnist/pros/index.md40
-rw-r--r--tensorflow/g3doc/tutorials/mnist/tf/index.md40
-rwxr-xr-xtensorflow/g3doc/tutorials/pdes/index.md10
-rw-r--r--tensorflow/g3doc/tutorials/recurrent/index.md26
-rw-r--r--tensorflow/g3doc/tutorials/seq2seq/index.md16
-rw-r--r--tensorflow/g3doc/tutorials/word2vec/index.md22
-rw-r--r--tensorflow/python/kernel_tests/control_flow_ops_py_test.py23
-rw-r--r--tensorflow/python/kernel_tests/in_topk_op_test.py5
-rw-r--r--tensorflow/python/kernel_tests/linalg_grad_test.py71
-rw-r--r--tensorflow/python/ops/control_flow_ops.py47
-rw-r--r--tensorflow/python/ops/linalg_grad.py44
-rw-r--r--tensorflow/python/ops/summary_ops.py4
-rw-r--r--tensorflow/python/training/moving_averages.py22
-rw-r--r--tensorflow/python/training/moving_averages_test.py15
-rw-r--r--tensorflow/tensorboard/bower.json2
-rw-r--r--tensorflow/tensorboard/components/tf-graph-common/test/graph-test.ts10
-rw-r--r--tensorflow/tensorboard/components/tf-graph-common/test/hierarchy-test.ts10
-rw-r--r--tensorflow/tensorboard/components/tf-graph-common/test/index.html15
-rw-r--r--tensorflow/tensorboard/components/tf-graph-common/test/layout-test.ts10
-rw-r--r--tensorflow/tensorboard/components/tf-graph-common/test/parser-test.ts30
-rw-r--r--tensorflow/tensorboard/components/tf-graph-loader/test/index.html13
-rw-r--r--tensorflow/tensorboard/components/tf-graph-loader/test/loader.ts10
-rw-r--r--tensorflow/tensorboard/gulpfile.js37
-rw-r--r--tensorflow/tensorboard/package.json3
-rw-r--r--tensorflow/tensorboard/test/index.html17
-rw-r--r--tensorflow/tensorflow.bzl3
111 files changed, 11229 insertions, 2753 deletions
diff --git a/tensorflow/core/example/example.proto b/tensorflow/core/example/example.proto
index 194d1e7c24..4acd8ccd72 100644
--- a/tensorflow/core/example/example.proto
+++ b/tensorflow/core/example/example.proto
@@ -11,29 +11,29 @@ package tensorflow;
// features {
// feature {
// key: "age"
-// float_list {
+// value { float_list {
// value: 29.0
-// }
+// }}
// }
// feature {
// key: "movie"
-// bytes_list {
+// value { bytes_list {
// value: "The Shawshank Redemption"
// value: "Fight Club"
-// }
+// }}
// }
// feature {
// key: "movie_ratings"
-// float_list {
+// value { float_list {
// value: 9.0
// value: 9.7
-// }
+// }}
// }
// feature {
// key: "suggestion"
-// bytes_list {
+// value { bytes_list {
// value: "Inception"
-// }
+// }}
// }
// # Note that this feature exists to be used as a label in training.
// # E.g., if training a logistic regression model to predict purchase
@@ -41,9 +41,9 @@ package tensorflow;
// # "suggestion_purchased".
// feature {
// key: "suggestion_purchased"
-// float_list {
+// value { float_list {
// value: 1.0
-// }
+// }}
// }
// # Similar to "suggestion_purchased" above this feature exists to be used
// # as a label in training.
@@ -52,9 +52,9 @@ package tensorflow;
// # "purchase_price".
// feature {
// key: "purchase_price"
-// float_list {
+// value { float_list {
// value: 9.99
-// }
+// }}
// }
// }
//
diff --git a/tensorflow/core/example/feature.proto b/tensorflow/core/example/feature.proto
index 5a3a9dd4bf..69f1923360 100644
--- a/tensorflow/core/example/feature.proto
+++ b/tensorflow/core/example/feature.proto
@@ -14,41 +14,41 @@
// Example Features for a movie recommendation application:
// feature {
// key: "age"
-// float_list {
+// value { float_list {
// value: 29.0
-// }
+// }}
// }
// feature {
// key: "movie"
-// bytes_list {
+// value { bytes_list {
// value: "The Shawshank Redemption"
// value: "Fight Club"
-// }
+// }}
// }
// feature {
// key: "movie_ratings"
-// float_list {
+// value { float_list {
// value: 9.0
// value: 9.7
-// }
+// }}
// }
// feature {
// key: "suggestion"
-// bytes_list {
+// value { bytes_list {
// value: "Inception"
-// }
+// }}
// }
// feature {
// key: "suggestion_purchased"
-// int64_list {
+// value { int64_list {
// value: 1
-// }
+// }}
// }
// feature {
// key: "purchase_price"
-// float_list {
+// value { float_list {
// value: 9.99
-// }
+// }}
// }
syntax = "proto3";
diff --git a/tensorflow/core/framework/tensor_util.cc b/tensorflow/core/framework/tensor_util.cc
index 7353191c74..e67bfe6e51 100644
--- a/tensorflow/core/framework/tensor_util.cc
+++ b/tensorflow/core/framework/tensor_util.cc
@@ -24,5 +24,107 @@ Tensor DeepCopy(const Tensor& other) {
return tmp;
}
+Tensor Concat(const gtl::ArraySlice<Tensor>& tensors) {
+ CHECK_GT(tensors.size(), 0);
+ int64 total_dim0_size = 0;
+ for (const Tensor& tensor : tensors) {
+ CHECK_GT(tensor.dims(), 0);
+ total_dim0_size += tensor.dim_size(0);
+ }
+ TensorShape shape = tensors[0].shape();
+ shape.set_dim(0, total_dim0_size);
+ Tensor result = Tensor(tensors[0].dtype(), shape);
+
+ // We use StringPiece as a convenient map over the tensor buffer,
+ // but we cast the type to get to the underlying buffer to do the
+ // copy.
+ StringPiece to_data = result.tensor_data();
+
+ if (DataTypeCanUseMemcpy(result.dtype())) {
+ int64 offset = 0;
+ for (const Tensor& tensor : tensors) {
+ StringPiece from_data = tensor.tensor_data();
+ CHECK_LE(offset + from_data.size(), to_data.size());
+ memcpy(const_cast<char*>(to_data.data()) + offset, from_data.data(),
+ from_data.size());
+
+ offset += from_data.size();
+ }
+ } else {
+ CHECK_EQ(DT_STRING, result.dtype());
+ string* to_strings =
+ reinterpret_cast<string*>(const_cast<char*>(to_data.data()));
+
+ int64 offset = 0;
+ for (const Tensor& tensor : tensors) {
+ auto from_strings = tensor.flat<string>();
+ CHECK_LE(offset + tensor.NumElements(), result.NumElements());
+ for (int i = 0; i < tensor.NumElements(); ++i) {
+ to_strings[offset + i] = from_strings(i);
+ }
+
+ offset += tensor.NumElements();
+ }
+ }
+
+ return result;
+}
+
+std::vector<Tensor> Split(const Tensor& tensor,
+ const gtl::ArraySlice<int64>& sizes) {
+ CHECK_GT(tensor.dims(), 0);
+ int64 total_size = 0;
+ for (int64 size : sizes) {
+ total_size += size;
+ }
+ CHECK_EQ(total_size, tensor.dim_size(0));
+
+ std::vector<Tensor> result;
+
+ StringPiece from_data = tensor.tensor_data();
+
+ if (DataTypeCanUseMemcpy(tensor.dtype())) {
+ int64 offset = 0;
+ for (int64 size : sizes) {
+ TensorShape shape = tensor.shape();
+ shape.set_dim(0, size);
+ result.emplace_back(tensor.dtype(), shape);
+ Tensor* split = &result[result.size() - 1];
+
+ // We use StringPiece as a convenient map over the tensor buffer,
+ // but we cast the type to get to the underlying buffer to do the
+ // copy.
+ StringPiece to_data = split->tensor_data();
+ CHECK_LE(offset + to_data.size(), from_data.size());
+ memcpy(const_cast<char*>(to_data.data()), from_data.data() + offset,
+ to_data.size());
+
+ offset += to_data.size();
+ }
+ } else {
+ CHECK_EQ(DT_STRING, tensor.dtype());
+ auto from_strings = tensor.flat<string>();
+
+ int64 offset = 0;
+ for (int64 size : sizes) {
+ TensorShape shape = tensor.shape();
+ shape.set_dim(0, size);
+ result.emplace_back(tensor.dtype(), shape);
+ Tensor& split = result[result.size() - 1];
+ string* to_strings = reinterpret_cast<string*>(
+ const_cast<char*>(split.tensor_data().data()));
+
+ CHECK_LE(offset + split.NumElements(), tensor.NumElements());
+ for (int i = 0; i < split.NumElements(); ++i) {
+ to_strings[i] = from_strings(offset + i);
+ }
+
+ offset += split.NumElements();
+ }
+ }
+
+ return result;
+}
+
} // namespace tensor
} // namespace tensorflow
diff --git a/tensorflow/core/framework/tensor_util.h b/tensorflow/core/framework/tensor_util.h
index a8dde1d0ca..44513fe79f 100644
--- a/tensorflow/core/framework/tensor_util.h
+++ b/tensorflow/core/framework/tensor_util.h
@@ -15,6 +15,28 @@ namespace tensor {
// 'other' is not appropriately memory-aligned.
Tensor DeepCopy(const Tensor& other);
+// Concatenates 'tensors' into a single tensor, along their 0th dimension.
+//
+// REQUIRES: All members of 'tensors' must have the same data type parameter.
+// REQUIRES: Each member of 'tensors' must have at least one dimension.
+// REQUIRES: Each member of 'tensors' must point to data stored in CPU memory.
+// REQUIRES: Each member of 'tensors' must be a Tensor of a copy-able type if it
+// is not appropriately memory-aligned.
+Tensor Concat(const gtl::ArraySlice<Tensor>& tensors);
+
+// Splits 'tensor' into 'sizes.size()' individual tensors, along the 0th
+// dimension. The ith output tensor has 0th-dimension size 'sizes[i]'.
+//
+// REQUIRES: 'tensor' must have at least one dimension.
+// REQUIRES: 'tensor.dim_size(0)' must equal the sum of the elements of 'sizes'.
+// REQUIRES: 'tensor' must point to data stored in CPU memory.
+// REQUIRES: 'tensor' must be a Tensor of a copy-able type if it is not
+// appropriately memory-aligned.
+//
+// Split() and Concat() are inverse operations.
+std::vector<Tensor> Split(const Tensor& tensor,
+ const gtl::ArraySlice<int64>& sizes);
+
} // namespace tensor
} // namespace tensorflow
diff --git a/tensorflow/core/framework/tensor_util_test.cc b/tensorflow/core/framework/tensor_util_test.cc
index 44914000e6..de2071c5a3 100644
--- a/tensorflow/core/framework/tensor_util_test.cc
+++ b/tensorflow/core/framework/tensor_util_test.cc
@@ -120,5 +120,81 @@ TEST(TensorUtil, DeepCopySlice) {
}
}
+TEST(TensorUtil, Concat) {
+ std::vector<int64> sizes = {1, 4, 5};
+ std::vector<Tensor> to_concat;
+ int64 total_size = 0;
+ int offset = 0;
+ for (int entry = 0; entry < sizes.size(); ++entry) {
+ const int64 size = sizes[entry];
+ Tensor tensor(DT_INT32, TensorShape({size, 2}));
+ for (int i = offset; i < offset + size; ++i) {
+ for (int j = 0; j < 2; ++j) {
+ tensor.matrix<int32>()(i - offset, j) = 2 * i + j;
+ }
+ }
+ to_concat.push_back(tensor);
+ total_size += size;
+ offset += size;
+ }
+
+ Tensor concated = tensor::Concat(to_concat);
+ ASSERT_EQ(TensorShape({total_size, 2}), concated.shape());
+ for (int i = 0; i < total_size; ++i) {
+ for (int j = 0; j < 2; ++j) {
+ EXPECT_EQ(2 * i + j, concated.matrix<int32>()(i, j));
+ }
+ }
+}
+
+TEST(TensorUtil, Split) {
+ Tensor to_split(DT_INT64, TensorShape({10, 2}));
+ for (int i = 0; i < 10; ++i) {
+ for (int j = 0; j < 2; ++j) {
+ to_split.matrix<int64>()(i, j) = 2 * i + j;
+ }
+ }
+
+ std::vector<int64> sizes = {1, 4, 5};
+ std::vector<Tensor> splits = tensor::Split(to_split, sizes);
+ ASSERT_EQ(sizes.size(), splits.size());
+
+ int offset = 0;
+ for (int entry = 0; entry < splits.size(); ++entry) {
+ const int64 size = sizes[entry];
+ const Tensor& split = splits[entry];
+
+ ASSERT_EQ(TensorShape({size, 2}), split.shape());
+ for (int i = offset; i < offset + size; ++i) {
+ for (int j = 0; j < 2; ++j) {
+ EXPECT_EQ(2 * i + j, split.matrix<int64>()(i - offset, j));
+ }
+ }
+
+ offset += size;
+ }
+}
+
+TEST(TensorUtil, ConcatSplitStrings) {
+ Tensor x(DT_STRING, TensorShape({4, 3}));
+ for (int i = 0; i < 4 * 3; ++i) {
+ x.flat<string>()(i) = strings::StrCat("foo_", i);
+ }
+
+ Tensor x_round_tripped = tensor::Concat(tensor::Split(x, {2, 1, 1}));
+ ASSERT_EQ(x.shape(), x_round_tripped.shape());
+ for (int i = 0; i < 4 * 3; ++i) {
+ EXPECT_EQ(x.flat<string>()(i), x_round_tripped.flat<string>()(i));
+ }
+
+ // Ensure that no memory is being shared between 'x' and 'x_round_tripped'.
+ for (int i = 0; i < 4 * 3; ++i) {
+ x_round_tripped.flat<string>()(i) = strings::StrCat("bar_", i);
+ }
+ for (int i = 0; i < 4 * 3; ++i) {
+ EXPECT_NE(x.flat<string>()(i), x_round_tripped.flat<string>()(i));
+ }
+}
+
} // namespace
} // namespace tensorflow
diff --git a/tensorflow/core/framework/types.h b/tensorflow/core/framework/types.h
index a205676532..a549bd0c46 100644
--- a/tensorflow/core/framework/types.h
+++ b/tensorflow/core/framework/types.h
@@ -5,7 +5,12 @@
#include <set>
#include <string>
+#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor"
+// Disable clang-format to prevent 'FixedPoint' header from being included
+// before 'Tensor' header on which it depends.
+// clang-format off
#include "third_party/eigen3/unsupported/Eigen/CXX11/FixedPoint"
+// clang-format on
#include "tensorflow/core/framework/bfloat16.h"
#include "tensorflow/core/framework/numeric_types.h"
#include "tensorflow/core/framework/types.pb.h"
diff --git a/tensorflow/core/kernels/bias_op_gpu.cu.cc b/tensorflow/core/kernels/bias_op_gpu.cu.cc
index d3377b3ce8..5e09140d07 100644
--- a/tensorflow/core/kernels/bias_op_gpu.cu.cc
+++ b/tensorflow/core/kernels/bias_op_gpu.cu.cc
@@ -2,14 +2,49 @@
#define EIGEN_USE_GPU
+#include <algorithm>
+
#include "tensorflow/core/framework/register_types.h"
#include "tensorflow/core/kernels/bias_op.h"
+#include "tensorflow/core/util/cuda_kernel_helper.h"
namespace tensorflow {
typedef Eigen::GpuDevice GPUDevice;
// Definition of the GPU implementations declared in bias_op.cc.
+
+namespace functor {
+
+template <typename T>
+__global__ void BiasOpCustomKernel(int nthreads, const T* input, const T* bias,
+ int bias_size, int replicate_count,
+ T* output) {
+ CUDA_1D_KERNEL_LOOP(index, nthreads) {
+ int bias_offset = index % bias_size;
+ output[index] = input[index] + bias[bias_offset];
+ }
+}
+
+template <typename T, int Dims>
+struct Bias<GPUDevice, T, Dims> {
+ typedef GPUDevice Device;
+ // Add "bias" to "input", broadcasting it on all dimensions but the last one.
+ void operator()(const Device& d, typename TTypes<T, Dims>::ConstTensor input,
+ typename TTypes<T>::ConstVec bias,
+ typename TTypes<T, Dims>::Tensor output) {
+ const int bias_size = bias.dimension(0);
+ const int rest_size = input.size() / bias_size;
+ CudaLaunchConfig config = GetCudaLaunchConfig(output.size(), d);
+ BiasOpCustomKernel<<<config.block_count, config.thread_per_block, 0,
+ d.stream()>>>(config.virtual_thread_count,
+ input.data(), bias.data(), bias_size,
+ rest_size, output.data());
+ }
+};
+
+} // namespace functor
+
#define DEFINE_GPU_SPECS(T) \
template struct functor::Bias<GPUDevice, T, 2>; \
template struct functor::Bias<GPUDevice, T, 3>; \
diff --git a/tensorflow/core/kernels/cholesky_op.cc b/tensorflow/core/kernels/cholesky_op.cc
index f5d53cca45..a3e3d3fc3d 100644
--- a/tensorflow/core/kernels/cholesky_op.cc
+++ b/tensorflow/core/kernels/cholesky_op.cc
@@ -16,10 +16,11 @@
namespace tensorflow {
template <class Scalar, bool SupportsBatchOperationT>
-class CholeskyOp : public LinearAlgebraOp<Scalar, SupportsBatchOperationT> {
+class CholeskyOp
+ : public UnaryLinearAlgebraOp<Scalar, SupportsBatchOperationT> {
public:
explicit CholeskyOp(OpKernelConstruction* context)
- : LinearAlgebraOp<Scalar, SupportsBatchOperationT>(context) {}
+ : UnaryLinearAlgebraOp<Scalar, SupportsBatchOperationT>(context) {}
TensorShape GetOutputMatrixShape(
const TensorShape& input_matrix_shape) override {
@@ -36,9 +37,10 @@ class CholeskyOp : public LinearAlgebraOp<Scalar, SupportsBatchOperationT> {
}
}
- using typename LinearAlgebraOp<Scalar, SupportsBatchOperationT>::MatrixMap;
using
- typename LinearAlgebraOp<Scalar, SupportsBatchOperationT>::ConstMatrixMap;
+ typename UnaryLinearAlgebraOp<Scalar, SupportsBatchOperationT>::MatrixMap;
+ using typename UnaryLinearAlgebraOp<Scalar,
+ SupportsBatchOperationT>::ConstMatrixMap;
void ComputeMatrix(OpKernelContext* context, const ConstMatrixMap& input,
MatrixMap* output) override {
diff --git a/tensorflow/core/kernels/conv_2d.h b/tensorflow/core/kernels/conv_2d.h
index 8313e6e670..3202da6902 100644
--- a/tensorflow/core/kernels/conv_2d.h
+++ b/tensorflow/core/kernels/conv_2d.h
@@ -184,6 +184,24 @@ struct PadInput {
}
};
+template <typename Device, typename T>
+struct NHWCToNCHW {
+ void operator()(const Device& d, typename TTypes<T, 4>::ConstTensor in,
+ typename TTypes<T, 4>::Tensor out);
+};
+
+template <typename Device, typename T>
+struct NCHWToNHWC {
+ void operator()(const Device& d, typename TTypes<T, 4>::ConstTensor in,
+ typename TTypes<T, 4>::Tensor out);
+};
+
+template <typename Device, typename T>
+struct ReverseTransformFilter {
+ void operator()(const Device& d, typename TTypes<T, 4>::ConstTensor in,
+ typename TTypes<T, 4>::Tensor out);
+};
+
} // namespace functor
} // namespace tensorflow
diff --git a/tensorflow/core/kernels/conv_grad_ops.cc b/tensorflow/core/kernels/conv_grad_ops.cc
index 98772e4e63..cc046a1061 100644
--- a/tensorflow/core/kernels/conv_grad_ops.cc
+++ b/tensorflow/core/kernels/conv_grad_ops.cc
@@ -15,6 +15,7 @@
#include "tensorflow/core/public/tensor_shape.h"
#include "tensorflow/core/util/padding.h"
#include "tensorflow/core/util/use_cudnn.h"
+#include "tensorflow/core/util/work_sharder.h"
#if GOOGLE_CUDA
#include "tensorflow/stream_executor/stream.h"
@@ -593,19 +594,29 @@ class Conv2DCustomBackpropFilterOp : public OpKernel {
contract_dims[0].first = 0;
contract_dims[0].second = 0;
+ auto worker_threads = *(context->device()->tensorflow_cpu_worker_threads());
+
for (int image_id = 0; image_id < batch; image_id += shard_size) {
const int shard_limit = std::min(static_cast<int>(shard_size),
static_cast<int>(batch) - image_id);
- for (int shard_id = 0; shard_id < shard_limit; ++shard_id) {
- // TODO(andydavis) Parallelize this loop.
- // When we compute the gradient with respect to the filters, we need
- // to do im2col to allow gemm-type computation.
- Im2col<T>(input_data, in_depth, input_rows, input_cols, filter_rows,
- filter_cols, pad_top, pad_left, pad_bottom, pad_right, stride,
- stride, col_buffer_data + shard_id * size_A);
-
- input_data += input_offset;
- }
+
+ auto shard = [&input_data, &col_buffer_data, &in_depth, &input_rows,
+ &input_cols, &filter_rows, &filter_cols, &pad_top,
+ &pad_left, &pad_bottom, &pad_right, &stride, &input_offset,
+ &size_A](int64 start, int64 limit) {
+ for (int shard_id = start; shard_id < limit; ++shard_id) {
+ auto input_data_shard = input_data + shard_id * input_offset;
+ auto col_data_shard = col_buffer_data + shard_id * size_A;
+
+ // When we compute the gradient with respect to the filters, we need
+ // to do im2col to allow gemm-type computation.
+ Im2col<T>(input_data_shard, in_depth, input_rows, input_cols,
+ filter_rows, filter_cols, pad_top, pad_left, pad_bottom,
+ pad_right, stride, stride, col_data_shard);
+ }
+ };
+ Shard(worker_threads.num_threads, worker_threads.workers, shard_limit,
+ size_A, shard);
ConstTensorMap A(col_buffer_data, output_image_size * shard_limit,
filter_total_size);
@@ -615,6 +626,7 @@ class Conv2DCustomBackpropFilterOp : public OpKernel {
// Gradient with respect to filter.
C.device(context->eigen_cpu_device()) += A.contract(B, contract_dims);
+ input_data += input_offset * shard_limit;
out_backprop_data += output_offset * shard_limit;
}
}
@@ -795,10 +807,9 @@ class Conv2DSlowBackpropInputOp : public OpKernel {
TensorShape({batch, out_depth, output_rows, output_cols}),
&transformed_out_backprop));
- functor::TransformDepth<Device, T, int>()(
- context->eigen_device<Device>(), To32Bit(out_backprop.tensor<T, 4>()),
- Eigen::DSizes<int, 4>(0, 3, 1, 2),
- To32Bit(transformed_out_backprop.tensor<T, 4>()));
+ functor::NHWCToNCHW<Device, T>()(context->eigen_device<Device>(),
+ out_backprop.tensor<T, 4>(),
+ transformed_out_backprop.tensor<T, 4>());
Tensor pre_transformed_in_backprop;
OP_REQUIRES_OK(context,
@@ -831,12 +842,10 @@ class Conv2DSlowBackpropInputOp : public OpKernel {
}
auto toConstTensor = [](const Tensor& x) -> const Tensor { return x; };
- functor::TransformDepth<Device, T, int>()(
+ functor::NCHWToNHWC<Device, T>()(
context->eigen_device<Device>(),
- To32Bit(toConstTensor(pre_transformed_in_backprop)
- .template tensor<T, 4>()),
- Eigen::DSizes<int, 4>(0, 2, 3, 1),
- To32Bit(in_backprop->tensor<T, 4>()));
+ toConstTensor(pre_transformed_in_backprop).template tensor<T, 4>(),
+ in_backprop->tensor<T, 4>());
} else {
// We fill out a padded out_backprop
TensorShape padded_out_shape(
@@ -1033,11 +1042,9 @@ class Conv2DSlowBackpropFilterOp : public OpKernel {
DataTypeToEnum<T>::value,
TensorShape({batch, out_depth, output_rows, output_cols}),
&transformed_out_backprop));
-
- functor::TransformDepth<Device, T, int>()(
- context->eigen_device<Device>(), To32Bit(out_backprop.tensor<T, 4>()),
- Eigen::DSizes<int, 4>(0, 3, 1, 2),
- To32Bit(transformed_out_backprop.tensor<T, 4>()));
+ functor::NHWCToNCHW<Device, T>()(context->eigen_device<Device>(),
+ out_backprop.tensor<T, 4>(),
+ transformed_out_backprop.tensor<T, 4>());
Tensor transformed_input;
OP_REQUIRES_OK(context,
@@ -1045,11 +1052,9 @@ class Conv2DSlowBackpropFilterOp : public OpKernel {
DataTypeToEnum<T>::value,
TensorShape({batch, in_depth, input_rows, input_cols}),
&transformed_input));
-
- functor::TransformDepth<Device, T, int>()(
- context->eigen_device<Device>(), To32Bit(input.tensor<T, 4>()),
- Eigen::DSizes<int, 4>(0, 3, 1, 2),
- To32Bit(transformed_input.tensor<T, 4>()));
+ functor::NHWCToNCHW<Device, T>()(context->eigen_device<Device>(),
+ input.tensor<T, 4>(),
+ transformed_input.tensor<T, 4>());
auto out_backprop_ptr =
AsDeviceMemory(transformed_out_backprop.template flat<T>().data(),
@@ -1075,12 +1080,11 @@ class Conv2DSlowBackpropFilterOp : public OpKernel {
}
auto toConstTensor = [](const Tensor& x) -> const Tensor { return x; };
- functor::TransformDepth<Device, T, int>()(
+ functor::ReverseTransformFilter<Device, T>()(
context->eigen_device<Device>(),
- To32Bit(toConstTensor(pre_transformed_filter_backprop)
- .template tensor<T, 4>()),
- Eigen::DSizes<int, 4>(2, 3, 1, 0),
- To32Bit(filter_backprop->tensor<T, 4>()));
+ toConstTensor(pre_transformed_filter_backprop)
+ .template tensor<T, 4>(),
+ filter_backprop->tensor<T, 4>());
} else {
// Fall back to the non-cudnn code path
diff --git a/tensorflow/core/kernels/conv_ops_gpu_3.cu.cc b/tensorflow/core/kernels/conv_ops_gpu_3.cu.cc
index 77d3a68f34..0956cee491 100644
--- a/tensorflow/core/kernels/conv_ops_gpu_3.cu.cc
+++ b/tensorflow/core/kernels/conv_ops_gpu_3.cu.cc
@@ -2,25 +2,255 @@
#define EIGEN_USE_GPU
-#include "tensorflow/core/kernels/conv_2d.h"
+#include <algorithm>
#include "tensorflow/core/framework/register_types.h"
+#include "tensorflow/core/kernels/conv_2d.h"
+#include "tensorflow/core/util/cuda_kernel_helper.h"
namespace tensorflow {
typedef Eigen::GpuDevice GPUDevice;
+
+namespace functor {
+
+// A simple array that contains data that can be passed between CPU and GPU.
+template <typename T, int IndexCount>
+struct Array {
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const T& operator[](int index) const {
+ return data[index];
+ }
+ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T& operator[](int index) {
+ return data[index];
+ }
+ int data[IndexCount];
+};
+
+// A dimension type with compile-time known size.
+template <int IndexCount>
+struct Dimension : Array<int, IndexCount> {};
+
+// An index type with compile-time known size.
+template <int IndexCount>
+struct Index : Array<int, IndexCount> {};
+
+// A helper function that converts a tensor index into a flat array index.
+template <int IndexCount>
+EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE int TensorIndexToFlat(
+ const Index<IndexCount>& index, const Dimension<IndexCount>& dims) {
+ int flat_index = index[0];
+ for (int i = 1; i < IndexCount; i++) {
+ flat_index = flat_index * dims[i] + index[i];
+ }
+ return flat_index;
+}
+
+// A helper function that converts a flat arrary index into a tensor index.
+template <int IndexCount>
+EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index<IndexCount> FlatToTensorIndex(
+ int index, const Dimension<IndexCount>& dims) {
+ Index<IndexCount> tensor_index;
+ for (int i = IndexCount - 1; i >= 0; i--) {
+ tensor_index[i] = index % dims[i];
+ index /= dims[i];
+ }
+ return tensor_index;
+}
+
+// A Cuda custom kernel that swaps dimension-0 and dimension-2 of a 3D tensor.
+template <typename T>
+__global__ void SwapDimension0And2InTensor3(int nthreads, const T* input,
+ Dimension<3> input_dims,
+ T* output) {
+ Dimension<3> output_dims;
+ output_dims[0] = input_dims[2];
+ output_dims[1] = input_dims[1];
+ output_dims[2] = input_dims[0];
+
+ CUDA_1D_KERNEL_LOOP(index, nthreads) {
+ int output_index = index;
+
+ Index<3> output_tensor_index = FlatToTensorIndex(output_index, output_dims);
+
+ Index<3> input_tensor_index;
+ input_tensor_index[0] = output_tensor_index[2];
+ input_tensor_index[1] = output_tensor_index[1];
+ input_tensor_index[2] = output_tensor_index[0];
+
+ int input_index = TensorIndexToFlat(input_tensor_index, input_dims);
+
+ output[output_index] = input[input_index];
+ }
+}
+
+// A Cuda custom kernel that swaps dimension-1 and dimension-2 of a 3D tensor.
+template <typename T>
+__global__ void SwapDimension1And2InTensor3(int nthreads, const T* input,
+ Dimension<3> input_dims,
+ T* output) {
+ Dimension<3> output_dims;
+ output_dims[0] = input_dims[0];
+ output_dims[1] = input_dims[2];
+ output_dims[2] = input_dims[1];
+
+ CUDA_1D_KERNEL_LOOP(index, nthreads) {
+ int output_index = index;
+ Index<3> output_tensor_index = FlatToTensorIndex(output_index, output_dims);
+
+ Index<3> input_tensor_index;
+ input_tensor_index[0] = output_tensor_index[0];
+ input_tensor_index[1] = output_tensor_index[2];
+ input_tensor_index[2] = output_tensor_index[1];
+
+ int input_index = TensorIndexToFlat(input_tensor_index, input_dims);
+
+ output[output_index] = input[input_index];
+ }
+}
+
+// A Cuda custom kernel that converst input to output, given proper padding on
+// the left and the top. The padded value is zero.
+template <typename T>
+__global__ void PadInputCustomKernel(int nthreads, const T* input,
+ Dimension<4> input_dims, T* output,
+ Dimension<4> output_dims,
+ int padding_rows_left,
+ int padding_cols_left) {
+ CUDA_1D_KERNEL_LOOP(index, nthreads) {
+ int output_index = index;
+ Index<4> output_tensor_index = FlatToTensorIndex(output_index, output_dims);
+
+ Index<4> input_tensor_index;
+ input_tensor_index[0] = output_tensor_index[0];
+ input_tensor_index[1] = output_tensor_index[1] - padding_rows_left;
+ input_tensor_index[2] = output_tensor_index[2] - padding_cols_left;
+ input_tensor_index[3] = output_tensor_index[3];
+
+ if (input_tensor_index[1] >= 0 && input_tensor_index[1] < input_dims[1] &&
+ input_tensor_index[2] >= 0 && input_tensor_index[2] < input_dims[2]) {
+ int input_index = TensorIndexToFlat(input_tensor_index, input_dims);
+ output[output_index] = input[input_index];
+ } else {
+ output[output_index] = 0;
+ }
+ }
+}
+
+// A GPU helper function that converts TensorFlow filter format to Cudnn filter
+// format.
+template <typename T>
+struct TransformFilter<GPUDevice, T, int> {
+ typedef GPUDevice Device;
+ void operator()(const Device& d, typename TTypes<T, 4, int>::ConstTensor in,
+ typename TTypes<T, 4, int>::Tensor out) {
+ Dimension<3> combined_dims;
+ combined_dims[0] = in.dimension(0) * in.dimension(1);
+ combined_dims[1] = in.dimension(2);
+ combined_dims[2] = in.dimension(3);
+ CudaLaunchConfig config = GetCudaLaunchConfig(out.size(), d);
+ SwapDimension0And2InTensor3<
+ T><<<config.block_count, config.thread_per_block, 0, d.stream()>>>(
+ config.virtual_thread_count, in.data(), combined_dims, out.data());
+ }
+};
+
+// Converts Cudnn filter format back to TensorFlow filter format.
+template <typename T>
+struct ReverseTransformFilter<GPUDevice, T> {
+ typedef GPUDevice Device;
+ void operator()(const Device& d, typename TTypes<T, 4>::ConstTensor in,
+ typename TTypes<T, 4>::Tensor out) {
+ Dimension<3> combined_dims;
+ combined_dims[0] = in.dimension(0);
+ combined_dims[1] = in.dimension(1);
+ combined_dims[2] = in.dimension(2) * in.dimension(3);
+ CudaLaunchConfig config = GetCudaLaunchConfig(out.size(), d);
+ SwapDimension0And2InTensor3<
+ T><<<config.block_count, config.thread_per_block, 0, d.stream()>>>(
+ config.virtual_thread_count, in.data(), combined_dims, out.data());
+ }
+};
+
+// A GPU helper function that converts input tensor to a larger output tensor,
+// given proper padding values. The padded value is zero.
+template <typename T>
+struct PadInput<GPUDevice, T, int> {
+ typedef GPUDevice Device;
+ void operator()(const Device& d, typename TTypes<T, 4, int>::ConstTensor in,
+ int padding_rows_left, int padding_rows_right,
+ int padding_cols_left, int padding_cols_right,
+ typename TTypes<T, 4, int>::Tensor out) {
+ CudaLaunchConfig config = GetCudaLaunchConfig(out.size(), d);
+ Dimension<4> input_dims;
+ for (int i = 0; i < 4; i++) {
+ input_dims[i] = in.dimension(i);
+ }
+ Dimension<4> output_dims;
+ for (int i = 0; i < 4; i++) {
+ output_dims[i] = out.dimension(i);
+ }
+
+ PadInputCustomKernel<
+ T><<<config.block_count, config.thread_per_block, 0, d.stream()>>>(
+ config.virtual_thread_count, in.data(), input_dims, out.data(),
+ output_dims, padding_rows_left, padding_cols_left);
+ }
+};
+
+// A GPU helper functor that converts NHWC TensorFlow data format to
+// NCHW format that is accepted by Cudnn.
+template <typename T>
+struct NHWCToNCHW<GPUDevice, T> {
+ typedef GPUDevice Device;
+ void operator()(const Device& d, typename TTypes<T, 4>::ConstTensor in,
+ typename TTypes<T, 4>::Tensor out) {
+ Dimension<3> combined_dims;
+ combined_dims[0] = in.dimension(0);
+ combined_dims[1] = in.dimension(1) * in.dimension(2);
+ combined_dims[2] = in.dimension(3);
+ CudaLaunchConfig config = GetCudaLaunchConfig(out.size(), d);
+ SwapDimension1And2InTensor3<
+ T><<<config.block_count, config.thread_per_block, 0, d.stream()>>>(
+ config.virtual_thread_count, in.data(), combined_dims, out.data());
+ }
+};
+
+// A GPU helper functor that converts NCHW Cudnn data format to NHWC TensorFlow
+// Format.
+template <typename T>
+struct NCHWToNHWC<GPUDevice, T> {
+ typedef GPUDevice Device;
+ void operator()(const Device& d, typename TTypes<T, 4>::ConstTensor in,
+ typename TTypes<T, 4>::Tensor out) {
+ Dimension<3> combined_dims;
+ combined_dims[0] = in.dimension(0);
+ combined_dims[1] = in.dimension(1);
+ combined_dims[2] = in.dimension(2) * in.dimension(3);
+ CudaLaunchConfig config = GetCudaLaunchConfig(out.size(), d);
+ SwapDimension1And2InTensor3<
+ T><<<config.block_count, config.thread_per_block, 0, d.stream()>>>(
+ config.virtual_thread_count, in.data(), combined_dims, out.data());
+ }
+};
+
+} // namespace functor
+
template struct functor::ShuffleAndReverse<GPUDevice, float, 4, int>;
+
template struct functor::ShuffleAndReverse<GPUDevice, float, 4,
Eigen::DenseIndex>;
template struct functor::TransformFilter<GPUDevice, float, int>;
+template struct functor::ReverseTransformFilter<GPUDevice, float>;
+
template struct functor::PadInput<GPUDevice, float, int>;
template struct functor::TransformDepth<GPUDevice, float, int>;
-// TODO(jiayq): currently pooling ops still use DenseIndex, so I am keeping it
-// here.
-template struct functor::TransformDepth<GPUDevice, float, Eigen::DenseIndex>;
+
+template struct functor::NHWCToNCHW<GPUDevice, float>;
+
+template struct functor::NCHWToNHWC<GPUDevice, float>;
} // namespace tensorflow
diff --git a/tensorflow/core/kernels/determinant_op.cc b/tensorflow/core/kernels/determinant_op.cc
index 7bd4c1ceb5..17bb69a7c5 100644
--- a/tensorflow/core/kernels/determinant_op.cc
+++ b/tensorflow/core/kernels/determinant_op.cc
@@ -13,10 +13,11 @@
namespace tensorflow {
template <class Scalar, bool SupportsBatchOperationT>
-class DeterminantOp : public LinearAlgebraOp<Scalar, SupportsBatchOperationT> {
+class DeterminantOp
+ : public UnaryLinearAlgebraOp<Scalar, SupportsBatchOperationT> {
public:
explicit DeterminantOp(OpKernelConstruction* context)
- : LinearAlgebraOp<Scalar, SupportsBatchOperationT>(context) {}
+ : UnaryLinearAlgebraOp<Scalar, SupportsBatchOperationT>(context) {}
~DeterminantOp() override {}
TensorShape GetOutputMatrixShape(
@@ -34,9 +35,10 @@ class DeterminantOp : public LinearAlgebraOp<Scalar, SupportsBatchOperationT> {
}
}
- using typename LinearAlgebraOp<Scalar, SupportsBatchOperationT>::MatrixMap;
using
- typename LinearAlgebraOp<Scalar, SupportsBatchOperationT>::ConstMatrixMap;
+ typename UnaryLinearAlgebraOp<Scalar, SupportsBatchOperationT>::MatrixMap;
+ using typename UnaryLinearAlgebraOp<Scalar,
+ SupportsBatchOperationT>::ConstMatrixMap;
void ComputeMatrix(OpKernelContext* context, const ConstMatrixMap& input,
MatrixMap* output) override {
diff --git a/tensorflow/core/kernels/in_topk_op.cc b/tensorflow/core/kernels/in_topk_op.cc
index d5866b437f..c755674bd0 100644
--- a/tensorflow/core/kernels/in_topk_op.cc
+++ b/tensorflow/core/kernels/in_topk_op.cc
@@ -9,7 +9,7 @@
namespace tensorflow {
-template <typename T>
+template <typename T, typename TARGET_T>
class InTopK : public OpKernel {
public:
explicit InTopK(OpKernelConstruction* context) : OpKernel(context) {
@@ -29,7 +29,7 @@ class InTopK : public OpKernel {
" must match length of targets ",
targets_in.dim_size(0)));
const auto& predictions = predictions_in.matrix<T>();
- const auto& targets = targets_in.vec<int>();
+ const auto& targets = targets_in.vec<TARGET_T>();
Tensor* t_out = nullptr;
OP_REQUIRES_OK(context,
@@ -53,6 +53,13 @@ class InTopK : public OpKernel {
int k_;
};
-REGISTER_KERNEL_BUILDER(Name("InTopK").Device(DEVICE_CPU), InTopK<float>);
+REGISTER_KERNEL_BUILDER(Name("InTopK")
+ .Device(DEVICE_CPU)
+ .TypeConstraint<int32>("T"),
+ InTopK<float, int32>);
+REGISTER_KERNEL_BUILDER(Name("InTopK")
+ .Device(DEVICE_CPU)
+ .TypeConstraint<int64>("T"),
+ InTopK<float, int64>);
} // namespace tensorflow
diff --git a/tensorflow/core/kernels/linalg_ops_common.cc b/tensorflow/core/kernels/linalg_ops_common.cc
index 93342a7a24..df8047564b 100644
--- a/tensorflow/core/kernels/linalg_ops_common.cc
+++ b/tensorflow/core/kernels/linalg_ops_common.cc
@@ -2,29 +2,23 @@
namespace tensorflow {
-void LinearAlgebraOpBase::Compute(OpKernelContext* context) {
+void UnaryLinearAlgebraOpBase::Compute(OpKernelContext* context) {
const Tensor& in = context->input(0);
- const int input_rank = GetInputMatrixRank();
- OP_REQUIRES(
- context, input_rank == 2,
- errors::InvalidArgument("Only matrix inputs are supported so far."));
+ const int input_rank = in.dims();
if (SupportsBatchOperation()) {
- OP_REQUIRES(context, in.dims() > input_rank,
- errors::InvalidArgument("Input tensor must have rank >= %d",
- input_rank + 1));
+ OP_REQUIRES(context, input_rank >= 2,
+ errors::InvalidArgument("Input tensor must have rank >= 2"));
} else {
- OP_REQUIRES(context, in.dims() == input_rank,
- errors::InvalidArgument("Input tensor must have rank == %d",
- input_rank));
+ OP_REQUIRES(context, input_rank == 2,
+ errors::InvalidArgument("Input tensor must have rank == 2"));
}
// If the tensor rank is greater than input_rank, we consider the inner-most
// dimensions as matrices, and loop over all the other outer
// dimensions to compute the results.
- // TODO(kalakris): Only matrix inputs are currently supported.
- const int row_dimension = in.dims() - 2;
- const int col_dimension = in.dims() - 1;
+ const int row_dimension = input_rank - 2;
+ const int col_dimension = input_rank - 1;
const int64 num_rows = in.dim_size(row_dimension);
const int64 num_cols = in.dim_size(col_dimension);
const TensorShape input_matrix_shape = TensorShape({num_rows, num_cols});
@@ -36,16 +30,19 @@ void LinearAlgebraOpBase::Compute(OpKernelContext* context) {
int num_matrices = 1;
// The output has the shape of all the outer dimensions of the input
// except for the last two, plus the output_matrix_shape (if the output
- // is not scalar). This still assumes that each input matrix is
- // 2-dimensional, in accordance with the TODO above.
+ // is not scalar). This assumes that each input matrix is
+ // 2-dimensional.
TensorShape output_shape;
- if (in.dims() == 2) {
+ if (input_rank == 2) {
output_shape = output_matrix_shape;
} else {
- for (int dim = 0; dim <= in.dims() - 3; ++dim) {
+ // Add the common outer dimensions.
+ for (int dim = 0; dim < input_rank - 2; ++dim) {
num_matrices *= in.dim_size(dim);
output_shape.AddDim(in.dim_size(dim));
}
+ // Add the inner dimensions that depend on the operation implemented by the
+ // derived class.
for (int dim = 0; dim < output_matrix_shape.dims(); ++dim) {
output_shape.AddDim(output_matrix_shape.dim_size(dim));
}
@@ -68,7 +65,7 @@ void LinearAlgebraOpBase::Compute(OpKernelContext* context) {
}
template <typename Scalar, bool SupportsBatchOperationT>
-void LinearAlgebraOp<Scalar, SupportsBatchOperationT>::ComputeMatrix(
+void UnaryLinearAlgebraOp<Scalar, SupportsBatchOperationT>::ComputeMatrix(
OpKernelContext* context, int64 matrix_index, const Tensor& in,
const TensorShape& input_matrix_shape, Tensor* out,
const TensorShape& output_matrix_shape) {
@@ -90,10 +87,11 @@ void LinearAlgebraOp<Scalar, SupportsBatchOperationT>::ComputeMatrix(
ComputeMatrix(context, input, &output);
}
-// Explicitly instantiate LinearAlgebraOp for the scalar types we expect to use.
-template class LinearAlgebraOp<float, false>;
-template class LinearAlgebraOp<float, true>;
-template class LinearAlgebraOp<double, false>;
-template class LinearAlgebraOp<double, true>;
+// Explicitly instantiate UnaryLinearAlgebraOp for the scalar types we expect to
+// use.
+template class UnaryLinearAlgebraOp<float, false>;
+template class UnaryLinearAlgebraOp<float, true>;
+template class UnaryLinearAlgebraOp<double, false>;
+template class UnaryLinearAlgebraOp<double, true>;
} // namespace tensorflow
diff --git a/tensorflow/core/kernels/linalg_ops_common.h b/tensorflow/core/kernels/linalg_ops_common.h
index 80d485a8aa..b0ec94d90b 100644
--- a/tensorflow/core/kernels/linalg_ops_common.h
+++ b/tensorflow/core/kernels/linalg_ops_common.h
@@ -1,6 +1,10 @@
#ifndef TENSORFLOW_KERNELS_LINALG_OPS_COMMON_H_
#define TENSORFLOW_KERNELS_LINALG_OPS_COMMON_H_
+// Classes to support linear algebra functionality, similar to the numpy.linalg
+// module. Supports batch computation on several matrices at once, sharding the
+// computations across different threads if necessary.
+
#define EIGEN_USE_THREADS
#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor"
@@ -16,21 +20,12 @@
namespace tensorflow {
-// A base class to support linear algebra functionality, similar to the
-// numpy.linalg module. Supports batch computation on several matrices at once,
-// sharding the computations across different threads if necessary.
-//
-// TODO(kalakris): This needs to be expanded to support binary inputs, and
-// multiple outputs.
-class LinearAlgebraOpBase : public OpKernel {
+// Base class for unary linear algebra operators.
+class UnaryLinearAlgebraOpBase : public OpKernel {
public:
- explicit LinearAlgebraOpBase(OpKernelConstruction* context)
+ explicit UnaryLinearAlgebraOpBase(OpKernelConstruction* context)
: OpKernel(context) {}
- ~LinearAlgebraOpBase() override {}
-
- // Return the expected rank of the input.
- // TODO(kalakris): This should be a virtual function to support vector inputs.
- int GetInputMatrixRank() { return 2; }
+ ~UnaryLinearAlgebraOpBase() override {}
// Return the output shape of each individual matrix operation. Must be
// rank 0, 1, or 2. Scalar outputs are rank 0.
@@ -62,7 +57,8 @@ class LinearAlgebraOpBase : public OpKernel {
// address
// out->flat<Scalar>().data() +
// matrix_index * output_matrix_shape.num_elements().
- // The LinearAlgebraOp<Scalar> class below has functionality which performs
+ // The UnaryLinearAlgebraOp<Scalar> class below has functionality which
+ // performs
// this mapping and presents an interface based on the Eigen::MatrixBase API.
virtual void ComputeMatrix(OpKernelContext* context, int64 matrix_index,
const Tensor& in,
@@ -72,8 +68,6 @@ class LinearAlgebraOpBase : public OpKernel {
void Compute(OpKernelContext* context) override;
};
-// A base class for linear algebra ops templated on the scalar type.
-//
// This base class encapsulates the functionality of mapping the input and
// output tensors using Eigen::Map, so that the Eigen::MatrixBase API may be
// directly used by derived classes.
@@ -81,10 +75,10 @@ class LinearAlgebraOpBase : public OpKernel {
// will allow the Op to process batches of matrices (rank >= 3); if set to
// false the Op will only accept rank 2 inputs.
template <typename Scalar, bool SupportsBatchOperationT>
-class LinearAlgebraOp : public LinearAlgebraOpBase {
+class UnaryLinearAlgebraOp : public UnaryLinearAlgebraOpBase {
public:
- explicit LinearAlgebraOp(OpKernelConstruction* context)
- : LinearAlgebraOpBase(context) {}
+ explicit UnaryLinearAlgebraOp(OpKernelConstruction* context)
+ : UnaryLinearAlgebraOpBase(context) {}
using Matrix =
Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>;
@@ -100,18 +94,18 @@ class LinearAlgebraOp : public LinearAlgebraOpBase {
bool SupportsBatchOperation() final { return SupportsBatchOperationT; }
- // A concrete implementation of LinearAlgebraOpBase::ComputeMatrix().
+ // A concrete implementation of UnaryLinearAlgebraOpBase::ComputeMatrix().
void ComputeMatrix(OpKernelContext* context, int64 matrix_index,
const Tensor& in, const TensorShape& input_matrix_shape,
Tensor* out, const TensorShape& output_matrix_shape) final;
};
-// Declare that LinearAlgebraOp is explicitly instantiated in
+// Declare that UnaryLinearAlgebraOp is explicitly instantiated in
// linalg_ops_common.cc for float and double.
-extern template class LinearAlgebraOp<float, false>;
-extern template class LinearAlgebraOp<float, true>;
-extern template class LinearAlgebraOp<double, false>;
-extern template class LinearAlgebraOp<double, true>;
+extern template class UnaryLinearAlgebraOp<float, false>;
+extern template class UnaryLinearAlgebraOp<float, true>;
+extern template class UnaryLinearAlgebraOp<double, false>;
+extern template class UnaryLinearAlgebraOp<double, true>;
} // namespace tensorflow
diff --git a/tensorflow/core/kernels/matrix_inverse_op.cc b/tensorflow/core/kernels/matrix_inverse_op.cc
index 6fe763aae9..307c94e66b 100644
--- a/tensorflow/core/kernels/matrix_inverse_op.cc
+++ b/tensorflow/core/kernels/matrix_inverse_op.cc
@@ -15,10 +15,10 @@ namespace tensorflow {
template <class Scalar, bool SupportsBatchOperationT>
class MatrixInverseOp
- : public LinearAlgebraOp<Scalar, SupportsBatchOperationT> {
+ : public UnaryLinearAlgebraOp<Scalar, SupportsBatchOperationT> {
public:
explicit MatrixInverseOp(OpKernelConstruction* context)
- : LinearAlgebraOp<Scalar, SupportsBatchOperationT>(context) {}
+ : UnaryLinearAlgebraOp<Scalar, SupportsBatchOperationT>(context) {}
~MatrixInverseOp() override {}
TensorShape GetOutputMatrixShape(
@@ -36,10 +36,11 @@ class MatrixInverseOp
}
}
- using typename LinearAlgebraOp<Scalar, SupportsBatchOperationT>::Matrix;
- using typename LinearAlgebraOp<Scalar, SupportsBatchOperationT>::MatrixMap;
+ using typename UnaryLinearAlgebraOp<Scalar, SupportsBatchOperationT>::Matrix;
using
- typename LinearAlgebraOp<Scalar, SupportsBatchOperationT>::ConstMatrixMap;
+ typename UnaryLinearAlgebraOp<Scalar, SupportsBatchOperationT>::MatrixMap;
+ using typename UnaryLinearAlgebraOp<Scalar,
+ SupportsBatchOperationT>::ConstMatrixMap;
void ComputeMatrix(OpKernelContext* context, const ConstMatrixMap& input,
MatrixMap* output) override {
diff --git a/tensorflow/core/kernels/pad_op.cc b/tensorflow/core/kernels/pad_op.cc
index e827e1e880..3f0a7a8a52 100644
--- a/tensorflow/core/kernels/pad_op.cc
+++ b/tensorflow/core/kernels/pad_op.cc
@@ -156,4 +156,15 @@ TF_CALL_GPU_NUMBER_TYPES(DECLARE_GPU_SPECS);
TF_CALL_GPU_NUMBER_TYPES(REGISTER_GPU_KERNEL);
#endif // GOOGLE_CUDA
+// A special GPU kernel for int32.
+// TODO(b/25387198): Also enable int32 in device memory. This kernel
+// registration requires all int32 inputs and outputs to be in host memory.
+REGISTER_KERNEL_BUILDER(Name("Pad")
+ .Device(DEVICE_GPU)
+ .TypeConstraint<int32>("T")
+ .HostMemory("input")
+ .HostMemory("paddings")
+ .HostMemory("output"),
+ PadOp<CPUDevice, int32>);
+
} // end namespace tensorflow
diff --git a/tensorflow/core/kernels/pooling_ops_common.cc b/tensorflow/core/kernels/pooling_ops_common.cc
index 2f4ecb4891..d888815def 100644
--- a/tensorflow/core/kernels/pooling_ops_common.cc
+++ b/tensorflow/core/kernels/pooling_ops_common.cc
@@ -167,26 +167,25 @@ void DnnPoolingGradOp<T>::Compute(
out_backprop.dim_size(1), out_backprop.dim_size(2)}),
&transformed_output_backprop));
- auto nhwc_to_nchw = Eigen::DSizes<Eigen::DenseIndex, 4>(0, 3, 1, 2);
if (tensor_in) {
// For AvgPoolGrad, the original input tensor is not necessary. However,
// cudnn still requires them to run, although they do not affect the
// results.
- functor::TransformDepth<GPUDevice, T, Eigen::DenseIndex>()(
- context->eigen_device<Device>(), tensor_in->tensor<T, 4>(),
- nhwc_to_nchw, transformed_input.tensor<T, 4>());
+ functor::NHWCToNCHW<GPUDevice, T>()(context->eigen_device<Device>(),
+ tensor_in->tensor<T, 4>(),
+ transformed_input.tensor<T, 4>());
}
if (tensor_out) {
// For AvgPoolGrad, the original output tensor is not necessary. However,
// cudnn still requires them to run, although they do not affect the
// results.
- functor::TransformDepth<GPUDevice, T, Eigen::DenseIndex>()(
- context->eigen_device<Device>(), tensor_out->tensor<T, 4>(),
- nhwc_to_nchw, transformed_output.tensor<T, 4>());
+ functor::NHWCToNCHW<GPUDevice, T>()(context->eigen_device<Device>(),
+ tensor_out->tensor<T, 4>(),
+ transformed_output.tensor<T, 4>());
}
- functor::TransformDepth<GPUDevice, T, Eigen::DenseIndex>()(
+ functor::NHWCToNCHW<GPUDevice, T>()(
context->eigen_device<Device>(), out_backprop.tensor<T, 4>(),
- nhwc_to_nchw, transformed_output_backprop.tensor<T, 4>());
+ transformed_output_backprop.tensor<T, 4>());
/// Get ready to call cudnn
perftools::gputools::dnn::PoolingDescriptor pooling_desc;
@@ -238,11 +237,10 @@ void DnnPoolingGradOp<T>::Compute(
/// Transform the output data from NCHW back to NHWC
auto toConstTensor = [](const Tensor& x) -> const Tensor { return x; };
- auto nchw_to_nhwc = Eigen::DSizes<Eigen::DenseIndex, 4>(0, 2, 3, 1);
- functor::TransformDepth<GPUDevice, T, Eigen::DenseIndex>()(
+ functor::NCHWToNHWC<GPUDevice, T>()(
context->eigen_device<Device>(),
toConstTensor(transformed_input_backprop).template tensor<T, 4>(),
- nchw_to_nhwc, output->tensor<T, 4>());
+ output->tensor<T, 4>());
}
template class DnnPoolingGradOp<float>;
diff --git a/tensorflow/core/kernels/queue_ops.cc b/tensorflow/core/kernels/queue_ops.cc
index c70dc76777..69c1bf9849 100644
--- a/tensorflow/core/kernels/queue_ops.cc
+++ b/tensorflow/core/kernels/queue_ops.cc
@@ -111,7 +111,8 @@ class EnqueueManyOp : public QueueAccessOpKernel {
for (DataType dt : queue->component_dtypes()) {
expected_inputs.push_back(dt);
}
- OP_REQUIRES_OK(ctx, ctx->MatchSignature(expected_inputs, {}));
+ OP_REQUIRES_OK_ASYNC(ctx, ctx->MatchSignature(expected_inputs, {}),
+ callback);
QueueInterface::Tuple tuple;
OpInputList components;
diff --git a/tensorflow/core/kernels/shape_ops.cc b/tensorflow/core/kernels/shape_ops.cc
index 7cb1da8983..5edd43992e 100644
--- a/tensorflow/core/kernels/shape_ops.cc
+++ b/tensorflow/core/kernels/shape_ops.cc
@@ -72,7 +72,7 @@ REGISTER_KERNEL_BUILDER(Name("Rank").Device(DEVICE_CPU).HostMemory("output"),
TF_CALL_NUMBER_TYPES_NO_INT32(REGISTER_GPU_KERNEL);
#undef REGISTER_GPU_KERNEL
-// A special GPU kernel for int32.
+// A special GPU kernel for int32 and bool.
// TODO(b/25387198): Also enable int32 in device memory. This kernel
// registration requires all int32 inputs and outputs to be in host memory.
REGISTER_KERNEL_BUILDER(Name("Rank")
@@ -82,6 +82,13 @@ REGISTER_KERNEL_BUILDER(Name("Rank")
.HostMemory("output"),
RankOp);
+REGISTER_KERNEL_BUILDER(Name("Rank")
+ .Device(DEVICE_GPU)
+ .TypeConstraint<bool>("T")
+ .HostMemory("input")
+ .HostMemory("output"),
+ RankOp);
+
class SizeOp : public OpKernel {
public:
explicit SizeOp(OpKernelConstruction* ctx) : OpKernel(ctx) {}
diff --git a/tensorflow/core/kernels/summary_op.cc b/tensorflow/core/kernels/summary_op.cc
index 1c4be64b8b..61393e8315 100644
--- a/tensorflow/core/kernels/summary_op.cc
+++ b/tensorflow/core/kernels/summary_op.cc
@@ -54,6 +54,7 @@ REGISTER_KERNEL_BUILDER(Name("ScalarSummary")
.TypeConstraint<double>("T"),
SummaryScalarOp<double>);
+template <typename T>
class SummaryHistoOp : public OpKernel {
public:
// SummaryHistoOp could be extended to take a list of custom bucket
@@ -63,13 +64,13 @@ class SummaryHistoOp : public OpKernel {
void Compute(OpKernelContext* c) override {
const Tensor& tags = c->input(0);
const Tensor& values = c->input(1);
- const auto flat = values.flat<float>();
+ const auto flat = values.flat<T>();
OP_REQUIRES(c, TensorShapeUtils::IsLegacyScalar(tags.shape()),
errors::InvalidArgument("tags must be scalar"));
// Build histogram of values in "values" tensor
histogram::Histogram histo;
for (int64 i = 0; i < flat.size(); i++) {
- float v = flat(i);
+ T v = flat(i);
if (!std::isfinite(v)) {
c->SetStatus(
errors::OutOfRange("Nan in summary histogram for: ", name()));
@@ -89,8 +90,14 @@ class SummaryHistoOp : public OpKernel {
}
};
-REGISTER_KERNEL_BUILDER(Name("HistogramSummary").Device(DEVICE_CPU),
- SummaryHistoOp);
+REGISTER_KERNEL_BUILDER(Name("HistogramSummary")
+ .Device(DEVICE_CPU)
+ .TypeConstraint<float>("T"),
+ SummaryHistoOp<float>);
+REGISTER_KERNEL_BUILDER(Name("HistogramSummary")
+ .Device(DEVICE_CPU)
+ .TypeConstraint<double>("T"),
+ SummaryHistoOp<double>);
struct HistogramResource : public ResourceBase {
histogram::ThreadSafeHistogram histogram;
diff --git a/tensorflow/core/kernels/summary_op_test.cc b/tensorflow/core/kernels/summary_op_test.cc
index 4d32b11a63..3c9085f16c 100644
--- a/tensorflow/core/kernels/summary_op_test.cc
+++ b/tensorflow/core/kernels/summary_op_test.cc
@@ -122,17 +122,17 @@ TEST_F(SummaryScalarOpTest, Error_WrongDimsValues) {
// --------------------------------------------------------------------------
class SummaryHistoOpTest : public OpsTestBase {
protected:
- void MakeOp() {
+ void MakeOp(DataType dt) {
ASSERT_OK(NodeDefBuilder("myop", "HistogramSummary")
.Input(FakeInput())
- .Input(FakeInput())
+ .Input(FakeInput(dt))
.Finalize(node_def()));
ASSERT_OK(InitOp());
}
};
-TEST_F(SummaryHistoOpTest, Simple) {
- MakeOp();
+TEST_F(SummaryHistoOpTest, SimpleFloat) {
+ MakeOp(DT_FLOAT);
// Feed and run
AddInputFromArray<string>(TensorShape({}), {"taghisto"});
@@ -159,8 +159,36 @@ TEST_F(SummaryHistoOpTest, Simple) {
histo.ToString());
}
+TEST_F(SummaryHistoOpTest, SimpleDouble) {
+ MakeOp(DT_DOUBLE);
+
+ // Feed and run
+ AddInputFromArray<string>(TensorShape({}), {"taghisto"});
+ AddInputFromArray<double>(TensorShape({3, 2}), {0.1, -0.7, 4.1, 4., 5., 4.});
+ ASSERT_OK(RunOpKernel());
+
+ // Check the output size.
+ Tensor* out_tensor = GetOutput(0);
+ ASSERT_EQ(0, out_tensor->dims());
+ Summary summary;
+ ParseProtoUnlimited(&summary, out_tensor->scalar<string>()());
+ ASSERT_EQ(summary.value_size(), 1);
+ EXPECT_EQ(summary.value(0).tag(), "taghisto");
+ histogram::Histogram histo;
+ EXPECT_TRUE(histo.DecodeFromProto(summary.value(0).histo()));
+ EXPECT_EQ(
+ "Count: 6 Average: 2.7500 StdDev: 2.20\n"
+ "Min: -0.7000 Median: 3.9593 Max: 5.0000\n"
+ "------------------------------------------------------\n"
+ "[ -0.76, -0.69 ) 1 16.667% 16.667% ###\n"
+ "[ 0.093, 0.1 ) 1 16.667% 33.333% ###\n"
+ "[ 3.8, 4.2 ) 3 50.000% 83.333% ##########\n"
+ "[ 4.6, 5.1 ) 1 16.667% 100.000% ###\n",
+ histo.ToString());
+}
+
TEST_F(SummaryHistoOpTest, Error_WrongDimsTags) {
- MakeOp();
+ MakeOp(DT_FLOAT);
// Feed and run
AddInputFromArray<string>(TensorShape({2, 1}), {"tag1", "tag2"});
@@ -170,7 +198,7 @@ TEST_F(SummaryHistoOpTest, Error_WrongDimsTags) {
}
TEST_F(SummaryHistoOpTest, Error_TooManyTagValues) {
- MakeOp();
+ MakeOp(DT_FLOAT);
// Feed and run
AddInputFromArray<string>(TensorShape({2}), {"tag1", "tag2"});
diff --git a/tensorflow/core/kernels/typed_queue.h b/tensorflow/core/kernels/typed_queue.h
index ae2878d87b..83cd086c68 100644
--- a/tensorflow/core/kernels/typed_queue.h
+++ b/tensorflow/core/kernels/typed_queue.h
@@ -36,9 +36,10 @@ Status TypedQueue<SubQueue>::Initialize() {
}
if (!component_shapes_.empty() &&
component_dtypes_.size() != component_shapes_.size()) {
- return errors::InvalidArgument("Different number of component types (",
- component_dtypes_.size(), ") vs. shapes (",
- component_shapes_.size(), ").");
+ return errors::InvalidArgument(
+ "Different number of component types. ", "Types: ",
+ DataTypeSliceString(component_dtypes_), ", Shapes: ",
+ ShapeListString(component_shapes_));
}
mutex_lock lock(mu_);
diff --git a/tensorflow/core/lib/histogram/histogram.cc b/tensorflow/core/lib/histogram/histogram.cc
index 4c29d687b7..6d1e3c9cf2 100644
--- a/tensorflow/core/lib/histogram/histogram.cc
+++ b/tensorflow/core/lib/histogram/histogram.cc
@@ -102,24 +102,43 @@ void Histogram::Add(double value) {
double Histogram::Median() const { return Percentile(50.0); }
+// Linearly map the variable x from [x0, x1] unto [y0, y1]
+double Histogram::Remap(double x, double x0, double x1, double y0,
+ double y1) const {
+ return y0 + (x - x0) / (x1 - x0) * (y1 - y0);
+}
+
+// Pick tight left-hand-side and right-hand-side bounds and then
+// interpolate a histogram value at percentile p
double Histogram::Percentile(double p) const {
if (num_ == 0.0) return 0.0;
+
double threshold = num_ * (p / 100.0);
- double sum = 0;
- for (size_t b = 0; b < buckets_.size(); b++) {
- sum += buckets_[b];
- if (sum >= threshold) {
- // Scale linearly within this bucket
- double left_point = (b == 0) ? min_ : bucket_limits_[b - 1];
- double right_point = bucket_limits_[b];
- double left_sum = sum - buckets_[b];
- double right_sum = sum;
- double pos = (threshold - left_sum) / (right_sum - left_sum);
- double r = left_point + (right_point - left_point) * pos;
- if (r < min_) r = min_;
- if (r > max_) r = max_;
- return r;
+ double cumsum_prev = 0;
+ for (size_t i = 0; i < buckets_.size(); i++) {
+ double cumsum = cumsum_prev + buckets_[i];
+
+ // Find the first bucket whose cumsum >= threshold
+ if (cumsum >= threshold) {
+ // Prevent divide by 0 in remap which happens if cumsum == cumsum_prev
+ // This should only get hit when p == 0, cumsum == 0, and cumsum_prev == 0
+ if (cumsum == cumsum_prev) {
+ continue;
+ }
+
+ // Calculate the lower bound of interpolation
+ double lhs = (i == 0 || cumsum_prev == 0) ? min_ : bucket_limits_[i - 1];
+ lhs = std::max(lhs, min_);
+
+ // Calculate the upper bound of interpolation
+ double rhs = bucket_limits_[i];
+ rhs = std::min(rhs, max_);
+
+ double weight = Remap(threshold, cumsum_prev, cumsum, lhs, rhs);
+ return weight;
}
+
+ cumsum_prev = cumsum;
}
return max_;
}
diff --git a/tensorflow/core/lib/histogram/histogram.h b/tensorflow/core/lib/histogram/histogram.h
index 3e1e078954..65f37365b5 100644
--- a/tensorflow/core/lib/histogram/histogram.h
+++ b/tensorflow/core/lib/histogram/histogram.h
@@ -77,6 +77,8 @@ class Histogram {
gtl::ArraySlice<double> bucket_limits_;
std::vector<double> buckets_;
+ double Remap(double x, double x0, double x1, double y0, double y1) const;
+
TF_DISALLOW_COPY_AND_ASSIGN(Histogram);
};
diff --git a/tensorflow/core/lib/histogram/histogram_test.cc b/tensorflow/core/lib/histogram/histogram_test.cc
index bd42f51679..60eb7bcf2d 100644
--- a/tensorflow/core/lib/histogram/histogram_test.cc
+++ b/tensorflow/core/lib/histogram/histogram_test.cc
@@ -51,15 +51,41 @@ TEST(Histogram, CustomBuckets) {
Validate(h);
}
-TEST(Histogram, Percentile) {
+TEST(Histogram, Median) {
Histogram h({0, 10, 100, DBL_MAX});
h.Add(-2);
h.Add(-2);
h.Add(0);
- double median = h.Percentile(50.0);
+ double median = h.Median();
EXPECT_EQ(median, -0.5);
}
+TEST(Histogram, Percentile) {
+ // 10%, 30%, 40%, 20%
+ Histogram h({1, 2, 3, 4});
+ // 10% first bucket
+ h.Add(-1.0);
+ // 30% second bucket
+ h.Add(1.5);
+ h.Add(1.5);
+ h.Add(1.5);
+ // 40% third bucket
+ h.Add(2.5);
+ h.Add(2.5);
+ h.Add(2.5);
+ h.Add(2.5);
+ // 20% fourth bucket
+ h.Add(3.5);
+ h.Add(3.9);
+
+ EXPECT_EQ(h.Percentile(0), -1.0); // -1.0 = histo.min_
+ EXPECT_EQ(h.Percentile(25), 1.5); // 1.5 = remap(25, 10, 40, 1, 2)
+ EXPECT_EQ(h.Percentile(50), 2.25); // 2.25 = remap(50, 40, 80, 2, 3)
+ EXPECT_EQ(h.Percentile(75), 2.875); // 2.875 = remap(75, 40, 80, 2, 3)
+ EXPECT_EQ(h.Percentile(90), 3.45); // 3.45 = remap(90, 80, 100, 3, 3.9)
+ EXPECT_EQ(h.Percentile(100), 3.9); // 3.9 = histo.max_
+}
+
TEST(Histogram, Basic) {
Histogram h;
for (int i = 0; i < 100; i++) {
diff --git a/tensorflow/core/ops/nn_ops.cc b/tensorflow/core/ops/nn_ops.cc
index 03ba49d5cd..bf088dc45e 100644
--- a/tensorflow/core/ops/nn_ops.cc
+++ b/tensorflow/core/ops/nn_ops.cc
@@ -62,9 +62,11 @@ Batch normalization.
t: A 4D input Tensor.
m: A 1D mean Tensor with size matching the last dimension of t.
- This is the first output from MovingMoments.
+ This is the first output from tf.nn.moments,
+ or a saved moving average thereof.
v: A 1D variance Tensor with size matching the last dimension of t.
- This is the second output from MovingMoments.
+ This is the second output from tf.nn.moments,
+ or a saved moving average thereof.
beta: A 1D beta Tensor with size matching the last dimension of t.
An offset to be added to the normalized tensor.
gamma: A 1D gamma Tensor with size matching the last dimension of t.
@@ -94,9 +96,11 @@ Gradients for batch normalization.
t: A 4D input Tensor.
m: A 1D mean Tensor with size matching the last dimension of t.
- This is the first output from MovingMoments.
+ This is the first output from tf.nn.moments,
+ or a saved moving average thereof.
v: A 1D variance Tensor with size matching the last dimension of t.
- This is the second output from MovingMoments.
+ This is the second output from tf.nn.moments,
+ or a saved moving average thereof.
gamma: A 1D gamma Tensor with size matching the last dimension of t.
If "scale_after_normalization" is true, this Tensor will be multiplied
with the normalized Tensor.
@@ -488,10 +492,11 @@ backprop: backpropagated gradients (batch_size x num_classes matrix).
// --------------------------------------------------------------------------
REGISTER_OP("InTopK")
- .Attr("k: int")
.Input("predictions: float")
- .Input("targets: int32")
+ .Input("targets: T")
.Output("precision: bool")
+ .Attr("k: int")
+ .Attr("T: {int32, int64} = DT_INT32")
.Doc(R"doc(
Says whether the targets are in the top K predictions.
diff --git a/tensorflow/core/ops/ops.pbtxt b/tensorflow/core/ops/ops.pbtxt
new file mode 100644
index 0000000000..80812f6e5f
--- /dev/null
+++ b/tensorflow/core/ops/ops.pbtxt
@@ -0,0 +1,8072 @@
+op {
+ name: "Abs"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ summary: "Computes the absolute value of a tensor."
+ description: "Given a tensor `x`, this operation returns a tensor containing the absolute\nvalue of each element in `x`. For example, if x is an input element and y is\nan output element, this operation computes \\\\(y = |x|\\\\)."
+}
+op {
+ name: "Add"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "z"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT8
+ type: DT_INT16
+ type: DT_INT32
+ type: DT_COMPLEX64
+ type: DT_INT64
+ }
+ }
+ }
+ summary: "Returns x + y element-wise."
+ description: "*NOTE*: Add supports broadcasting. AddN does not."
+ is_commutative: true
+}
+op {
+ name: "AddN"
+ input_arg {
+ name: "inputs"
+ description: "Must all be the same size and shape."
+ type_attr: "T"
+ number_attr: "N"
+ }
+ output_arg {
+ name: "sum"
+ type_attr: "T"
+ }
+ attr {
+ name: "N"
+ type: "int"
+ has_minimum: true
+ minimum: 1
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT64
+ type: DT_INT32
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ type: DT_COMPLEX64
+ type: DT_QINT8
+ type: DT_QUINT8
+ type: DT_QINT32
+ }
+ }
+ }
+ summary: "Add all input tensors element wise."
+ is_aggregate: true
+ is_commutative: true
+}
+op {
+ name: "AdjustContrast"
+ input_arg {
+ name: "images"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "contrast_factor"
+ description: "A float multiplier for adjusting contrast."
+ type: DT_FLOAT
+ }
+ input_arg {
+ name: "min_value"
+ description: "Minimum value for clipping the adjusted pixels."
+ type: DT_FLOAT
+ }
+ input_arg {
+ name: "max_value"
+ description: "Maximum value for clipping the adjusted pixels."
+ type: DT_FLOAT
+ }
+ output_arg {
+ name: "output"
+ description: "The constrast-adjusted image or images."
+ type: DT_FLOAT
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_UINT8
+ type: DT_INT8
+ type: DT_INT16
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ }
+ }
+ }
+ summary: "Adjust the contrast of one or more images."
+ description: "`images` is a tensor of at least 3 dimensions. The last 3 dimensions are\ninterpreted as `[height, width, channels]`. The other dimensions only\nrepresent a collection of images, such as `[batch, height, width, channels].`\n\nContrast is adjusted independently for each channel of each image.\n\nFor each channel, the Op first computes the mean of the image pixels in the\nchannel and then adjusts each component of each pixel to\n`(x - mean) * contrast_factor + mean`.\n\nThese adjusted values are then clipped to fit in the `[min_value, max_value]`\ninterval.\n\n`images: Images to adjust. At least 3-D."
+}
+op {
+ name: "All"
+ input_arg {
+ name: "input"
+ description: "The tensor to reduce."
+ type: DT_BOOL
+ }
+ input_arg {
+ name: "reduction_indices"
+ description: "The dimensions to reduce."
+ type: DT_INT32
+ }
+ output_arg {
+ name: "output"
+ description: "The reduced tensor."
+ type: DT_BOOL
+ }
+ attr {
+ name: "keep_dims"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ description: "If true, retain reduced dimensions with length 1."
+ }
+ summary: "Computes the \"logical and\" of elements across dimensions of a tensor."
+ description: "Reduces `input` along the dimensions given in `reduction_indices`. Unless\n`keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in\n`reduction_indices`. If `keep_dims` is true, the reduced dimensions are\nretained with length 1."
+}
+op {
+ name: "AllCandidateSampler"
+ input_arg {
+ name: "true_classes"
+ description: "A batch_size * num_true matrix, in which each row contains the\nIDs of the num_true target_classes in the corresponding original label."
+ type: DT_INT64
+ }
+ output_arg {
+ name: "sampled_candidates"
+ description: "A vector of length num_sampled, in which each element is\nthe ID of a sampled candidate."
+ type: DT_INT64
+ }
+ output_arg {
+ name: "true_expected_count"
+ description: "A batch_size * num_true matrix, representing\nthe number of times each candidate is expected to occur in a batch\nof sampled candidates. If unique=true, then this is a probability."
+ type: DT_FLOAT
+ }
+ output_arg {
+ name: "sampled_expected_count"
+ description: "A vector of length num_sampled, for each sampled\ncandidate represting the number of times the candidate is expected\nto occur in a batch of sampled candidates. If unique=true, then this is a\nprobability."
+ type: DT_FLOAT
+ }
+ attr {
+ name: "num_true"
+ type: "int"
+ description: "Number of true labels per context."
+ has_minimum: true
+ minimum: 1
+ }
+ attr {
+ name: "num_sampled"
+ type: "int"
+ description: "Number of candidates to produce per batch."
+ has_minimum: true
+ minimum: 1
+ }
+ attr {
+ name: "unique"
+ type: "bool"
+ description: "If unique is true, we sample with rejection, so that all sampled\ncandidates in a batch are unique. This requires some approximation to\nestimate the post-rejection sampling probabilities."
+ }
+ attr {
+ name: "seed"
+ type: "int"
+ default_value {
+ i: 0
+ }
+ description: "If either seed or seed2 are set to be non-zero, the random number\ngenerator is seeded by the given seed. Otherwise, it is seeded by a\nrandom seed."
+ }
+ attr {
+ name: "seed2"
+ type: "int"
+ default_value {
+ i: 0
+ }
+ description: "An second seed to avoid seed collision."
+ }
+ summary: "Generates labels for candidate sampling with a learned unigram distribution."
+ description: "See explanations of candidate sampling and the data formats at\ngo/candidate-sampling.\n\nFor each batch, this op picks a single set of sampled candidate labels.\n\nThe advantages of sampling candidates per-batch are simplicity and the\npossibility of efficient dense matrix multiplication. The disadvantage is that\nthe sampled candidates must be chosen independently of the context and of the\ntrue labels."
+}
+op {
+ name: "Any"
+ input_arg {
+ name: "input"
+ description: "The tensor to reduce."
+ type: DT_BOOL
+ }
+ input_arg {
+ name: "reduction_indices"
+ description: "The dimensions to reduce."
+ type: DT_INT32
+ }
+ output_arg {
+ name: "output"
+ description: "The reduced tensor."
+ type: DT_BOOL
+ }
+ attr {
+ name: "keep_dims"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ description: "If true, retain reduced dimensions with length 1."
+ }
+ summary: "Computes the \"logical or\" of elements across dimensions of a tensor."
+ description: "Reduces `input` along the dimensions given in `reduction_indices`. Unless\n`keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in\n`reduction_indices`. If `keep_dims` is true, the reduced dimensions are\nretained with length 1."
+}
+op {
+ name: "ApplyAdagrad"
+ input_arg {
+ name: "var"
+ description: "Should be from a Variable()."
+ type_attr: "T"
+ is_ref: true
+ }
+ input_arg {
+ name: "accum"
+ description: "Should be from a Variable()."
+ type_attr: "T"
+ is_ref: true
+ }
+ input_arg {
+ name: "lr"
+ description: "Scaling factor. Must be a scalar."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "grad"
+ description: "The gradient."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "out"
+ description: "Same as \"var\"."
+ type_attr: "T"
+ is_ref: true
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT64
+ type: DT_INT32
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ type: DT_COMPLEX64
+ type: DT_QINT8
+ type: DT_QUINT8
+ type: DT_QINT32
+ }
+ }
+ }
+ attr {
+ name: "use_locking"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ description: "If True, updating of the var and accum tensors will be protected by\na lock; otherwise the behavior is undefined, but may exhibit less contention."
+ }
+ summary: "Update \'*var\' according to the adagrad scheme."
+ description: "accum += grad * grad\nvar -= lr * grad * (1 / sqrt(accum))"
+}
+op {
+ name: "ApplyAdam"
+ input_arg {
+ name: "var"
+ description: "Should be from a Variable()."
+ type_attr: "T"
+ is_ref: true
+ }
+ input_arg {
+ name: "m"
+ description: "Should be from a Variable()."
+ type_attr: "T"
+ is_ref: true
+ }
+ input_arg {
+ name: "v"
+ description: "Should be from a Variable()."
+ type_attr: "T"
+ is_ref: true
+ }
+ input_arg {
+ name: "beta1_power"
+ description: "Must be a scalar."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "beta2_power"
+ description: "Must be a scalar."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "lr"
+ description: "Scaling factor. Must be a scalar."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "beta1"
+ description: "Momentum factor. Must be a scalar."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "beta2"
+ description: "Momentum factor. Must be a scalar."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "epsilon"
+ description: "Ridge term. Must be a scalar."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "grad"
+ description: "The gradient."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "out"
+ description: "Same as \"var\"."
+ type_attr: "T"
+ is_ref: true
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT64
+ type: DT_INT32
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ type: DT_COMPLEX64
+ type: DT_QINT8
+ type: DT_QUINT8
+ type: DT_QINT32
+ }
+ }
+ }
+ attr {
+ name: "use_locking"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ description: "If True, updating of the var, m, and v tensors will be protected by\na lock; otherwise the behavior is undefined, but may exhibit less contention."
+ }
+ summary: "Update \'*var\' according to the Adam algorithm."
+ description: "lr_t <- learning_rate * sqrt(1 - beta2^t) / (1 - beta1^t)\nm_t <- beta1 * m_{t-1} + (1 - beta1) * g_t\nv_t <- beta2 * v_{t-1} + (1 - beta2) * g_t * g_t\nvariable <- variable - lr_t * m_t / (sqrt(v_t) + epsilon)"
+}
+op {
+ name: "ApplyGradientDescent"
+ input_arg {
+ name: "var"
+ description: "Should be from a Variable()."
+ type_attr: "T"
+ is_ref: true
+ }
+ input_arg {
+ name: "alpha"
+ description: "Scaling factor. Must be a scalar."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "delta"
+ description: "The change."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "out"
+ description: "Same as \"var\"."
+ type_attr: "T"
+ is_ref: true
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT64
+ type: DT_INT32
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ type: DT_COMPLEX64
+ type: DT_QINT8
+ type: DT_QUINT8
+ type: DT_QINT32
+ }
+ }
+ }
+ attr {
+ name: "use_locking"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ description: "If True, the subtraction will be protected by a lock;\notherwise the behavior is undefined, but may exhibit less contention."
+ }
+ summary: "Update \'*var\' by subtracting \'alpha\' * \'delta\' from it."
+}
+op {
+ name: "ApplyMomentum"
+ input_arg {
+ name: "var"
+ description: "Should be from a Variable()."
+ type_attr: "T"
+ is_ref: true
+ }
+ input_arg {
+ name: "accum"
+ description: "Should be from a Variable()."
+ type_attr: "T"
+ is_ref: true
+ }
+ input_arg {
+ name: "lr"
+ description: "Scaling factor. Must be a scalar."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "grad"
+ description: "The gradient."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "momentum"
+ description: "Momentum. Must be a scalar."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "out"
+ description: "Same as \"var\"."
+ type_attr: "T"
+ is_ref: true
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT64
+ type: DT_INT32
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ type: DT_COMPLEX64
+ type: DT_QINT8
+ type: DT_QUINT8
+ type: DT_QINT32
+ }
+ }
+ }
+ attr {
+ name: "use_locking"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ description: "If True, updating of the var and accum tensors will be protected by\na lock; otherwise the behavior is undefined, but may exhibit less contention."
+ }
+ summary: "Update \'*var\' according to the momentum scheme."
+ description: "accum = accum * momentum + grad\nvar -= lr * accum"
+}
+op {
+ name: "ApplyRMSProp"
+ input_arg {
+ name: "var"
+ description: "Should be from a Variable()."
+ type_attr: "T"
+ is_ref: true
+ }
+ input_arg {
+ name: "ms"
+ description: "Should be from a Variable()."
+ type_attr: "T"
+ is_ref: true
+ }
+ input_arg {
+ name: "mom"
+ description: "Should be from a Variable()."
+ type_attr: "T"
+ is_ref: true
+ }
+ input_arg {
+ name: "lr"
+ description: "Scaling factor. Must be a scalar."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "rho"
+ description: "Decay rate. Must be a scalar."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "momentum"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "epsilon"
+ description: "Ridge term. Must be a scalar."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "grad"
+ description: "The gradient."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "out"
+ description: "Same as \"var\"."
+ type_attr: "T"
+ is_ref: true
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT64
+ type: DT_INT32
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ type: DT_COMPLEX64
+ type: DT_QINT8
+ type: DT_QUINT8
+ type: DT_QINT32
+ }
+ }
+ }
+ attr {
+ name: "use_locking"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ description: "If True, updating of the var, m, and v tensors will be protected by\na lock; otherwise the behavior is undefined, but may exhibit less contention."
+ }
+ summary: "Update \'*var\' according to the RMSProp algorithm."
+ description: "mean_square = decay * mean_square + (1-decay) * gradient ** 2\nDelta = learning_rate * gradient / sqrt(mean_square + epsilon)\n\nms <- rho * ms_{t-1} + (1-rho) * grad * grad\nmom <- momentum * mom_{t-1} + lr * grad / sqrt(ms + epsilon)\nvar <- var - mom"
+}
+op {
+ name: "ArgMax"
+ input_arg {
+ name: "input"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "dimension"
+ description: "int32, 0 <= dimension < rank(input). Describes which dimension\nof the input Tensor to reduce across. For vectors, use dimension = 0."
+ type: DT_INT32
+ }
+ output_arg {
+ name: "output"
+ type: DT_INT64
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT64
+ type: DT_INT32
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ type: DT_COMPLEX64
+ type: DT_QINT8
+ type: DT_QUINT8
+ type: DT_QINT32
+ }
+ }
+ }
+ summary: "Returns the index with the largest value across dimensions of a tensor."
+}
+op {
+ name: "ArgMin"
+ input_arg {
+ name: "input"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "dimension"
+ description: "int32, 0 <= dimension < rank(input). Describes which dimension\nof the input Tensor to reduce across. For vectors, use dimension = 0."
+ type: DT_INT32
+ }
+ output_arg {
+ name: "output"
+ type: DT_INT64
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT64
+ type: DT_INT32
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ type: DT_COMPLEX64
+ type: DT_QINT8
+ type: DT_QUINT8
+ type: DT_QINT32
+ }
+ }
+ }
+ summary: "Returns the index with the smallest value across dimensions of a tensor."
+}
+op {
+ name: "Assert"
+ input_arg {
+ name: "condition"
+ description: "The condition to evaluate."
+ type: DT_BOOL
+ }
+ input_arg {
+ name: "data"
+ description: "The tensors to print out when condition is false."
+ type_list_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "list(type)"
+ has_minimum: true
+ minimum: 1
+ }
+ attr {
+ name: "summarize"
+ type: "int"
+ default_value {
+ i: 3
+ }
+ description: "Print this many entries of each tensor."
+ }
+ summary: "Asserts that the given condition is true."
+ description: "If `condition` evaluates to false, print the list of tensors in `data`.\n`summarize` determines how many entries of the tensors to print."
+}
+op {
+ name: "Assign"
+ input_arg {
+ name: "ref"
+ description: "Should be from a `Variable` node. May be uninitialized."
+ type_attr: "T"
+ is_ref: true
+ }
+ input_arg {
+ name: "value"
+ description: "The value to be assigned to the variable."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output_ref"
+ description: "= Same as \"ref\". Returned as a convenience for operations that want\nto use the new value after the variable has been reset."
+ type_attr: "T"
+ is_ref: true
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ attr {
+ name: "validate_shape"
+ type: "bool"
+ default_value {
+ b: true
+ }
+ description: "If true, the operation will validate that the shape\nof \'value\' matches the shape of the Tensor being assigned to. If false,\n\'ref\' will take on the shape of \'value\'."
+ }
+ attr {
+ name: "use_locking"
+ type: "bool"
+ default_value {
+ b: true
+ }
+ description: "If True, the assignment will be protected by a lock;\notherwise the behavior is undefined, but may exhibit less contention."
+ }
+ summary: "Update \'ref\' by assigning \'value\' to it."
+ description: "This operation outputs \"ref\" after the assignment is done.\nThis makes it easier to chain operations that need to use the reset value."
+ allows_uninitialized_input: true
+}
+op {
+ name: "AssignAdd"
+ input_arg {
+ name: "ref"
+ description: "Should be from a `Variable` node."
+ type_attr: "T"
+ is_ref: true
+ }
+ input_arg {
+ name: "value"
+ description: "The value to be added to the variable."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output_ref"
+ description: "= Same as \"ref\". Returned as a convenience for operations that want\nto use the new value after the variable has been updated."
+ type_attr: "T"
+ is_ref: true
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT64
+ type: DT_INT32
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ type: DT_COMPLEX64
+ type: DT_QINT8
+ type: DT_QUINT8
+ type: DT_QINT32
+ }
+ }
+ }
+ attr {
+ name: "use_locking"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ description: "If True, the addition will be protected by a lock;\notherwise the behavior is undefined, but may exhibit less contention."
+ }
+ summary: "Update \'ref\' by adding \'value\' to it."
+ description: "This operation outputs \"ref\" after the update is done.\nThis makes it easier to chain operations that need to use the reset value."
+}
+op {
+ name: "AssignSub"
+ input_arg {
+ name: "ref"
+ description: "Should be from a `Variable` node."
+ type_attr: "T"
+ is_ref: true
+ }
+ input_arg {
+ name: "value"
+ description: "The value to be subtracted to the variable."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output_ref"
+ description: "= Same as \"ref\". Returned as a convenience for operations that want\nto use the new value after the variable has been updated."
+ type_attr: "T"
+ is_ref: true
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT64
+ type: DT_INT32
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ type: DT_COMPLEX64
+ type: DT_QINT8
+ type: DT_QUINT8
+ type: DT_QINT32
+ }
+ }
+ }
+ attr {
+ name: "use_locking"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ description: "If True, the subtraction will be protected by a lock;\notherwise the behavior is undefined, but may exhibit less contention."
+ }
+ summary: "Update \'ref\' by subtracting \'value\' from it."
+ description: "This operation outputs \"ref\" after the update is done.\nThis makes it easier to chain operations that need to use the reset value."
+}
+op {
+ name: "AvgPool"
+ input_arg {
+ name: "value"
+ description: "4-D with shape `[batch, height, width, channels]`."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ description: "The average pooled output tensor."
+ type_attr: "T"
+ }
+ attr {
+ name: "ksize"
+ type: "list(int)"
+ description: "The size of the sliding window for each dimension of `value`."
+ has_minimum: true
+ minimum: 4
+ }
+ attr {
+ name: "strides"
+ type: "list(int)"
+ description: "The stride of the sliding window for each dimension of `value`."
+ has_minimum: true
+ minimum: 4
+ }
+ attr {
+ name: "padding"
+ type: "string"
+ description: "The type of padding algorithm to use."
+ allowed_values {
+ list {
+ s: "SAME"
+ s: "VALID"
+ }
+ }
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ }
+ }
+ }
+ summary: "Performs average pooling on the input."
+ description: "Each entry in `output` is the mean of the corresponding size `ksize`\nwindow in `value`."
+}
+op {
+ name: "AvgPoolGrad"
+ input_arg {
+ name: "orig_input_shape"
+ description: "1-D. Shape of the original input to `avg_pool`."
+ type: DT_INT32
+ }
+ input_arg {
+ name: "grad"
+ description: "4-D with shape `[batch, height, width, channels]`. Gradients w.r.t.\nthe output of `avg_pool`."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ description: "4-D. Gradients w.r.t. the input of `avg_pool`."
+ type_attr: "T"
+ }
+ attr {
+ name: "ksize"
+ type: "list(int)"
+ description: "The size of the sliding window for each dimension of the input."
+ has_minimum: true
+ minimum: 4
+ }
+ attr {
+ name: "strides"
+ type: "list(int)"
+ description: "The stride of the sliding window for each dimension of the input."
+ has_minimum: true
+ minimum: 4
+ }
+ attr {
+ name: "padding"
+ type: "string"
+ description: "The type of padding algorithm to use."
+ allowed_values {
+ list {
+ s: "SAME"
+ s: "VALID"
+ }
+ }
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ }
+ }
+ }
+ summary: "Computes gradients of the average pooling function."
+}
+op {
+ name: "BatchCholesky"
+ input_arg {
+ name: "input"
+ description: "Shape is `[..., M, M]`."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ description: "Shape is `[..., M, M]`."
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ description: "The type of values in the input and output."
+ allowed_values {
+ list {
+ type: DT_DOUBLE
+ type: DT_FLOAT
+ }
+ }
+ }
+ summary: "Calculates the Cholesky decomposition of a batch of square matrices."
+ description: "The input is a tensor of shape `[..., M, M]` whose inner-most 2 dimensions\nform square matrices, with the same constraints as the single matrix Cholesky\ndecomposition above. The output is a tensor of the same shape as the input\ncontaining the Cholesky decompositions for all input submatrices `[..., :, :]`."
+}
+op {
+ name: "BatchMatMul"
+ input_arg {
+ name: "x"
+ description: "3-D or higher with shape `[..., r_x, c_x]`."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "y"
+ description: "3-D or higher with shape `[..., r_y, c_y]`."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "out"
+ description: "3-D or higher with shape `[..., r_o, c_o]`"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_COMPLEX64
+ }
+ }
+ }
+ attr {
+ name: "adj_x"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ description: "If `True`, adjoint the slices of `x`. Defaults to `False`."
+ }
+ attr {
+ name: "adj_y"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ description: "If `True`, adjoint the slices of `y`. Defaults to `False`."
+ }
+ summary: "Multiplies slices of two tensors in batches."
+ description: "Multiplies all slices of `Tensor` `x` and `y` (each slice can be\nviewed as an element of a batch), and arranges the individual results\nin a single output tensor of the same batch size. Each of the\nindividual slices can optionally be adjointed (to adjoint a matrix\nmeans to transpose and conjugate it) before multiplication by setting\nthe `adj_x` or `adj_y` flag to `True`, which are by default `False`.\n\nThe input tensors `x` and `y` are 3-D or higher with shape `[..., r_x, c_x]`\nand `[..., r_y, c_y]`.\n\nThe output tensor is 3-D or higher with shape `[..., r_o, c_o]`, where:\n\n r_o = c_x if adj_x else r_x\n c_o = r_y if adj_y else c_y\n\nIt is computed as:\n\n out[..., :, :] = matrix(x[..., :, :]) * matrix(y[..., :, :])"
+}
+op {
+ name: "BatchMatrixDeterminant"
+ input_arg {
+ name: "input"
+ description: "Shape is `[..., M, M]`."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ description: "Shape is `[...]`."
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ description: "The type of values in the input and output."
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ }
+ }
+ }
+ summary: "Calculates the determinants for a batch of square matrices."
+ description: "The input is a tensor of shape `[..., M, M]` whose inner-most 2 dimensions\nform square matrices. The output is a 1-D tensor containing the determinants\nfor all input submatrices `[..., :, :]`."
+}
+op {
+ name: "BatchMatrixInverse"
+ input_arg {
+ name: "input"
+ description: "Shape is `[..., M, M]`."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ description: "Shape is `[..., M, M]`."
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ description: "The type of values in the input and output."
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ }
+ }
+ }
+ summary: "Calculates the inverse of square invertible matrices."
+ description: "The input is a tensor of shape `[..., M, M]` whose inner-most 2 dimensions\nform square matrices. The output is a tensor of the same shape as the input\ncontaining the inverse for all input submatrices `[..., :, :]`.\n\nThe op uses the Cholesky decomposition if the matrices are symmetric positive\ndefinite and LU decomposition with partial pivoting otherwise.\n\nIf a matrix is not invertible there is no guarantee what the op does. It\nmay detect the condition and raise an exception or it may simply return a\ngarbage result."
+}
+op {
+ name: "BatchNormWithGlobalNormalization"
+ input_arg {
+ name: "t"
+ description: "A 4D input Tensor."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "m"
+ description: "A 1D mean Tensor with size matching the last dimension of t.\nThis is the first output from tf.nn.moments,\nor a saved moving average thereof."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "v"
+ description: "A 1D variance Tensor with size matching the last dimension of t.\nThis is the second output from tf.nn.moments,\nor a saved moving average thereof."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "beta"
+ description: "A 1D beta Tensor with size matching the last dimension of t.\nAn offset to be added to the normalized tensor."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "gamma"
+ description: "A 1D gamma Tensor with size matching the last dimension of t.\nIf \"scale_after_normalization\" is true, this tensor will be multiplied\nwith the normalized tensor."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "result"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT64
+ type: DT_INT32
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ type: DT_COMPLEX64
+ type: DT_QINT8
+ type: DT_QUINT8
+ type: DT_QINT32
+ }
+ }
+ }
+ attr {
+ name: "variance_epsilon"
+ type: "float"
+ description: "A small float number to avoid dividing by 0."
+ }
+ attr {
+ name: "scale_after_normalization"
+ type: "bool"
+ description: "A bool indicating whether the resulted tensor\nneeds to be multiplied with gamma."
+ }
+ summary: "Batch normalization."
+}
+op {
+ name: "BatchNormWithGlobalNormalizationGrad"
+ input_arg {
+ name: "t"
+ description: "A 4D input Tensor."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "m"
+ description: "A 1D mean Tensor with size matching the last dimension of t.\nThis is the first output from tf.nn.moments,\nor a saved moving average thereof."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "v"
+ description: "A 1D variance Tensor with size matching the last dimension of t.\nThis is the second output from tf.nn.moments,\nor a saved moving average thereof."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "gamma"
+ description: "A 1D gamma Tensor with size matching the last dimension of t.\nIf \"scale_after_normalization\" is true, this Tensor will be multiplied\nwith the normalized Tensor."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "backprop"
+ description: "4D backprop Tensor."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "dx"
+ description: "4D backprop tensor for input."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "dm"
+ description: "1D backprop tensor for mean."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "dv"
+ description: "1D backprop tensor for variance."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "db"
+ description: "1D backprop tensor for beta."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "dg"
+ description: "1D backprop tensor for gamma."
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT64
+ type: DT_INT32
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ type: DT_COMPLEX64
+ type: DT_QINT8
+ type: DT_QUINT8
+ type: DT_QINT32
+ }
+ }
+ }
+ attr {
+ name: "variance_epsilon"
+ type: "float"
+ description: "A small float number to avoid dividing by 0."
+ }
+ attr {
+ name: "scale_after_normalization"
+ type: "bool"
+ description: "A bool indicating whether the resulted tensor\nneeds to be multiplied with gamma."
+ }
+ summary: "Gradients for batch normalization."
+}
+op {
+ name: "BiasAdd"
+ input_arg {
+ name: "value"
+ description: "Any number of dimensions."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "bias"
+ description: "1-D with size the last dimension of `value`."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ description: "Broadcasted sum of `value` and `bias`."
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT64
+ type: DT_INT32
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ type: DT_COMPLEX64
+ type: DT_QINT8
+ type: DT_QUINT8
+ type: DT_QINT32
+ }
+ }
+ }
+ summary: "Adds `bias` to `value`."
+ description: "This is a special case of `tf.add` where `bias` is restricted to be 1-D.\nBroadcasting is supported, so `value` may have any number of dimensions."
+}
+op {
+ name: "BroadcastGradientArgs"
+ input_arg {
+ name: "s0"
+ type: DT_INT32
+ }
+ input_arg {
+ name: "s1"
+ type: DT_INT32
+ }
+ output_arg {
+ name: "r0"
+ type: DT_INT32
+ }
+ output_arg {
+ name: "r1"
+ type: DT_INT32
+ }
+ summary: "Return the reduction indices for computing gradients of s0 op s1 with broadcast."
+ description: "This is typically used by gradient computations for a broadcasting operation."
+}
+op {
+ name: "Cast"
+ input_arg {
+ name: "x"
+ type_attr: "SrcT"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "DstT"
+ }
+ attr {
+ name: "SrcT"
+ type: "type"
+ }
+ attr {
+ name: "DstT"
+ type: "type"
+ }
+ summary: "Cast x of type SrcT to y of DstT."
+}
+op {
+ name: "Ceil"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ }
+ }
+ }
+ summary: "Returns element-wise smallest integer in not less than x."
+}
+op {
+ name: "CheckNumerics"
+ input_arg {
+ name: "tensor"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ }
+ }
+ }
+ attr {
+ name: "message"
+ type: "string"
+ description: "Prefix of the error message."
+ }
+ summary: "Checks a tensor for NaN and Inf values."
+ description: "When run, reports an `InvalidArgument` error if `tensor` has any values\nthat are not a number (NaN) or infinity (Inf). Otherwise, passes `tensor` as-is."
+}
+op {
+ name: "Cholesky"
+ input_arg {
+ name: "input"
+ description: "Shape is `[M, M]`."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ description: "Shape is `[M, M]`."
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ description: "The type of values in the input and output."
+ allowed_values {
+ list {
+ type: DT_DOUBLE
+ type: DT_FLOAT
+ }
+ }
+ }
+ summary: "Calculates the Cholesky decomposition of a square matrix."
+ description: "The input has to be symmetric and positive definite. Only the lower-triangular\npart of the input will be used for this operation. The upper-triangular part\nwill not be read.\n\nThe result is the lower-triangular matrix of the Cholesky decomposition of the\ninput."
+}
+op {
+ name: "Complex"
+ input_arg {
+ name: "real"
+ type: DT_FLOAT
+ }
+ input_arg {
+ name: "imag"
+ type: DT_FLOAT
+ }
+ output_arg {
+ name: "out"
+ type: DT_COMPLEX64
+ }
+ summary: "Converts two real numbers to a complex number."
+ description: "Given a tensor `real` representing the real part of a complex number, and a\ntensor `imag` representing the imaginary part of a complex number, this\noperation returns complex numbers elementwise of the form \\\\(a + bj\\\\), where\n*a* represents the `real` part and *b* represents the `imag` part.\n\nThe input tensors `real` and `imag` must have the same shape.\n\nFor example:\n\n```\n# tensor \'real\' is [2.25, 3.25]\n# tensor `imag` is [4.75, 5.75]\ntf.complex(real, imag) ==> [[2.25 + 4.75j], [3.25 + 5.75j]]\n```"
+}
+op {
+ name: "ComplexAbs"
+ input_arg {
+ name: "x"
+ type: DT_COMPLEX64
+ }
+ output_arg {
+ name: "y"
+ type: DT_FLOAT
+ }
+ summary: "Computes the complex absolute value of a tensor."
+ description: "Given a tensor `x` of complex numbers, this operation returns a tensor of type\n`float` that is the absolute value of each element in `x`. All elements in `x`\nmust be complex numbers of the form \\\\(a + bj\\\\). The absolute value is\ncomputed as \\\\( \\sqrt{a^2 + b^2}\\\\).\n\nFor example:\n\n```\n# tensor \'x\' is [[-2.25 + 4.75j], [-3.25 + 5.75j]]\ntf.complex_abs(x) ==> [5.25594902, 6.60492229]\n```"
+}
+op {
+ name: "ComputeAccidentalHits"
+ input_arg {
+ name: "true_classes"
+ description: "The true_classes output of UnpackSparseLabels."
+ type: DT_INT64
+ }
+ input_arg {
+ name: "sampled_candidates"
+ description: "The sampled_candidates output of CandidateSampler."
+ type: DT_INT64
+ }
+ output_arg {
+ name: "indices"
+ description: "A vector of indices corresponding to rows of true_candidates."
+ type: DT_INT32
+ }
+ output_arg {
+ name: "ids"
+ description: "A vector of IDs of positions in sampled_candidates that match a true_label\nfor the row with the corresponding index in indices."
+ type: DT_INT64
+ }
+ output_arg {
+ name: "weights"
+ description: "A vector of the same length as indices and ids, in which each element\nis -FLOAT_MAX."
+ type: DT_FLOAT
+ }
+ attr {
+ name: "num_true"
+ type: "int"
+ description: "Number of true labels per context."
+ }
+ attr {
+ name: "seed"
+ type: "int"
+ default_value {
+ i: 0
+ }
+ description: "If either seed or seed2 are set to be non-zero, the random number\ngenerator is seeded by the given seed. Otherwise, it is seeded by a\nrandom seed."
+ }
+ attr {
+ name: "seed2"
+ type: "int"
+ default_value {
+ i: 0
+ }
+ description: "An second seed to avoid seed collision."
+ }
+ summary: "Computes the ids of the positions in sampled_candidates that match true_labels."
+ description: "When doing log-odds NCE, the result of this op should be passed through a\nSparseToDense op, then added to the logits of the sampled candidates. This has\nthe effect of \'removing\' the sampled labels that match the true labels by\nmaking the classifier sure that they are sampled labels."
+}
+op {
+ name: "Concat"
+ input_arg {
+ name: "concat_dim"
+ description: "0-D. The dimension along which to concatenate. Must be in the\nrange [0, rank(values))."
+ type: DT_INT32
+ }
+ input_arg {
+ name: "values"
+ description: "The `N` Tensors to concatenate. Their ranks and types must match,\nand their sizes must match in all dimensions except `concat_dim`."
+ type_attr: "T"
+ number_attr: "N"
+ }
+ output_arg {
+ name: "output"
+ description: "A `Tensor` with the concatenation of values stacked along the\n`concat_dim` dimension. This tensor\'s shape matches that of `values` except\nin `concat_dim` where it has the sum of the sizes."
+ type_attr: "T"
+ }
+ attr {
+ name: "N"
+ type: "int"
+ has_minimum: true
+ minimum: 2
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ summary: "Concatenates tensors along one dimension."
+}
+op {
+ name: "Conj"
+ input_arg {
+ name: "in"
+ type: DT_COMPLEX64
+ }
+ output_arg {
+ name: "out"
+ type: DT_COMPLEX64
+ }
+ summary: "Returns the complex conjugate of a complex number."
+ description: "Given a tensor `in` of complex numbers, this operation returns a tensor of\ncomplex numbers that are the complex conjugate of each element in `in`. The\ncomplex numbers in `in` must be of the form \\\\(a + bj\\\\), where *a* is the real\npart and *b* is the imaginary part.\n\nThe complex conjugate returned by this operation is of the form \\\\(a - bj\\\\).\n\nFor example:\n\n```\n# tensor \'in\' is [-2.25 + 4.75j, 3.25 + 5.75j]\ntf.conj(in) ==> [-2.25 - 4.75j, 3.25 - 5.75j]\n```"
+}
+op {
+ name: "Const"
+ output_arg {
+ name: "output"
+ type_attr: "dtype"
+ }
+ attr {
+ name: "value"
+ type: "tensor"
+ description: "Attr `value` is the tensor to return."
+ }
+ attr {
+ name: "dtype"
+ type: "type"
+ }
+ summary: "Returns a constant tensor."
+}
+op {
+ name: "ControlTrigger"
+ summary: "Does nothing. Serves as a control trigger for scheduling. Only useful as a"
+ description: "placeholder for control edges."
+}
+op {
+ name: "Conv2D"
+ input_arg {
+ name: "input"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "filter"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ }
+ }
+ }
+ attr {
+ name: "strides"
+ type: "list(int)"
+ description: "1-D of length 4. The stride of the sliding window for each dimension\nof `input`."
+ }
+ attr {
+ name: "use_cudnn_on_gpu"
+ type: "bool"
+ default_value {
+ b: true
+ }
+ }
+ attr {
+ name: "padding"
+ type: "string"
+ description: "The type of padding algorithm to use."
+ allowed_values {
+ list {
+ s: "SAME"
+ s: "VALID"
+ }
+ }
+ }
+ summary: "Computes a 2-D convolution given 4-D `input` and `filter` tensors."
+ description: "Given an input tensor of shape `[batch, in_height, in_width, in_channels]`\nand a filter / kernel tensor of shape\n`[filter_height, filter_width, in_channels, out_channels]`, this op\nperforms the following:\n\n1. Flattens the filter to a 2-D matrix with shape\n `[filter_height * filter_width * in_channels, output_channels]`.\n2. Extracts image patches from the the input tensor to form a *virtual*\n tensor of shape `[batch, out_height, out_width,\n filter_height * filter_width * in_channels]`.\n3. For each patch, right-multiplies the filter matrix and the image patch\n vector.\n\nIn detail,\n\n output[b, i, j, k] =\n sum_{di, dj, q} input[b, strides[1] * i + di, strides[2] * j + dj, q] *\n filter[di, dj, q, k]\n\nMust have `strides[0] = strides[3] = 1`. For the most common case of the same\nhorizontal and vertices strides, `strides = [1, stride, stride, 1]`."
+}
+op {
+ name: "Conv2DBackpropFilter"
+ input_arg {
+ name: "input"
+ description: "4-D with shape `[batch, in_height, in_width, in_channels]`."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "filter_sizes"
+ description: "An integer vector representing the tensor shape of `filter`,\nwhere `filter` is a 4-D\n`[filter_height, filter_width, in_channels, out_channels]` tensor."
+ type: DT_INT32
+ }
+ input_arg {
+ name: "out_backprop"
+ description: "4-D with shape `[batch, out_height, out_width, out_channels]`.\nGradients w.r.t. the output of the convolution."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ description: "4-D with shape\n`[filter_height, filter_width, in_channels, out_channels]`. Gradient w.r.t.\nthe `filter` input of the convolution."
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ }
+ }
+ }
+ attr {
+ name: "strides"
+ type: "list(int)"
+ description: "The stride of the sliding window for each dimension of the input\nof the convolution."
+ }
+ attr {
+ name: "use_cudnn_on_gpu"
+ type: "bool"
+ default_value {
+ b: true
+ }
+ }
+ attr {
+ name: "padding"
+ type: "string"
+ description: "The type of padding algorithm to use."
+ allowed_values {
+ list {
+ s: "SAME"
+ s: "VALID"
+ }
+ }
+ }
+ summary: "Computes the gradients of convolution with respect to the filter."
+}
+op {
+ name: "Conv2DBackpropInput"
+ input_arg {
+ name: "input_sizes"
+ description: "An integer vector representing the shape of `input`,\nwhere `input` is a 4-D `[batch, height, width, channels]` tensor."
+ type: DT_INT32
+ }
+ input_arg {
+ name: "filter"
+ description: "4-D with shape\n`[filter_height, filter_width, in_channels, out_channels]`."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "out_backprop"
+ description: "4-D with shape `[batch, out_height, out_width, out_channels]`.\nGradients w.r.t. the output of the convolution."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ description: "4-D with shape `[batch, in_height, in_width, in_channels]`. Gradient\nw.r.t. the input of the convolution."
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ }
+ }
+ }
+ attr {
+ name: "strides"
+ type: "list(int)"
+ description: "The stride of the sliding window for each dimension of the input\nof the convolution."
+ }
+ attr {
+ name: "use_cudnn_on_gpu"
+ type: "bool"
+ default_value {
+ b: true
+ }
+ }
+ attr {
+ name: "padding"
+ type: "string"
+ description: "The type of padding algorithm to use."
+ allowed_values {
+ list {
+ s: "SAME"
+ s: "VALID"
+ }
+ }
+ }
+ summary: "Computes the gradients of convolution with respect to the input."
+}
+op {
+ name: "Cos"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_COMPLEX64
+ type: DT_INT64
+ }
+ }
+ }
+ summary: "Computes cos of x element-wise."
+}
+op {
+ name: "CountUpTo"
+ input_arg {
+ name: "ref"
+ description: "Should be from a scalar `Variable` node."
+ type_attr: "T"
+ is_ref: true
+ }
+ output_arg {
+ name: "output"
+ description: "A copy of the input before increment. If nothing else modifies the\ninput, the values produced will all be distinct."
+ type_attr: "T"
+ }
+ attr {
+ name: "limit"
+ type: "int"
+ description: "If incrementing ref would bring it above limit, instead generates an\n\'OutOfRange\' error."
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ summary: "Increments \'ref\' until it reaches \'limit\'."
+ description: "This operation outputs \"ref\" after the update is done. This makes it\neasier to chain operations that need to use the updated value."
+}
+op {
+ name: "DecodeCSV"
+ input_arg {
+ name: "records"
+ description: "Each string is a record/row in the csv and all records should have\nthe same format."
+ type: DT_STRING
+ }
+ input_arg {
+ name: "record_defaults"
+ description: "One tensor per column of the input record, with either a\nscalar default value for that column or empty if the column is required."
+ type_list_attr: "OUT_TYPE"
+ }
+ output_arg {
+ name: "output"
+ description: "Each tensor will have the same shape as records."
+ type_list_attr: "OUT_TYPE"
+ }
+ attr {
+ name: "OUT_TYPE"
+ type: "list(type)"
+ has_minimum: true
+ minimum: 1
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_STRING
+ }
+ }
+ }
+ attr {
+ name: "field_delim"
+ type: "string"
+ default_value {
+ s: ","
+ }
+ description: "delimiter to separate fields in a record."
+ }
+ summary: "Convert CSV records to tensors. Each column maps to one tensor."
+ description: "RFC 4180 format is expected for the CSV records.\n(https://tools.ietf.org/html/rfc4180)\nNote that we allow leading and trailing spaces with int or float field."
+}
+op {
+ name: "DecodeJpeg"
+ input_arg {
+ name: "contents"
+ description: "0-D. The JPEG-encoded image."
+ type: DT_STRING
+ }
+ output_arg {
+ name: "image"
+ description: "3-D with shape `[height, width, channels]`.."
+ type: DT_UINT8
+ }
+ attr {
+ name: "channels"
+ type: "int"
+ default_value {
+ i: 0
+ }
+ description: "Number of color channels for the decoded image."
+ }
+ attr {
+ name: "ratio"
+ type: "int"
+ default_value {
+ i: 1
+ }
+ description: "Downscaling ratio."
+ }
+ attr {
+ name: "fancy_upscaling"
+ type: "bool"
+ default_value {
+ b: true
+ }
+ description: "If true use a slower but nicer upscaling of the\nchroma planes (yuv420/422 only)."
+ }
+ attr {
+ name: "try_recover_truncated"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ description: "If true try to recover an image from truncated input."
+ }
+ attr {
+ name: "acceptable_fraction"
+ type: "float"
+ default_value {
+ f: 1
+ }
+ description: "The minimum required fraction of lines before a truncated\ninput is accepted."
+ }
+ summary: "Decode a JPEG-encoded image to a uint8 tensor."
+ description: "The attr `channels` indicates the desired number of color channels for the\ndecoded image.\n\nAccepted values are:\n\n* 0: Use the number of channels in the JPEG-encoded image.\n* 1: output a grayscale image.\n* 3: output an RGB image.\n\nIf needed, the JPEG-encoded image is transformed to match the requested number\nof color channels.\n\nThe attr `ratio` allows downscaling the image by an integer factor during\ndecoding. Allowed values are: 1, 2, 4, and 8. This is much faster than\ndownscaling the image later."
+}
+op {
+ name: "DecodePng"
+ input_arg {
+ name: "contents"
+ description: "0-D. The PNG-encoded image."
+ type: DT_STRING
+ }
+ output_arg {
+ name: "image"
+ description: "3-D with shape `[height, width, channels]`."
+ type: DT_UINT8
+ }
+ attr {
+ name: "channels"
+ type: "int"
+ default_value {
+ i: 0
+ }
+ description: "Number of color channels for the decoded image."
+ }
+ summary: "Decode a PNG-encoded image to a uint8 tensor."
+ description: "The attr `channels` indicates the desired number of color channels for the\ndecoded image.\n\nAccepted values are:\n\n* 0: Use the number of channels in the PNG-encoded image.\n* 1: output a grayscale image.\n* 3: output an RGB image.\n* 4: output an RGBA image.\n\nIf needed, the PNG-encoded image is transformed to match the requested number\nof color channels."
+}
+op {
+ name: "DecodeRaw"
+ input_arg {
+ name: "bytes"
+ description: "All the elements must have the same length."
+ type: DT_STRING
+ }
+ output_arg {
+ name: "output"
+ description: "A Tensor with one more dimension than the input bytes. The\nadded dimension will have size equal to the length of the elements\nof bytes divided by the number of bytes to represent out_type."
+ type_attr: "out_type"
+ }
+ attr {
+ name: "out_type"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ type: DT_INT64
+ }
+ }
+ }
+ attr {
+ name: "little_endian"
+ type: "bool"
+ default_value {
+ b: true
+ }
+ description: "Whether the input bytes are in little-endian order.\nIgnored for out_types that are stored in a single byte like uint8."
+ }
+ summary: "Reinterpret the bytes of a string as a vector of numbers."
+}
+op {
+ name: "DestroyTemporaryVariable"
+ input_arg {
+ name: "ref"
+ description: "A reference to the temporary variable tensor."
+ type_attr: "T"
+ is_ref: true
+ }
+ output_arg {
+ name: "value"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ attr {
+ name: "var_name"
+ type: "string"
+ description: "Name of the temporary variable, usually the name of the matching\n\'TemporaryVariable\' op."
+ }
+ summary: "Destroys the temporary variable and returns its final value."
+ description: "Sets output to the value of the Tensor pointed to by \'ref\', then destroys\nthe temporary variable called \'var_name\'.\nAll other uses of \'ref\' *must* have executed before this op.\nThis is typically achieved by chaining the ref through each assign op, or by\nusing control dependencies.\n\nOutputs the final value of the tensor pointed to by \'ref\'."
+}
+op {
+ name: "Diag"
+ input_arg {
+ name: "diagonal"
+ description: "Rank k tensor where k is at most 3."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ summary: "Returns a diagonal tensor with a given diagonal values."
+ description: "Given a `diagonal`, this operation returns a tensor with the `diagonal` and\neverything else padded with zeros. The diagonal is computed as follows:\n\nAssume `diagonal` has dimensions [D1,..., Dk], then the output is a tensor of\nrank 2k with dimensions [D1,..., Dk, D1,..., Dk] where:\n\n`output[i1,..., ik, i1,..., ik] = diagonal[i1, ..., ik]` and 0 everywhere else.\n\nFor example:\n\n```prettyprint\n# \'diagonal\' is [1, 2, 3, 4]\ntf.diag(diagonal) ==> [[1, 0, 0, 0]\n [0, 2, 0, 0]\n [0, 0, 3, 0]\n [0, 0, 0, 4]]\n```"
+}
+op {
+ name: "Div"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "z"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_COMPLEX64
+ type: DT_INT64
+ }
+ }
+ }
+ summary: "Returns x / y element-wise."
+}
+op {
+ name: "DynamicPartition"
+ input_arg {
+ name: "data"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "partitions"
+ description: "Any shape. Indices in the range `[0, num_partitions)`."
+ type: DT_INT32
+ }
+ output_arg {
+ name: "outputs"
+ type_attr: "T"
+ number_attr: "num_partitions"
+ }
+ attr {
+ name: "num_partitions"
+ type: "int"
+ description: "The number of partitions to output."
+ has_minimum: true
+ minimum: 1
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ summary: "Partitions `data` into `num_partitions` tensors using indices from `partitions`."
+ description: "For each index tuple `js` of size `partitions.ndim`, the slice `data[js, ...]`\nbecomes part of `outputs[partitions[js]]`. The slices with `partitions[js] = i`\nare placed in `outputs[i]` in lexicographic order of `js`, and the first\ndimension of `outputs[i]` is the number of entries in `partitions` equal to `i`.\nIn detail,\n\n outputs[i].shape = [sum(partitions == i)] + data.shape[partitions.ndim:]\n\n outputs[i] = pack([data[js, ...] for js if partitions[js] == i])\n\n`data.shape` must start with `partitions.shape`.\n\nFor example:\n\n # Scalar partitions\n partitions = 1\n num_partitions = 2\n data = [10, 20]\n outputs[0] = [] # Empty with shape [0, 2]\n outputs[1] = [[10, 20]]\n\n # Vector partitions\n partitions = [0, 0, 1, 1, 0]\n num_partitions = 2\n data = [10, 20, 30, 40, 50]\n outputs[0] = [10, 20, 50]\n outputs[1] = [30, 40]\n\n<div style=\"width:70%; margin:auto; margin-bottom:10px; margin-top:20px;\">\n<img style=\"width:100%\" src=\"../images/DynamicPartition.png\" alt>\n</div>"
+}
+op {
+ name: "DynamicStitch"
+ input_arg {
+ name: "indices"
+ type: DT_INT32
+ number_attr: "N"
+ }
+ input_arg {
+ name: "data"
+ type_attr: "T"
+ number_attr: "N"
+ }
+ output_arg {
+ name: "merged"
+ type_attr: "T"
+ }
+ attr {
+ name: "N"
+ type: "int"
+ has_minimum: true
+ minimum: 2
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ summary: "Interleave the values from the `data` tensors into a single tensor."
+ description: "Builds a merged tensor such that\n\n merged[indices[m][i, ..., j], ...] = data[m][i, ..., j, ...]\n\nFor example, if each `indices[m]` is scalar or vector, we have\n\n # Scalar indices\n merged[indices[m], ...] = data[m][...]\n\n # Vector indices\n merged[indices[m][i], ...] = data[m][i, ...]\n\nEach `data[i].shape` must start with the corresponding `indices[i].shape`,\nand the rest of `data[i].shape` must be constant w.r.t. `i`. That is, we\nmust have `data[i].shape = indices[i].shape + constant`. In terms of this\n`constant`, the output shape is\n\n merged.shape = [max(indices)] + constant\n\nValues are merged in order, so if an index appears in both `indices[m][i]` and\n`indices[n][j]` for `(m,i) < (n,j)` the slice `data[n][j]` will appear in the\nmerged result.\n\nFor example:\n\n indices[0] = 6\n indices[1] = [4, 1]\n indices[2] = [[5, 2], [0, 3]]\n data[0] = [61, 62]\n data[1] = [[41, 42], [11, 12]]\n data[2] = [[[51, 52], [21, 22]], [[1, 2], [31, 32]]]\n merged = [[1, 2], [11, 12], [21, 22], [31, 32], [41, 42],\n [51, 52], [61, 62]]\n\n<div style=\"width:70%; margin:auto; margin-bottom:10px; margin-top:20px;\">\n<img style=\"width:100%\" src=\"../images/DynamicStitch.png\" alt>\n</div>"
+}
+op {
+ name: "EditDistance"
+ input_arg {
+ name: "hypothesis_indices"
+ description: "The indices of the hypothesis list SparseTensor.\nThis is an N x R int64 matrix."
+ type: DT_INT64
+ }
+ input_arg {
+ name: "hypothesis_values"
+ description: "The values of the hypothesis list SparseTensor.\nThis is an N-length vector."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "hypothesis_shape"
+ description: "The shape of the hypothesis list SparseTensor.\nThis is an R-length vector."
+ type: DT_INT64
+ }
+ input_arg {
+ name: "truth_indices"
+ description: "The indices of the truth list SparseTensor.\nThis is an M x R int64 matrix."
+ type: DT_INT64
+ }
+ input_arg {
+ name: "truth_values"
+ description: "The values of the truth list SparseTensor.\nThis is an M-length vector."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "truth_shape"
+ description: "truth indices, vector."
+ type: DT_INT64
+ }
+ output_arg {
+ name: "output"
+ description: "A dense float tensor with rank R - 1.\n\nFor the example input:\n\n // hypothesis represents a 2x1 matrix with variable-length values:\n // (0,0) = [\"a\"]\n // (1,0) = [\"b\"]\n hypothesis_indices = [[0, 0, 0],\n [1, 0, 0]]\n hypothesis_values = [\"a\", \"b\"]\n hypothesis_shape = [2, 1, 1]\n\n // truth represents a 2x2 matrix with variable-length values:\n // (0,0) = []\n // (0,1) = [\"a\"]\n // (1,0) = [\"b\", \"c\"]\n // (1,1) = [\"a\"]\n truth_indices = [[0, 1, 0],\n [1, 0, 0],\n [1, 0, 1],\n [1, 1, 0]]\n truth_values = [\"a\", \"b\", \"c\", \"a\"]\n truth_shape = [2, 2, 2]\n normalize = true\n\nThe output will be:\n\n // output is a 2x2 matrix with edit distances normalized by truth lengths.\n output = [[inf, 1.0], // (0,0): no truth, (0,1): no hypothesis\n [0.5, 1.0]] // (1,0): addition, (1,1): no hypothesis"
+ type: DT_FLOAT
+ }
+ attr {
+ name: "normalize"
+ type: "bool"
+ default_value {
+ b: true
+ }
+ description: "boolean (if true, edit distances are normalized by length of truth).\n\nThe output is:"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ summary: "Computes the (possibly normalized) Levenshtein Edit Distance."
+ description: "The inputs are variable-length sequences provided by SparseTensors\n (hypothesis_indices, hypothesis_values, hypothesis_shape)\nand\n (truth_indices, truth_values, truth_shape).\n\nThe inputs are:"
+}
+op {
+ name: "EncodeJpeg"
+ input_arg {
+ name: "image"
+ description: "3-D with shape `[height, width, channels]`."
+ type: DT_UINT8
+ }
+ output_arg {
+ name: "contents"
+ description: "0-D. JPEG-encoded image."
+ type: DT_STRING
+ }
+ attr {
+ name: "format"
+ type: "string"
+ default_value {
+ s: ""
+ }
+ description: "Per pixel image format."
+ allowed_values {
+ list {
+ s: ""
+ s: "grayscale"
+ s: "rgb"
+ }
+ }
+ }
+ attr {
+ name: "quality"
+ type: "int"
+ default_value {
+ i: 95
+ }
+ description: "Quality of the compression from 0 to 100 (higher is better and slower)."
+ }
+ attr {
+ name: "progressive"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ description: "If True, create a JPEG that loads progressively (coarse to fine)."
+ }
+ attr {
+ name: "optimize_size"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ description: "If True, spend CPU/RAM to reduce size with no quality change."
+ }
+ attr {
+ name: "chroma_downsampling"
+ type: "bool"
+ default_value {
+ b: true
+ }
+ description: "See http://en.wikipedia.org/wiki/Chroma_subsampling."
+ }
+ attr {
+ name: "density_unit"
+ type: "string"
+ default_value {
+ s: "in"
+ }
+ description: "Unit used to specify `x_density` and `y_density`:\npixels per inch (`\'in\'`) or centimeter (`\'cm\'`)."
+ allowed_values {
+ list {
+ s: "in"
+ s: "cm"
+ }
+ }
+ }
+ attr {
+ name: "x_density"
+ type: "int"
+ default_value {
+ i: 300
+ }
+ description: "Horizontal pixels per density unit."
+ }
+ attr {
+ name: "y_density"
+ type: "int"
+ default_value {
+ i: 300
+ }
+ description: "Vertical pixels per density unit."
+ }
+ attr {
+ name: "xmp_metadata"
+ type: "string"
+ default_value {
+ s: ""
+ }
+ description: "If not empty, embed this XMP metadata in the image header."
+ }
+ summary: "JPEG-encode an image."
+ description: "`image` is a 3-D uint8 Tensor of shape `[height, width, channels]`.\n\nThe attr `format` can be used to override the color format of the encoded\noutput. Values can be:\n\n* `\'\'`: Use a default format based on the number of channels in the image.\n* `grayscale`: Output a grayscale JPEG image. The `channels` dimension\n of `image` must be 1.\n* `rgb`: Output an RGB JPEG image. The `channels` dimension\n of `image` must be 3.\n\nIf `format` is not specified or is the empty string, a default format is picked\nin function of the number of channels in `image`:\n\n* 1: Output a grayscale image.\n* 3: Output an RGB image."
+}
+op {
+ name: "EncodePng"
+ input_arg {
+ name: "image"
+ description: "3-D with shape `[height, width, channels]`."
+ type: DT_UINT8
+ }
+ output_arg {
+ name: "contents"
+ description: "0-D. PNG-encoded image."
+ type: DT_STRING
+ }
+ attr {
+ name: "compression"
+ type: "int"
+ default_value {
+ i: -1
+ }
+ description: "Compression level."
+ }
+ summary: "PNG-encode an image."
+ description: "`image` is a 3-D uint8 Tensor of shape `[height, width, channels]` where\n`channels` is:\n\n* 1: for grayscale.\n* 3: for RGB.\n* 4: for RGBA.\n\nThe ZLIB compression level, `compression`, can be -1 for the PNG-encoder\ndefault or a value from 0 to 9. 9 is the highest compression level, generating\nthe smallest output, but is slower."
+}
+op {
+ name: "Enter"
+ input_arg {
+ name: "data"
+ description: "The tensor to be made available to the child frame."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ description: "The same tensor as `data`."
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ attr {
+ name: "frame_name"
+ type: "string"
+ description: "The name of the child frame."
+ }
+ attr {
+ name: "is_constant"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ description: "If true, the output is constant within the child frame."
+ }
+ attr {
+ name: "parallel_iterations"
+ type: "int"
+ default_value {
+ i: 10
+ }
+ description: "The number of iterations allowed to run in parallel."
+ }
+ summary: "Creates or finds a child frame, and makes `data` available to the child frame."
+ description: "This op is used together with `Exit` to create loops in the graph.\nThe unique `frame_name` is used by the `Executor` to identify frames. If\n`is_constant` is true, `output` is a constant in the child frame; otherwise\nit may be changed in the child frame. At most `parallel_iterations` iterations\nare run in parallel in the child frame."
+}
+op {
+ name: "Equal"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "z"
+ type: DT_BOOL
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_COMPLEX64
+ type: DT_QUINT8
+ type: DT_QINT8
+ type: DT_QINT32
+ }
+ }
+ }
+ summary: "Returns the truth value of (x == y) element-wise."
+ is_commutative: true
+}
+op {
+ name: "Exit"
+ input_arg {
+ name: "data"
+ description: "The tensor to be made available to the parent frame."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ description: "The same tensor as `data`."
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ summary: "Exits the current frame to its parent frame."
+ description: "Exit makes its input `data` available to the parent frame."
+}
+op {
+ name: "Exp"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_COMPLEX64
+ type: DT_INT64
+ }
+ }
+ }
+ summary: "Computes exponential of x element-wise. \\\\(y = e^x\\\\)."
+}
+op {
+ name: "ExpandDims"
+ input_arg {
+ name: "input"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "dim"
+ description: "0-D (scalar). Specifies the dimension index at which to\nexpand the shape of `input`."
+ type: DT_INT32
+ }
+ output_arg {
+ name: "output"
+ description: "Contains the same data as `input`, but its shape has an additional\ndimension of size 1 added."
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ summary: "Inserts a dimension of 1 into a tensor\'s shape."
+ description: "Given a tensor `input`, this operation inserts a dimension of 1 at the\ndimension index `dim` of `input`\'s shape. The dimension index `dim` starts at\nzero; if you specify a negative number for `dim` it is counted backward from\nthe end.\n\nThis operation is useful if you want to add a batch dimension to a single\nelement. For example, if you have a single image of shape `[height, width,\nchannels]`, you can make it a batch of 1 image with `expand_dims(image, 0)`,\nwhich will make the shape `[1, height, width, channels]`.\n\nOther examples:\n\n```prettyprint\n# \'t\' is a tensor of shape [2]\nshape(expand_dims(t, 0)) ==> [1, 2]\nshape(expand_dims(t, 1)) ==> [2, 1]\nshape(expand_dims(t, -1)) ==> [2, 1]\n\n# \'t2\' is a tensor of shape [2, 3, 5]\nshape(expand_dims(t2, 0)) ==> [1, 2, 3, 5]\nshape(expand_dims(t2, 2)) ==> [2, 3, 1, 5]\nshape(expand_dims(t2, 3)) ==> [2, 3, 5, 1]\n```\n\nThis operation requires that:\n\n`-1-input.dims() <= dim <= input.dims()`\n\nThis operation is related to `squeeze()`, which removes dimensions of\nsize 1."
+}
+op {
+ name: "ExtractGlimpse"
+ input_arg {
+ name: "input"
+ description: "A 4-D float tensor of shape `[batch_size, height, width, channels]`."
+ type: DT_FLOAT
+ }
+ input_arg {
+ name: "size"
+ description: "A 1-D tensor of 2 elements containing the size of the glimpses to extract.\nThe glimpse height must be specified first, following by the glimpse width."
+ type: DT_INT32
+ }
+ input_arg {
+ name: "offsets"
+ description: "A 2-D integer tensor of shape `[batch_size, 2]` containing the x, y\nlocations of the center of each window."
+ type: DT_FLOAT
+ }
+ output_arg {
+ name: "glimpse"
+ description: "A tensor representing the glimpses `[batch_size, glimpse_height,\nglimpse_width, channels]`."
+ type: DT_FLOAT
+ }
+ attr {
+ name: "centered"
+ type: "bool"
+ default_value {
+ b: true
+ }
+ description: "indicates if the offset coordinates are centered relative to\nthe image, in which case the (0, 0) offset is relative to the center of the\ninput images. If false, the (0,0) offset corresponds to the upper left corner\nof the input images."
+ }
+ attr {
+ name: "normalized"
+ type: "bool"
+ default_value {
+ b: true
+ }
+ description: "indicates if the offset coordinates are normalized."
+ }
+ attr {
+ name: "uniform_noise"
+ type: "bool"
+ default_value {
+ b: true
+ }
+ description: "indicates if the noise should be generated using a\nuniform distribution or a gaussian distribution."
+ }
+ summary: "Extracts a glimpse from the input tensor."
+ description: "Returns a set of windows called glimpses extracted at location `offsets`\nfrom the input tensor. If the windows only partially overlaps the inputs, the\nnon overlapping areas will be filled with random noise.\n\nThe result is a 4-D tensor of shape `[batch_size, glimpse_height,\nglimpse_width, channels]`. The channels and batch dimensions are the same as that\nof the input tensor. The height and width of the output windows are\nspecified in the `size` parameter.\n\nThe argument `normalized` and `centered` controls how the windows are built:\n* If the coordinates are normalized but not centered, 0.0 and 1.0\n correspond to the minimum and maximum of each height and width dimension.\n* If the coordinates are both normalized and centered, they range from -1.0 to\n 1.0. The coordinates (-1.0, -1.0) correspond to the upper left corner, the\n lower right corner is located at (1.0, 1.0) and the center is at (0, 0).\n* If the coordinates are not normalized they are interpreted as numbers of pixels."
+}
+op {
+ name: "FIFOQueue"
+ output_arg {
+ name: "handle"
+ description: "The handle to the queue."
+ type: DT_STRING
+ is_ref: true
+ }
+ attr {
+ name: "component_types"
+ type: "list(type)"
+ description: "The type of each component in a value."
+ has_minimum: true
+ minimum: 1
+ }
+ attr {
+ name: "shapes"
+ type: "list(shape)"
+ default_value {
+ list {
+ }
+ }
+ description: "The shape of each component in a value. The length of this attr must\nbe either 0 or the same as the length of component_types. If the length of\nthis attr is 0, the shapes of queue elements are not constrained, and\nonly one element may be dequeued at a time."
+ has_minimum: true
+ }
+ attr {
+ name: "capacity"
+ type: "int"
+ default_value {
+ i: -1
+ }
+ description: "The upper bound on the number of elements in this queue.\nNegative numbers mean no limit."
+ }
+ attr {
+ name: "container"
+ type: "string"
+ default_value {
+ s: ""
+ }
+ description: "If non-empty, this queue is placed in the given container.\nOtherwise, a default container is used."
+ }
+ attr {
+ name: "shared_name"
+ type: "string"
+ default_value {
+ s: ""
+ }
+ description: "If non-empty, this queue will be shared under the given name\nacross multiple sessions."
+ }
+ summary: "A queue that produces elements in first-in first-out order."
+ is_stateful: true
+}
+op {
+ name: "Fact"
+ output_arg {
+ name: "fact"
+ type: DT_STRING
+ }
+ summary: "Output a fact about factorials."
+}
+op {
+ name: "Fill"
+ input_arg {
+ name: "dims"
+ description: "1-D. Represents the shape of the output tensor."
+ type: DT_INT32
+ }
+ input_arg {
+ name: "value"
+ description: "0-D (scalar). Value to fill the returned tensor."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ summary: "Creates a tensor filled with a scalar value."
+ description: "This operation creates a tensor of shape `dims` and fills it with `value`.\n\nFor example:\n\n```prettyprint\n# output tensor shape needs to be [2, 3]\n# so \'dims\' is [2, 3]\nfill(dims, 9) ==> [[9, 9, 9]\n [9, 9, 9]]\n```"
+}
+op {
+ name: "FixedLengthRecordReader"
+ output_arg {
+ name: "reader_handle"
+ description: "The handle to reference the Reader."
+ type: DT_STRING
+ is_ref: true
+ }
+ attr {
+ name: "header_bytes"
+ type: "int"
+ default_value {
+ i: 0
+ }
+ }
+ attr {
+ name: "record_bytes"
+ type: "int"
+ }
+ attr {
+ name: "footer_bytes"
+ type: "int"
+ default_value {
+ i: 0
+ }
+ }
+ attr {
+ name: "container"
+ type: "string"
+ default_value {
+ s: ""
+ }
+ description: "If non-empty, this reader is placed in the given container.\nOtherwise, a default container is used."
+ }
+ attr {
+ name: "shared_name"
+ type: "string"
+ default_value {
+ s: ""
+ }
+ description: "If non-empty, this reader is named in the given bucket\nwith this shared_name. Otherwise, the node name is used instead."
+ }
+ summary: "A Reader that outputs fixed-length records from a file."
+ is_stateful: true
+}
+op {
+ name: "FixedUnigramCandidateSampler"
+ input_arg {
+ name: "true_classes"
+ description: "A batch_size * num_true matrix, in which each row contains the\nIDs of the num_true target_classes in the corresponding original label."
+ type: DT_INT64
+ }
+ output_arg {
+ name: "sampled_candidates"
+ description: "A vector of length num_sampled, in which each element is\nthe ID of a sampled candidate."
+ type: DT_INT64
+ }
+ output_arg {
+ name: "true_expected_count"
+ description: "A batch_size * num_true matrix, representing\nthe number of times each candidate is expected to occur in a batch\nof sampled candidates. If unique=true, then this is a probability."
+ type: DT_FLOAT
+ }
+ output_arg {
+ name: "sampled_expected_count"
+ description: "A vector of length num_sampled, for each sampled\ncandidate represting the number of times the candidate is expected\nto occur in a batch of sampled candidates. If unique=true, then this is a\nprobability."
+ type: DT_FLOAT
+ }
+ attr {
+ name: "num_true"
+ type: "int"
+ description: "Number of true labels per context."
+ has_minimum: true
+ minimum: 1
+ }
+ attr {
+ name: "num_sampled"
+ type: "int"
+ description: "Number of candidates to randomly sample per batch."
+ has_minimum: true
+ minimum: 1
+ }
+ attr {
+ name: "unique"
+ type: "bool"
+ description: "If unique is true, we sample with rejection, so that all sampled\ncandidates in a batch are unique. This requires some approximation to\nestimate the post-rejection sampling probabilities."
+ }
+ attr {
+ name: "range_max"
+ type: "int"
+ description: "The sampler will sample integers from the interval [0, range_max)."
+ has_minimum: true
+ minimum: 1
+ }
+ attr {
+ name: "vocab_file"
+ type: "string"
+ default_value {
+ s: ""
+ }
+ description: "Each valid line in this file (which should have a CSV-like format)\ncorresponds to a valid word ID. IDs are in sequential order, starting from\nnum_reserved_ids. The last entry in each line is expected to be a value\ncorresponding to the count or relative probability. Exactly one of vocab_file\nand unigrams needs to be passed to this op."
+ }
+ attr {
+ name: "distortion"
+ type: "float"
+ default_value {
+ f: 1
+ }
+ description: "The distortion is used to skew the unigram probability distribution.\nEach weight is first raised to the distortion\'s power before adding to the\ninternal unigram distribution. As a result, distortion = 1.0 gives regular\nunigram sampling (as defined by the vocab file), and distortion = 0.0 gives\na uniform distribution."
+ }
+ attr {
+ name: "num_reserved_ids"
+ type: "int"
+ default_value {
+ i: 0
+ }
+ description: "Optionally some reserved IDs can be added in the range [0,\n..., num_reserved_ids) by the users. One use case is that a special unknown\nword token is used as ID 0. These IDs will have a sampling probability of 0."
+ }
+ attr {
+ name: "num_shards"
+ type: "int"
+ default_value {
+ i: 1
+ }
+ description: "A sampler can be used to sample from a subset of the original range\nin order to speed up the whole computation through parallelism. This parameter\n(together with \'shard\') indicates the number of partitions that are being\nused in the overall computation."
+ has_minimum: true
+ minimum: 1
+ }
+ attr {
+ name: "shard"
+ type: "int"
+ default_value {
+ i: 0
+ }
+ description: "A sampler can be used to sample from a subset of the original range\nin order to speed up the whole computation through parallelism. This parameter\n(together with \'num_shards\') indicates the particular partition number of a\nsampler op, when partitioning is being used."
+ has_minimum: true
+ }
+ attr {
+ name: "unigrams"
+ type: "list(float)"
+ default_value {
+ list {
+ }
+ }
+ description: "A list of unigram counts or probabilities, one per ID in sequential\norder. Exactly one of vocab_file and unigrams should be passed to this op."
+ }
+ attr {
+ name: "seed"
+ type: "int"
+ default_value {
+ i: 0
+ }
+ description: "If either seed or seed2 are set to be non-zero, the random number\ngenerator is seeded by the given seed. Otherwise, it is seeded by a\nrandom seed."
+ }
+ attr {
+ name: "seed2"
+ type: "int"
+ default_value {
+ i: 0
+ }
+ description: "An second seed to avoid seed collision."
+ }
+ summary: "Generates labels for candidate sampling with a learned unigram distribution."
+ description: "A unigram sampler could use a fixed unigram distribution read from a\nfile or passed in as an in-memory array instead of building up the distribution\nfrom data on the fly. There is also an option to skew the distribution by\napplying a distortion power to the weights.\n\nThe vocabulary file should be in CSV-like format, with the last field\nbeing the weight associated with the word.\n\nFor each batch, this op picks a single set of sampled candidate labels.\n\nThe advantages of sampling candidates per-batch are simplicity and the\npossibility of efficient dense matrix multiplication. The disadvantage is that\nthe sampled candidates must be chosen independently of the context and of the\ntrue labels."
+}
+op {
+ name: "Floor"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ }
+ }
+ }
+ summary: "Returns element-wise largest integer not greater than x."
+}
+op {
+ name: "Gather"
+ input_arg {
+ name: "params"
+ type_attr: "Tparams"
+ }
+ input_arg {
+ name: "indices"
+ type_attr: "Tindices"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "Tparams"
+ }
+ attr {
+ name: "Tparams"
+ type: "type"
+ }
+ attr {
+ name: "Tindices"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ summary: "Gather slices from `params` according to `indices`."
+ description: "`indices` must be an integer tensor of any dimension (usually 0-D or 1-D).\nProduces an output tensor with shape `indices.shape + params.shape[1:]` where:\n\n # Scalar indices\n output[:, ..., :] = params[indices, :, ... :]\n\n # Vector indices\n output[i, :, ..., :] = params[indices[i], :, ... :]\n\n # Higher rank indices\n output[i, ..., j, :, ... :] = params[indices[i, ..., j], :, ..., :]\n\nIf `indices` is a permutation and `len(indices) == params.shape[0]` then\nthis operation will permute `params` accordingly.\n\n<div style=\"width:70%; margin:auto; margin-bottom:10px; margin-top:20px;\">\n<img style=\"width:100%\" src=\"../images/Gather.png\" alt>\n</div>"
+}
+op {
+ name: "Greater"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "z"
+ type: DT_BOOL
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ summary: "Returns the truth value of (x > y) element-wise."
+}
+op {
+ name: "GreaterEqual"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "z"
+ type: DT_BOOL
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ summary: "Returns the truth value of (x >= y) element-wise."
+}
+op {
+ name: "HashTable"
+ output_arg {
+ name: "table_handle"
+ description: "Handle to a table."
+ type: DT_STRING
+ is_ref: true
+ }
+ attr {
+ name: "container"
+ type: "string"
+ default_value {
+ s: ""
+ }
+ description: "If non-empty, this table is placed in the given container.\nOtherwise, a default container is used."
+ }
+ attr {
+ name: "shared_name"
+ type: "string"
+ default_value {
+ s: ""
+ }
+ description: "If non-empty, this table is shared under the given name across\nmultiple sessions."
+ }
+ attr {
+ name: "key_dtype"
+ type: "type"
+ description: "Type of the table keys."
+ }
+ attr {
+ name: "value_dtype"
+ type: "type"
+ description: "Type of the table values."
+ }
+ summary: "Creates a non-initialized hash table."
+ description: "This op creates a hash table, specifying the type of its keys and values.\nBefore using the table you will have to initialize it. After initialization the\ntable will be immutable."
+}
+op {
+ name: "HistogramSummary"
+ input_arg {
+ name: "tag"
+ description: "Scalar. Tag to use for the `Summary.Value`."
+ type: DT_STRING
+ }
+ input_arg {
+ name: "values"
+ description: "Any shape. Values to use to build the histogram."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "summary"
+ description: "Scalar. Serialized `Summary` protocol buffer."
+ type: DT_STRING
+ }
+ attr {
+ name: "T"
+ type: "type"
+ default_value {
+ type: DT_FLOAT
+ }
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ }
+ }
+ }
+ summary: "Outputs a `Summary` protocol buffer with a histogram."
+ description: "The generated\n[`Summary`](https://tensorflow.googlesource.com/tensorflow/+/master/tensorflow/core/framework/summary.proto)\nhas one summary value containing a histogram for `values`.\n\nThis op reports an `OutOfRange` error if any value is not finite."
+}
+op {
+ name: "Identity"
+ input_arg {
+ name: "input"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ summary: "Return a tensor with the same shape and contents as the input tensor or value."
+}
+op {
+ name: "IdentityReader"
+ output_arg {
+ name: "reader_handle"
+ description: "The handle to reference the Reader."
+ type: DT_STRING
+ is_ref: true
+ }
+ attr {
+ name: "container"
+ type: "string"
+ default_value {
+ s: ""
+ }
+ description: "If non-empty, this reader is placed in the given container.\nOtherwise, a default container is used."
+ }
+ attr {
+ name: "shared_name"
+ type: "string"
+ default_value {
+ s: ""
+ }
+ description: "If non-empty, this reader is named in the given bucket\nwith this shared_name. Otherwise, the node name is used instead."
+ }
+ summary: "A Reader that outputs the queued work as both the key and value."
+ description: "To use, enqueue strings in a Queue. ReaderRead will take the front\nwork string and output (work, work)."
+ is_stateful: true
+}
+op {
+ name: "Imag"
+ input_arg {
+ name: "in"
+ type: DT_COMPLEX64
+ }
+ output_arg {
+ name: "out"
+ type: DT_FLOAT
+ }
+ summary: "Returns the imaginary part of a complex number."
+ description: "Given a tensor `in` of complex numbers, this operation returns a tensor of type\n`float` that is the imaginary part of each element in `in`. All elements in `in`\nmust be complex numbers of the form \\\\(a + bj\\\\), where *a* is the real part\nand *b* is the imaginary part returned by this operation.\n\nFor example:\n\n```\n# tensor \'in\' is [-2.25 + 4.75j, 3.25 + 5.75j]\ntf.imag(in) ==> [4.75, 5.75]\n```"
+}
+op {
+ name: "ImageSummary"
+ input_arg {
+ name: "tag"
+ description: "Scalar. Used to build the `tag` attribute of the summary values."
+ type: DT_STRING
+ }
+ input_arg {
+ name: "tensor"
+ description: "4-D of shape `[batch_size, height, width, channels]` where\n`channels` is 1, 3, or 4."
+ type: DT_FLOAT
+ }
+ output_arg {
+ name: "summary"
+ description: "Scalar. Serialized `Summary` protocol buffer."
+ type: DT_STRING
+ }
+ attr {
+ name: "max_images"
+ type: "int"
+ default_value {
+ i: 3
+ }
+ description: "Max number of batch elements to generate images for."
+ has_minimum: true
+ minimum: 1
+ }
+ attr {
+ name: "bad_color"
+ type: "tensor"
+ default_value {
+ tensor {
+ dtype: DT_UINT8
+ tensor_shape {
+ dim {
+ size: 4
+ }
+ }
+ int_val: 255
+ int_val: 0
+ int_val: 0
+ int_val: 255
+ }
+ }
+ description: "Color to use for pixels with non-finite values."
+ }
+ summary: "Outputs a `Summary` protocol buffer with images."
+ description: "The summary has up to `max_images` summary values containing images. The\nimages are built from `tensor` which must be 4-D with shape `[batch_size,\nheight, width, channels]` and where `channels` can be:\n\n* 1: `tensor` is interpreted as Grayscale.\n* 3: `tensor` is interpreted as RGB.\n* 4: `tensor` is interpreted as RGBA.\n\nThe images have the same number of channels as the input tensor. Their values\nare normalized, one image at a time, to fit in the range `[0, 255]`. The\nop uses two different normalization algorithms:\n\n* If the input values are all positive, they are rescaled so the largest one\n is 255.\n\n* If any input value is negative, the values are shifted so input value 0.0\n is at 127. They are then rescaled so that either the smallest value is 0,\n or the largest one is 255.\n\nThe `tag` argument is a scalar `Tensor` of type `string`. It is used to\nbuild the `tag` of the summary values:\n\n* If `max_images` is 1, the summary value tag is \'*tag*/image\'.\n* If `max_images` is greater than 1, the summary value tags are\n generated sequentially as \'*tag*/image/0\', \'*tag*/image/1\', etc.\n\nThe `bad_color` argument is the color to use in the generated images for\nnon-finite input values. It is a `unit8` 1-D tensor of length `channels`.\nEach element must be in the range `[0, 255]` (It represents the value of a\npixel in the output image). Non-finite values in the input tensor are\nreplaced by this tensor in the output image. The default value is the color\nred."
+}
+op {
+ name: "InTopK"
+ input_arg {
+ name: "predictions"
+ description: "A batch_size x classes tensor"
+ type: DT_FLOAT
+ }
+ input_arg {
+ name: "targets"
+ description: "A batch_size vector of class ids"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "precision"
+ description: "Computed Precision at k as a bool Tensor"
+ type: DT_BOOL
+ }
+ attr {
+ name: "k"
+ type: "int"
+ description: "Number of top elements to look at for computing precision"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ default_value {
+ type: DT_INT32
+ }
+ allowed_values {
+ list {
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ summary: "Says whether the targets are in the top K predictions."
+ description: "This outputs a batch_size bool array, an entry out[i] is true if the\nprediction for the target class is among the top k predictions among\nall predictions for example i. Note that the behavior of InTopK differs\nfrom the TopK op in its handling of ties; if multiple classes have the\nsame prediction value and straddle the top-k boundary, all of those\nclasses are considered to be in the top k.\n\nMore formally, let\n\n \\\\(predictions_i\\\\) be the predictions for all classes for example i,\n \\\\(targets_i\\\\) be the target class for example i,\n \\\\(out_i\\\\) be the output for example i,\n\n$$out_i = predictions_{i, targets_i} \\in TopKIncludingTies(predictions_i)$$"
+}
+op {
+ name: "InitializeTable"
+ input_arg {
+ name: "table_handle"
+ description: "Handle to a table which will be initialized."
+ type: DT_STRING
+ is_ref: true
+ }
+ input_arg {
+ name: "keys"
+ description: "Keys of type Tkey."
+ type_attr: "Tkey"
+ }
+ input_arg {
+ name: "values"
+ description: "Values of type Tval. Same shape as `keys`."
+ type_attr: "Tval"
+ }
+ attr {
+ name: "Tkey"
+ type: "type"
+ }
+ attr {
+ name: "Tval"
+ type: "type"
+ }
+ summary: "Table initializer that takes two tensors for keys and values respectively."
+}
+op {
+ name: "Inv"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_COMPLEX64
+ type: DT_INT64
+ }
+ }
+ }
+ summary: "Computes the reciprocal of x element-wise."
+ description: "I.e., \\\\(y = 1 / x\\\\)."
+}
+op {
+ name: "InvertPermutation"
+ input_arg {
+ name: "x"
+ description: "1-D."
+ type: DT_INT32
+ }
+ output_arg {
+ name: "y"
+ description: "1-D."
+ type: DT_INT32
+ }
+ summary: "Computes the inverse permutation of a tensor."
+ description: "This operation computes the inverse of an index permutation. It takes a 1-D\ninteger tensor `x`, which represents the indices of a zero-based array, and\nswaps each value with its index position. In other words, for an ouput tensor\n`y` and an input tensor `x`, this operation computes the following:\n\n`y[x[i]] = i for i in [0, 1, ..., len(x) - 1]`\n\nThe values must include 0. There can be no duplicate values or negative values.\n\nFor example:\n\n```prettyprint\n# tensor `x` is [3, 4, 0, 2, 1]\ninvert_permutation(x) ==> [2, 4, 3, 0, 1]\n```"
+}
+op {
+ name: "IsFinite"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type: DT_BOOL
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ }
+ }
+ }
+ summary: "Returns which elements of x are finite."
+}
+op {
+ name: "IsInf"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type: DT_BOOL
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ }
+ }
+ }
+ summary: "Returns which elements of x are Inf."
+}
+op {
+ name: "IsNan"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type: DT_BOOL
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ }
+ }
+ }
+ summary: "Returns which elements of x are NaN."
+}
+op {
+ name: "L2Loss"
+ input_arg {
+ name: "t"
+ description: "Typically 2-D, but may have any dimensions."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ description: "0-D."
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT64
+ type: DT_INT32
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ type: DT_COMPLEX64
+ type: DT_QINT8
+ type: DT_QUINT8
+ type: DT_QINT32
+ }
+ }
+ }
+ summary: "L2 Loss."
+ description: "Computes half the L2 norm of a tensor without the `sqrt`:\n\n output = sum(t ** 2) / 2"
+}
+op {
+ name: "LRN"
+ input_arg {
+ name: "input"
+ description: "4-D."
+ type: DT_FLOAT
+ }
+ output_arg {
+ name: "output"
+ type: DT_FLOAT
+ }
+ attr {
+ name: "depth_radius"
+ type: "int"
+ default_value {
+ i: 5
+ }
+ description: "0-D. Half-width of the 1-D normalization window."
+ }
+ attr {
+ name: "bias"
+ type: "float"
+ default_value {
+ f: 1
+ }
+ description: "An offset (usually positive to avoid dividing by 0)."
+ }
+ attr {
+ name: "alpha"
+ type: "float"
+ default_value {
+ f: 1
+ }
+ description: "A scale factor, usually positive."
+ }
+ attr {
+ name: "beta"
+ type: "float"
+ default_value {
+ f: 0.5
+ }
+ description: "An exponent."
+ }
+ summary: "Local Response Normalization."
+ description: "The 4-D `input` tensor is treated as a 3-D array of 1-D vectors (along the last\ndimension), and each vector is normalized independently. Within a given vector,\neach component is divided by the weighted, squared sum of inputs within\n`depth_radius`. In detail,\n\n sqr_sum[a, b, c, d] =\n sum(input[a, b, c, d - depth_radius : d + depth_radius + 1] ** 2)\n output = input / (bias + alpha * sqr_sum ** beta)\n\nFor details, see [Krizhevsky et al., ImageNet classification with deep\nconvolutional neural networks (NIPS 2012)]\n(http://papers.nips.cc/paper/4824-imagenet-classification-with-deep-convolutional-neural-networks)."
+}
+op {
+ name: "LRNGrad"
+ input_arg {
+ name: "input_grads"
+ description: "4-D with shape `[batch, height, width, channels]`."
+ type: DT_FLOAT
+ }
+ input_arg {
+ name: "input_image"
+ description: "4-D with shape `[batch, height, width, channels]`."
+ type: DT_FLOAT
+ }
+ input_arg {
+ name: "output_image"
+ description: "4-D with shape `[batch, height, width, channels]`."
+ type: DT_FLOAT
+ }
+ output_arg {
+ name: "output"
+ description: "The gradients for LRN."
+ type: DT_FLOAT
+ }
+ attr {
+ name: "depth_radius"
+ type: "int"
+ default_value {
+ i: 5
+ }
+ description: "A depth radius."
+ }
+ attr {
+ name: "bias"
+ type: "float"
+ default_value {
+ f: 1
+ }
+ description: "An offset (usually > 0 to avoid dividing by 0)."
+ }
+ attr {
+ name: "alpha"
+ type: "float"
+ default_value {
+ f: 1
+ }
+ description: "A scale factor, usually positive."
+ }
+ attr {
+ name: "beta"
+ type: "float"
+ default_value {
+ f: 0.5
+ }
+ description: "An exponent."
+ }
+ summary: "Gradients for Local Response Normalization."
+}
+op {
+ name: "LearnedUnigramCandidateSampler"
+ input_arg {
+ name: "true_classes"
+ description: "A batch_size * num_true matrix, in which each row contains the\nIDs of the num_true target_classes in the corresponding original label."
+ type: DT_INT64
+ }
+ output_arg {
+ name: "sampled_candidates"
+ description: "A vector of length num_sampled, in which each element is\nthe ID of a sampled candidate."
+ type: DT_INT64
+ }
+ output_arg {
+ name: "true_expected_count"
+ description: "A batch_size * num_true matrix, representing\nthe number of times each candidate is expected to occur in a batch\nof sampled candidates. If unique=true, then this is a probability."
+ type: DT_FLOAT
+ }
+ output_arg {
+ name: "sampled_expected_count"
+ description: "A vector of length num_sampled, for each sampled\ncandidate represting the number of times the candidate is expected\nto occur in a batch of sampled candidates. If unique=true, then this is a\nprobability."
+ type: DT_FLOAT
+ }
+ attr {
+ name: "num_true"
+ type: "int"
+ description: "Number of true labels per context."
+ has_minimum: true
+ minimum: 1
+ }
+ attr {
+ name: "num_sampled"
+ type: "int"
+ description: "Number of candidates to randomly sample per batch."
+ has_minimum: true
+ minimum: 1
+ }
+ attr {
+ name: "unique"
+ type: "bool"
+ description: "If unique is true, we sample with rejection, so that all sampled\ncandidates in a batch are unique. This requires some approximation to\nestimate the post-rejection sampling probabilities."
+ }
+ attr {
+ name: "range_max"
+ type: "int"
+ description: "The sampler will sample integers from the interval [0, range_max)."
+ has_minimum: true
+ minimum: 1
+ }
+ attr {
+ name: "seed"
+ type: "int"
+ default_value {
+ i: 0
+ }
+ description: "If either seed or seed2 are set to be non-zero, the random number\ngenerator is seeded by the given seed. Otherwise, it is seeded by a\nrandom seed."
+ }
+ attr {
+ name: "seed2"
+ type: "int"
+ default_value {
+ i: 0
+ }
+ description: "An second seed to avoid seed collision."
+ }
+ summary: "Generates labels for candidate sampling with a learned unigram distribution."
+ description: "See explanations of candidate sampling and the data formats at\ngo/candidate-sampling.\n\nFor each batch, this op picks a single set of sampled candidate labels.\n\nThe advantages of sampling candidates per-batch are simplicity and the\npossibility of efficient dense matrix multiplication. The disadvantage is that\nthe sampled candidates must be chosen independently of the context and of the\ntrue labels."
+}
+op {
+ name: "Less"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "z"
+ type: DT_BOOL
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ summary: "Returns the truth value of (x < y) element-wise."
+}
+op {
+ name: "LessEqual"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "z"
+ type: DT_BOOL
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ summary: "Returns the truth value of (x <= y) element-wise."
+}
+op {
+ name: "LinSpace"
+ input_arg {
+ name: "start"
+ description: "First entry in the range."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "stop"
+ description: "Last entry in the range."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "num"
+ description: "Number of values to generate."
+ type: DT_INT32
+ }
+ output_arg {
+ name: "output"
+ description: "1-D. The generated values."
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ }
+ }
+ }
+ summary: "Generates values in an interval."
+ description: "A sequence of `num` evenly-spaced values are generated beginning at `start`.\nIf `num > 1`, the values in the sequence increase by `stop - start / num - 1`,\nso that the last one is exactly `stop`.\n\nFor example:\n\n```\ntf.linspace(10.0, 12.0, 3, name=\"linspace\") => [ 10.0 11.0 12.0]\n```"
+}
+op {
+ name: "ListDiff"
+ input_arg {
+ name: "x"
+ description: "1-D. Values to keep."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "y"
+ description: "1-D. Values to remove."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "out"
+ description: "1-D. Values present in `x` but not in `y`."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "idx"
+ description: "1-D. Positions of `x` values preserved in `out`."
+ type: DT_INT32
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ summary: "Computes the difference between two lists of numbers or strings."
+ description: "Given a list `x` and a list `y`, this operation returns a list `out` that\nrepresents all values that are in `x` but not in `y`. The returned list `out`\nis sorted in the same order that the numbers appear in `x` (duplicates are\npreserved). This operation also returns a list `idx` that represents the\nposition of each `out` element in `x`. In other words:\n\n`out[i] = x[idx[i]] for i in [0, 1, ..., len(out) - 1]`\n\nFor example, given this input:\n\n```prettyprint\nx = [1, 2, 3, 4, 5, 6]\ny = [1, 3, 5]\n```\n\nThis operation would return:\n\n```prettyprint\nout ==> [2, 4, 6]\nidx ==> [1, 3, 5]\n```"
+}
+op {
+ name: "Log"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_COMPLEX64
+ type: DT_INT64
+ }
+ }
+ }
+ summary: "Computes natural logrithm of x element-wise."
+ description: "I.e., \\\\(y = \\log_e x\\\\)."
+}
+op {
+ name: "LogUniformCandidateSampler"
+ input_arg {
+ name: "true_classes"
+ description: "A batch_size * num_true matrix, in which each row contains the\nIDs of the num_true target_classes in the corresponding original label."
+ type: DT_INT64
+ }
+ output_arg {
+ name: "sampled_candidates"
+ description: "A vector of length num_sampled, in which each element is\nthe ID of a sampled candidate."
+ type: DT_INT64
+ }
+ output_arg {
+ name: "true_expected_count"
+ description: "A batch_size * num_true matrix, representing\nthe number of times each candidate is expected to occur in a batch\nof sampled candidates. If unique=true, then this is a probability."
+ type: DT_FLOAT
+ }
+ output_arg {
+ name: "sampled_expected_count"
+ description: "A vector of length num_sampled, for each sampled\ncandidate represting the number of times the candidate is expected\nto occur in a batch of sampled candidates. If unique=true, then this is a\nprobability."
+ type: DT_FLOAT
+ }
+ attr {
+ name: "num_true"
+ type: "int"
+ description: "Number of true labels per context."
+ has_minimum: true
+ minimum: 1
+ }
+ attr {
+ name: "num_sampled"
+ type: "int"
+ description: "Number of candidates to randomly sample per batch."
+ has_minimum: true
+ minimum: 1
+ }
+ attr {
+ name: "unique"
+ type: "bool"
+ description: "If unique is true, we sample with rejection, so that all sampled\ncandidates in a batch are unique. This requires some approximation to\nestimate the post-rejection sampling probabilities."
+ }
+ attr {
+ name: "range_max"
+ type: "int"
+ description: "The sampler will sample integers from the interval [0, range_max)."
+ has_minimum: true
+ minimum: 1
+ }
+ attr {
+ name: "seed"
+ type: "int"
+ default_value {
+ i: 0
+ }
+ description: "If either seed or seed2 are set to be non-zero, the random number\ngenerator is seeded by the given seed. Otherwise, it is seeded by a\nrandom seed."
+ }
+ attr {
+ name: "seed2"
+ type: "int"
+ default_value {
+ i: 0
+ }
+ description: "An second seed to avoid seed collision."
+ }
+ summary: "Generates labels for candidate sampling with a log-uniform distribution."
+ description: "See explanations of candidate sampling and the data formats at\ngo/candidate-sampling.\n\nFor each batch, this op picks a single set of sampled candidate labels.\n\nThe advantages of sampling candidates per-batch are simplicity and the\npossibility of efficient dense matrix multiplication. The disadvantage is that\nthe sampled candidates must be chosen independently of the context and of the\ntrue labels."
+}
+op {
+ name: "LogicalAnd"
+ input_arg {
+ name: "x"
+ type: DT_BOOL
+ }
+ input_arg {
+ name: "y"
+ type: DT_BOOL
+ }
+ output_arg {
+ name: "z"
+ type: DT_BOOL
+ }
+ summary: "Returns the truth value of x AND y element-wise."
+ is_commutative: true
+}
+op {
+ name: "LogicalNot"
+ input_arg {
+ name: "x"
+ type: DT_BOOL
+ }
+ output_arg {
+ name: "y"
+ type: DT_BOOL
+ }
+ summary: "Returns the truth value of NOT x element-wise."
+}
+op {
+ name: "LogicalOr"
+ input_arg {
+ name: "x"
+ type: DT_BOOL
+ }
+ input_arg {
+ name: "y"
+ type: DT_BOOL
+ }
+ output_arg {
+ name: "z"
+ type: DT_BOOL
+ }
+ summary: "Returns the truth value of x OR y element-wise."
+ is_commutative: true
+}
+op {
+ name: "LookupTableFind"
+ input_arg {
+ name: "table_handle"
+ description: "Handle to the table."
+ type: DT_STRING
+ is_ref: true
+ }
+ input_arg {
+ name: "keys"
+ description: "Any shape. Keys to look up."
+ type_attr: "Tin"
+ }
+ input_arg {
+ name: "default_value"
+ type_attr: "Tout"
+ }
+ output_arg {
+ name: "values"
+ description: "Same shape as `keys`. Values found in the table, or `default_values`\nfor missing keys."
+ type_attr: "Tout"
+ }
+ attr {
+ name: "Tin"
+ type: "type"
+ }
+ attr {
+ name: "Tout"
+ type: "type"
+ }
+ summary: "Looks up keys in a table, outputs the corresponding values."
+ description: "The tensor `keys` must of the same type as the keys of the table.\nThe output `values` is of the type of the table values.\n\nThe scalar `default_value` is the value output for keys not present in the\ntable. It must also be of the same type as the table values."
+}
+op {
+ name: "LookupTableSize"
+ input_arg {
+ name: "table_handle"
+ description: "Handle to the table."
+ type: DT_STRING
+ is_ref: true
+ }
+ output_arg {
+ name: "size"
+ description: "Scalar that contains number of elements in the table."
+ type: DT_INT64
+ }
+ summary: "Computes the number of elements in the given table."
+}
+op {
+ name: "LoopCond"
+ input_arg {
+ name: "input"
+ description: "= A boolean scalar, representing the branch predicate of the Switch op."
+ type: DT_BOOL
+ }
+ output_arg {
+ name: "output"
+ description: "The same tensor as `input`."
+ type: DT_BOOL
+ }
+ summary: "Forwards the input to the output."
+ description: "This operator represents the loop termination condition used by the\n\"pivot\" switches of a loop."
+}
+op {
+ name: "MatMul"
+ input_arg {
+ name: "a"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "b"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "product"
+ type_attr: "T"
+ }
+ attr {
+ name: "transpose_a"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ description: "If true, \"a\" is transposed before multiplication."
+ }
+ attr {
+ name: "transpose_b"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ description: "If true, \"b\" is transposed before multiplication."
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_COMPLEX64
+ }
+ }
+ }
+ summary: "Multiply the matrix \"a\" by the matrix \"b\"."
+ description: "The inputs must be two-dimensional matrices and the inner dimension of\n\"a\" (after being transposed if transpose_a is true) must match the\nouter dimension of \"b\" (after being transposed if transposed_b is\ntrue).\n\n*Note*: The default kernel implementation for MatMul on GPUs uses\ncublas."
+}
+op {
+ name: "MatchingFiles"
+ input_arg {
+ name: "pattern"
+ description: "A (scalar) shell wildcard pattern."
+ type: DT_STRING
+ }
+ output_arg {
+ name: "filenames"
+ description: "A vector of matching filenames."
+ type: DT_STRING
+ }
+ summary: "Returns the set of files matching a pattern."
+ description: "Note that this routine only supports wildcard characters in the\nbasename portion of the pattern, not in the directory portion."
+}
+op {
+ name: "MatrixDeterminant"
+ input_arg {
+ name: "input"
+ description: "A tensor of shape `[M, M]`."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ description: "A scalar, equal to the determinant of the input."
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ description: "The type of values in the input and output."
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ }
+ }
+ }
+ summary: "Calculates the determinant of a square matrix."
+}
+op {
+ name: "MatrixInverse"
+ input_arg {
+ name: "input"
+ description: "Shape is `[M, M]`."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ description: "Shape is `[M, M]` containing the matrix inverse of the input."
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ description: "The type of values in the input and output."
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ }
+ }
+ }
+ summary: "Calculates the inverse of a square invertible matrix."
+ description: "The op uses the Cholesky decomposition if the matrix is symmetric positive\ndefinite and LU decomposition with partial pivoting otherwise.\n\nIf the matrix is not invertible there is no guarantee what the op does. It\nmay detect the condition and raise an exception or it may simply return a\ngarbage result."
+}
+op {
+ name: "Max"
+ input_arg {
+ name: "input"
+ description: "The tensor to reduce."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "reduction_indices"
+ description: "The dimensions to reduce."
+ type: DT_INT32
+ }
+ output_arg {
+ name: "output"
+ description: "The reduced tensor."
+ type_attr: "T"
+ }
+ attr {
+ name: "keep_dims"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ description: "If true, retain reduced dimensions with length 1."
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT64
+ type: DT_INT32
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ type: DT_COMPLEX64
+ type: DT_QINT8
+ type: DT_QUINT8
+ type: DT_QINT32
+ }
+ }
+ }
+ summary: "Computes the maximum of elements across dimensions of a tensor."
+ description: "Reduces `input` along the dimensions given in `reduction_indices`. Unless\n`keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in\n`reduction_indices`. If `keep_dims` is true, the reduced dimensions are\nretained with length 1."
+}
+op {
+ name: "MaxPool"
+ input_arg {
+ name: "input"
+ description: "4-D input to pool over."
+ type: DT_FLOAT
+ }
+ output_arg {
+ name: "output"
+ description: "The max pooled output tensor."
+ type: DT_FLOAT
+ }
+ attr {
+ name: "ksize"
+ type: "list(int)"
+ description: "The size of the window for each dimension of the input tensor."
+ has_minimum: true
+ minimum: 4
+ }
+ attr {
+ name: "strides"
+ type: "list(int)"
+ description: "The stride of the sliding window for each dimension of the\ninput tensor."
+ has_minimum: true
+ minimum: 4
+ }
+ attr {
+ name: "padding"
+ type: "string"
+ description: "The type of padding algorithm to use."
+ allowed_values {
+ list {
+ s: "SAME"
+ s: "VALID"
+ }
+ }
+ }
+ summary: "Performs max pooling on the input."
+}
+op {
+ name: "MaxPoolGrad"
+ input_arg {
+ name: "orig_input"
+ description: "The original input tensor."
+ type: DT_FLOAT
+ }
+ input_arg {
+ name: "orig_output"
+ description: "The original output tensor."
+ type: DT_FLOAT
+ }
+ input_arg {
+ name: "grad"
+ description: "4-D. Gradients w.r.t. the output of `max_pool`."
+ type: DT_FLOAT
+ }
+ output_arg {
+ name: "output"
+ description: "Gradients w.r.t. the input to `max_pool`."
+ type: DT_FLOAT
+ }
+ attr {
+ name: "ksize"
+ type: "list(int)"
+ description: "The size of the window for each dimension of the input tensor."
+ has_minimum: true
+ minimum: 4
+ }
+ attr {
+ name: "strides"
+ type: "list(int)"
+ description: "The stride of the sliding window for each dimension of the\ninput tensor."
+ has_minimum: true
+ minimum: 4
+ }
+ attr {
+ name: "padding"
+ type: "string"
+ description: "The type of padding algorithm to use."
+ allowed_values {
+ list {
+ s: "SAME"
+ s: "VALID"
+ }
+ }
+ }
+ summary: "Computes gradients of the maxpooling function."
+}
+op {
+ name: "MaxPoolGradWithArgmax"
+ input_arg {
+ name: "input"
+ description: "The original input."
+ type: DT_FLOAT
+ }
+ input_arg {
+ name: "grad"
+ description: "4-D with shape `[batch, height, width, channels]`. Gradients w.r.t. the\noutput of `max_pool`."
+ type: DT_FLOAT
+ }
+ input_arg {
+ name: "argmax"
+ description: "The indices of the maximum values chosen for each output of `max_pool`."
+ type_attr: "Targmax"
+ }
+ output_arg {
+ name: "output"
+ description: "Gradients w.r.t. the input of `max_pool`."
+ type: DT_FLOAT
+ }
+ attr {
+ name: "ksize"
+ type: "list(int)"
+ description: "The size of the window for each dimension of the input tensor."
+ has_minimum: true
+ minimum: 4
+ }
+ attr {
+ name: "strides"
+ type: "list(int)"
+ description: "The stride of the sliding window for each dimension of the\ninput tensor."
+ has_minimum: true
+ minimum: 4
+ }
+ attr {
+ name: "padding"
+ type: "string"
+ description: "The type of padding algorithm to use."
+ allowed_values {
+ list {
+ s: "SAME"
+ s: "VALID"
+ }
+ }
+ }
+ attr {
+ name: "Targmax"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ summary: "Computes gradients of the maxpooling function."
+}
+op {
+ name: "MaxPoolWithArgmax"
+ input_arg {
+ name: "input"
+ description: "4-D with shape `[batch, height, width, channels]`. Input to pool over."
+ type: DT_FLOAT
+ }
+ output_arg {
+ name: "output"
+ description: "The max pooled output tensor."
+ type: DT_FLOAT
+ }
+ output_arg {
+ name: "argmax"
+ description: "4-D. The flattened indices of the max values chosen for each output."
+ type_attr: "Targmax"
+ }
+ attr {
+ name: "ksize"
+ type: "list(int)"
+ description: "The size of the window for each dimension of the input tensor."
+ has_minimum: true
+ minimum: 4
+ }
+ attr {
+ name: "strides"
+ type: "list(int)"
+ description: "The stride of the sliding window for each dimension of the\ninput tensor."
+ has_minimum: true
+ minimum: 4
+ }
+ attr {
+ name: "Targmax"
+ type: "type"
+ default_value {
+ type: DT_INT64
+ }
+ allowed_values {
+ list {
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ attr {
+ name: "padding"
+ type: "string"
+ description: "The type of padding algorithm to use."
+ allowed_values {
+ list {
+ s: "SAME"
+ s: "VALID"
+ }
+ }
+ }
+ summary: "Performs max pooling on the input and outputs both max values and indices."
+ description: "The indices in `argmax` are flattened, so that a maximum value at position\n`[b, y, x, c]` becomes flattened index\n`((b * height + y) * width + x) * channels + c`."
+}
+op {
+ name: "Maximum"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "z"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ summary: "Returns the max of x and y (i.e. x > y ? x : y) element-wise, broadcasts."
+ is_commutative: true
+}
+op {
+ name: "Mean"
+ input_arg {
+ name: "input"
+ description: "The tensor to reduce."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "reduction_indices"
+ description: "The dimensions to reduce."
+ type: DT_INT32
+ }
+ output_arg {
+ name: "output"
+ description: "The reduced tensor."
+ type_attr: "T"
+ }
+ attr {
+ name: "keep_dims"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ description: "If true, retain reduced dimensions with length 1."
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT64
+ type: DT_INT32
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ type: DT_COMPLEX64
+ type: DT_QINT8
+ type: DT_QUINT8
+ type: DT_QINT32
+ }
+ }
+ }
+ summary: "Computes the mean of elements across dimensions of a tensor."
+ description: "Reduces `input` along the dimensions given in `reduction_indices`. Unless\n`keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in\n`reduction_indices`. If `keep_dims` is true, the reduced dimensions are\nretained with length 1."
+}
+op {
+ name: "Merge"
+ input_arg {
+ name: "inputs"
+ description: "The input tensors, exactly one of which will become available."
+ type_attr: "T"
+ number_attr: "N"
+ }
+ output_arg {
+ name: "output"
+ description: "Will be set to the available input tensor."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "value_index"
+ description: "The index of the chosen input tensor in `inputs`."
+ type: DT_INT32
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ attr {
+ name: "N"
+ type: "int"
+ has_minimum: true
+ minimum: 1
+ }
+ summary: "Forwards the value of an available tensor from `inputs` to `output`."
+ description: "`Merge` waits for at least one of the tensors in `inputs` to become available.\nIt is usually combined with `Switch` to implement branching.\n\n`Merge` forwards the first tensor for become available to `output`, and sets\n`value_index` to its index in `inputs`.\n\nIt is an error if more than one tensor in `inputs` is available."
+}
+op {
+ name: "MergeSummary"
+ input_arg {
+ name: "inputs"
+ description: "Can be of any shape. Each must contain serialized `Summary` protocol\nbuffers."
+ type: DT_STRING
+ number_attr: "N"
+ }
+ output_arg {
+ name: "summary"
+ description: "Scalar. Serialized `Summary` protocol buffer."
+ type: DT_STRING
+ }
+ attr {
+ name: "N"
+ type: "int"
+ has_minimum: true
+ minimum: 1
+ }
+ summary: "Merges summaries."
+ description: "This op creates a\n[`Summary`](https://tensorflow.googlesource.com/tensorflow/+/master/tensorflow/core/framework/summary.proto)\nprotocol buffer that contains the union of all the values in the input\nsummaries.\n\nWhen the Op is run, it reports an `InvalidArgument` error if multiple values\nin the summaries to merge use the same tag."
+}
+op {
+ name: "Min"
+ input_arg {
+ name: "input"
+ description: "The tensor to reduce."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "reduction_indices"
+ description: "The dimensions to reduce."
+ type: DT_INT32
+ }
+ output_arg {
+ name: "output"
+ description: "The reduced tensor."
+ type_attr: "T"
+ }
+ attr {
+ name: "keep_dims"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ description: "If true, retain reduced dimensions with length 1."
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT64
+ type: DT_INT32
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ type: DT_COMPLEX64
+ type: DT_QINT8
+ type: DT_QUINT8
+ type: DT_QINT32
+ }
+ }
+ }
+ summary: "Computes the minimum of elements across dimensions of a tensor."
+ description: "Reduces `input` along the dimensions given in `reduction_indices`. Unless\n`keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in\n`reduction_indices`. If `keep_dims` is true, the reduced dimensions are\nretained with length 1."
+}
+op {
+ name: "Minimum"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "z"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ summary: "Returns the min of x and y (i.e. x < y ? x : y) element-wise, broadcasts."
+ is_commutative: true
+}
+op {
+ name: "Mod"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "z"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ }
+ }
+ }
+ summary: "Returns element-wise remainder of division."
+}
+op {
+ name: "Mul"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "z"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT8
+ type: DT_INT16
+ type: DT_INT32
+ type: DT_COMPLEX64
+ type: DT_INT64
+ }
+ }
+ }
+ summary: "Returns x * y element-wise."
+ is_commutative: true
+}
+op {
+ name: "Neg"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_COMPLEX64
+ type: DT_INT64
+ }
+ }
+ }
+ summary: "Computes numerical negative value element-wise."
+ description: "I.e., \\\\(y = -x\\\\)."
+}
+op {
+ name: "NegTrain"
+ input_arg {
+ name: "w_in"
+ description: "input word embedding."
+ type: DT_FLOAT
+ is_ref: true
+ }
+ input_arg {
+ name: "w_out"
+ description: "output word embedding."
+ type: DT_FLOAT
+ is_ref: true
+ }
+ input_arg {
+ name: "examples"
+ description: "A vector of word ids."
+ type: DT_INT32
+ }
+ input_arg {
+ name: "labels"
+ description: "A vector of word ids."
+ type: DT_INT32
+ }
+ input_arg {
+ name: "lr"
+ type: DT_FLOAT
+ }
+ attr {
+ name: "vocab_count"
+ type: "list(int)"
+ description: "Count of words in the vocabulary."
+ }
+ attr {
+ name: "num_negative_samples"
+ type: "int"
+ description: "Number of negative samples per exaple."
+ }
+ summary: "Training via negative sampling."
+}
+op {
+ name: "NextIteration"
+ input_arg {
+ name: "data"
+ description: "The tensor to be made available to the next iteration."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ description: "The same tensor as `data`."
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ summary: "Makes its input available to the next iteration."
+}
+op {
+ name: "NoOp"
+ summary: "Does nothing. Only useful as a placeholder for control edges."
+}
+op {
+ name: "NotEqual"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "z"
+ type: DT_BOOL
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_COMPLEX64
+ type: DT_QUINT8
+ type: DT_QINT8
+ type: DT_QINT32
+ }
+ }
+ }
+ summary: "Returns the truth value of (x != y) element-wise."
+ is_commutative: true
+}
+op {
+ name: "Pack"
+ input_arg {
+ name: "values"
+ description: "Must be of same shape and type."
+ type_attr: "T"
+ number_attr: "N"
+ }
+ output_arg {
+ name: "output"
+ description: "The packed tensor."
+ type_attr: "T"
+ }
+ attr {
+ name: "N"
+ type: "int"
+ has_minimum: true
+ minimum: 1
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ summary: "Packs a list of `N` rank-`R` tensors into one rank-`(R+1)` tensor."
+ description: "Packs the `N` tensors in `values` into a tensor with rank one higher than each\ntensor in `values` and shape `[N] + values[0].shape`. The output satisfies\n`output[i, ...] = values[i][...]`.\n\nThis is the opposite of `unpack`."
+}
+op {
+ name: "Pad"
+ input_arg {
+ name: "input"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "paddings"
+ type: DT_INT32
+ }
+ output_arg {
+ name: "output"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ summary: "Pads a tensor with zeros."
+ description: "This operation pads a `input` with zeros according to the `paddings` you\nspecify. `paddings` is an integer tensor with shape `[Dn, 2]`, where n is the\nrank of `input`. For each dimension D of `input`, `paddings[D, 0]` indicates\nhow many zeros to add before the contents of `input` in that dimension, and\n`paddings[D, 1]` indicates how many zeros to add after the contents of `input`\nin that dimension.\n\nThe padded size of each dimension D of the output is:\n\n`paddings(D, 0) + input.dim_size(D) + paddings(D, 1)`\n\nFor example:\n\n```prettyprint\n# \'t\' is [[1, 1], [2, 2]]\n# \'paddings\' is [[1, 1]], [2, 2]]\n# rank of \'t\' is 2\npad(t, paddings) ==> [[0, 0, 0, 0, 0]\n [0, 0, 0, 0, 0]\n [0, 1, 1, 0, 0]\n [[0, 2, 2, 0, 0]\n [0, 0, 0, 0, 0]]\n```"
+}
+op {
+ name: "ParseExample"
+ input_arg {
+ name: "serialized"
+ description: "A vector containing a batch of binary serialized Example protos."
+ type: DT_STRING
+ }
+ input_arg {
+ name: "names"
+ description: "A vector containing the names of the serialized protos.\nMay contain, for example, table key (descriptive) names for the\ncorresponding serialized protos. These are purely useful for debugging\npurposes, and the presence of values here has no effect on the output.\nMay also be an empty vector if no names are available.\nIf non-empty, this vector must be the same length as \"serialized\"."
+ type: DT_STRING
+ }
+ input_arg {
+ name: "sparse_keys"
+ description: "A list of Nsparse string Tensors (scalars).\nThe keys expected in the Examples\' features associated with sparse values."
+ type: DT_STRING
+ number_attr: "Nsparse"
+ }
+ input_arg {
+ name: "dense_keys"
+ description: "A list of Ndense string Tensors (scalars).\nThe keys expected in the Examples\' features associated with dense values."
+ type: DT_STRING
+ number_attr: "Ndense"
+ }
+ input_arg {
+ name: "dense_defaults"
+ description: "A list of Ndense Tensors (some may be empty).\ndense_defaults[j] provides default values\nwhen the example\'s feature_map lacks dense_key[j]. If an empty Tensor is\nprovided for dense_defaults[j], then the Feature dense_keys[j] is required.\nThe input type is inferred from dense_defaults[j], even when it\'s empty.\nIf dense_defaults[j] is not empty, its shape must match dense_shapes[j]."
+ type_list_attr: "Tdense"
+ }
+ output_arg {
+ name: "sparse_indices"
+ type: DT_INT64
+ number_attr: "Nsparse"
+ }
+ output_arg {
+ name: "sparse_values"
+ type_list_attr: "sparse_types"
+ }
+ output_arg {
+ name: "sparse_shapes"
+ type: DT_INT64
+ number_attr: "Nsparse"
+ }
+ output_arg {
+ name: "dense_values"
+ type_list_attr: "Tdense"
+ }
+ attr {
+ name: "Nsparse"
+ type: "int"
+ has_minimum: true
+ }
+ attr {
+ name: "Ndense"
+ type: "int"
+ has_minimum: true
+ }
+ attr {
+ name: "sparse_types"
+ type: "list(type)"
+ description: "A list of Nsparse types; the data types of data in each Feature\ngiven in sparse_keys.\nCurrently the ParseExample supports DT_FLOAT (FloatList),\nDT_INT64 (Int64List), and DT_STRING (BytesList)."
+ has_minimum: true
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_INT64
+ type: DT_STRING
+ }
+ }
+ }
+ attr {
+ name: "Tdense"
+ type: "list(type)"
+ has_minimum: true
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_INT64
+ type: DT_STRING
+ }
+ }
+ }
+ attr {
+ name: "dense_shapes"
+ type: "list(shape)"
+ description: "A list of Ndense shapes; the shapes of data in each Feature\ngiven in dense_keys.\nThe number of elements in the Feature corresponding to dense_key[j]\nmust always equal dense_shapes[j].NumEntries().\nIf dense_shapes[j] == (D0, D1, ..., DN) then the the shape of output\nTensor dense_values[j] will be (|serialized|, D0, D1, ..., DN):\nThe dense outputs are just the inputs row-stacked by batch."
+ has_minimum: true
+ }
+ summary: "Transforms a vector of brain.Example protos (as strings) into typed tensors."
+}
+op {
+ name: "Placeholder"
+ output_arg {
+ name: "output"
+ description: "A placeholder tensor that must be replaced using the feed mechanism."
+ type_attr: "dtype"
+ }
+ attr {
+ name: "dtype"
+ type: "type"
+ description: "The type of elements in the tensor."
+ }
+ attr {
+ name: "shape"
+ type: "shape"
+ description: "(Optional) The shape of the tensor. If the shape has 0 dimensions, the\nshape is unconstrained."
+ }
+ summary: "A placeholder op for a value that will be fed into the computation."
+ description: "N.B. This operation will fail with an error if it is executed. It is\nintended as a way to represent a value that will always be fed, and to\nprovide attrs that enable the fed value to be checked at runtime."
+}
+op {
+ name: "Pow"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "z"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_COMPLEX64
+ type: DT_INT64
+ }
+ }
+ }
+ summary: "Computes the power of one value to another."
+ description: "Given a tensor `x` and a tensor `y`, this operation computes \\\\(x^y\\\\) for\ncorresponding elements in `x` and `y`. For example:\n\n```\n# tensor \'x\' is [[2, 2]], [3, 3]]\n# tensor \'y\' is [[8, 16], [2, 3]]\ntf.pow(x, y) ==> [[256, 65536], [9, 27]]\n```"
+}
+op {
+ name: "Print"
+ input_arg {
+ name: "input"
+ description: "The tensor passed to `output`"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "data"
+ description: "A list of tensors to print out when op is evaluated."
+ type_list_attr: "U"
+ }
+ output_arg {
+ name: "output"
+ description: "= The unmodified `input` tensor"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ attr {
+ name: "U"
+ type: "list(type)"
+ has_minimum: true
+ minimum: 1
+ }
+ attr {
+ name: "message"
+ type: "string"
+ default_value {
+ s: ""
+ }
+ description: "A string, prefix of the error message."
+ }
+ attr {
+ name: "first_n"
+ type: "int"
+ default_value {
+ i: -1
+ }
+ description: "Only log `first_n` number of times. -1 disables logging."
+ }
+ attr {
+ name: "summarize"
+ type: "int"
+ default_value {
+ i: 3
+ }
+ description: "Only print this many entries of each tensor."
+ }
+ summary: "Prints a list of tensors."
+ description: "Passes `input` through to `output` and prints `data` when evaluating."
+}
+op {
+ name: "Prod"
+ input_arg {
+ name: "input"
+ description: "The tensor to reduce."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "reduction_indices"
+ description: "The dimensions to reduce."
+ type: DT_INT32
+ }
+ output_arg {
+ name: "output"
+ description: "The reduced tensor."
+ type_attr: "T"
+ }
+ attr {
+ name: "keep_dims"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ description: "If true, retain reduced dimensions with length 1."
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT64
+ type: DT_INT32
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ type: DT_COMPLEX64
+ type: DT_QINT8
+ type: DT_QUINT8
+ type: DT_QINT32
+ }
+ }
+ }
+ summary: "Computes the product of elements across dimensions of a tensor."
+ description: "Reduces `input` along the dimensions given in `reduction_indices`. Unless\n`keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in\n`reduction_indices`. If `keep_dims` is true, the reduced dimensions are\nretained with length 1."
+}
+op {
+ name: "QueueClose"
+ input_arg {
+ name: "handle"
+ description: "The handle to a queue."
+ type: DT_STRING
+ is_ref: true
+ }
+ attr {
+ name: "cancel_pending_enqueues"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ description: "If true, all pending enqueue requests that are\nblocked on the given queue will be cancelled."
+ }
+ summary: "Closes the given queue."
+ description: "This operation signals that no more elements will be enqueued in the\ngiven queue. Subsequent Enqueue(Many) operations will fail.\nSubsequent Dequeue(Many) operations will continue to succeed if\nsufficient elements remain in the queue. Subsequent Dequeue(Many)\noperations that would block will fail immediately."
+}
+op {
+ name: "QueueDequeue"
+ input_arg {
+ name: "handle"
+ description: "The handle to a queue."
+ type: DT_STRING
+ is_ref: true
+ }
+ output_arg {
+ name: "components"
+ description: "One or more tensors that were dequeued as a tuple."
+ type_list_attr: "component_types"
+ }
+ attr {
+ name: "component_types"
+ type: "list(type)"
+ description: "The type of each component in a tuple."
+ has_minimum: true
+ minimum: 1
+ }
+ attr {
+ name: "timeout_ms"
+ type: "int"
+ default_value {
+ i: -1
+ }
+ description: "If the queue is empty, this operation will block for up to\ntimeout_ms milliseconds.\nNote: This option is not supported yet."
+ }
+ summary: "Dequeues a tuple of one or more tensors from the given queue."
+ description: "This operation has k outputs, where k is the number of components\nin the tuples stored in the given queue, and output i is the ith\ncomponent of the dequeued tuple.\n\nN.B. If the queue is empty, this operation will block until an element\nhas been dequeued (or \'timeout_ms\' elapses, if specified)."
+}
+op {
+ name: "QueueDequeueMany"
+ input_arg {
+ name: "handle"
+ description: "The handle to a queue."
+ type: DT_STRING
+ is_ref: true
+ }
+ input_arg {
+ name: "n"
+ description: "The number of tuples to dequeue."
+ type: DT_INT32
+ }
+ output_arg {
+ name: "components"
+ description: "One or more tensors that were dequeued as a tuple."
+ type_list_attr: "component_types"
+ }
+ attr {
+ name: "component_types"
+ type: "list(type)"
+ description: "The type of each component in a tuple."
+ has_minimum: true
+ minimum: 1
+ }
+ attr {
+ name: "timeout_ms"
+ type: "int"
+ default_value {
+ i: -1
+ }
+ description: "If the queue has fewer than n elements, this operation\nwill block for up to timeout_ms milliseconds.\nNote: This option is not supported yet."
+ }
+ summary: "Dequeues n tuples of one or more tensors from the given queue."
+ description: "This operation concatenates queue-element component tensors along the\n0th dimension to make a single component tensor. All of the components\nin the dequeued tuple will have size n in the 0th dimension.\n\nThis operation has k outputs, where k is the number of components in\nthe tuples stored in the given queue, and output i is the ith\ncomponent of the dequeued tuple.\n\nN.B. If the queue is empty, this operation will block until n elements\nhave been dequeued (or \'timeout_ms\' elapses, if specified)."
+}
+op {
+ name: "QueueEnqueue"
+ input_arg {
+ name: "handle"
+ description: "The handle to a queue."
+ type: DT_STRING
+ is_ref: true
+ }
+ input_arg {
+ name: "components"
+ description: "One or more tensors from which the enqueued tensors should be taken."
+ type_list_attr: "Tcomponents"
+ }
+ attr {
+ name: "Tcomponents"
+ type: "list(type)"
+ has_minimum: true
+ minimum: 1
+ }
+ attr {
+ name: "timeout_ms"
+ type: "int"
+ default_value {
+ i: -1
+ }
+ description: "If the queue is full, this operation will block for up to\ntimeout_ms milliseconds.\nNote: This option is not supported yet."
+ }
+ summary: "Enqueues a tuple of one or more tensors in the given queue."
+ description: "The components input has k elements, which correspond to the components of\ntuples stored in the given queue.\n\nN.B. If the queue is full, this operation will block until the given\nelement has been enqueued (or \'timeout_ms\' elapses, if specified)."
+}
+op {
+ name: "QueueEnqueueMany"
+ input_arg {
+ name: "handle"
+ description: "The handle to a queue."
+ type: DT_STRING
+ is_ref: true
+ }
+ input_arg {
+ name: "components"
+ description: "One or more tensors from which the enqueued tensors should\nbe taken."
+ type_list_attr: "Tcomponents"
+ }
+ attr {
+ name: "Tcomponents"
+ type: "list(type)"
+ has_minimum: true
+ minimum: 1
+ }
+ attr {
+ name: "timeout_ms"
+ type: "int"
+ default_value {
+ i: -1
+ }
+ description: "If the queue is too full, this operation will block for up\nto timeout_ms milliseconds.\nNote: This option is not supported yet."
+ }
+ summary: "Enqueues zero or more tuples of one or more tensors in the given queue."
+ description: "This operation slices each component tensor along the 0th dimension to\nmake multiple queue elements. All of the tuple components must have the\nsame size in the 0th dimension.\n\nThe components input has k elements, which correspond to the components of\ntuples stored in the given queue.\n\nN.B. If the queue is full, this operation will block until the given\nelements have been enqueued (or \'timeout_ms\' elapses, if specified)."
+}
+op {
+ name: "QueueSize"
+ input_arg {
+ name: "handle"
+ description: "The handle to a queue."
+ type: DT_STRING
+ is_ref: true
+ }
+ output_arg {
+ name: "size"
+ description: "The number of elements in the given queue."
+ type: DT_INT32
+ }
+ summary: "Computes the number of elements in the given queue."
+}
+op {
+ name: "RandomCrop"
+ input_arg {
+ name: "image"
+ description: "3-D of shape `[height, width, channels]`."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "size"
+ description: "1-D of length 2 containing: `crop_height`, `crop_width`.."
+ type: DT_INT64
+ }
+ output_arg {
+ name: "output"
+ description: "3-D of shape `[crop_height, crop_width, channels].`"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_UINT8
+ type: DT_INT8
+ type: DT_INT16
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ }
+ }
+ }
+ attr {
+ name: "seed"
+ type: "int"
+ default_value {
+ i: 0
+ }
+ description: "If either seed or seed2 are set to be non-zero, the random number\ngenerator is seeded by the given seed. Otherwise, it is seeded by a\nrandom seed."
+ }
+ attr {
+ name: "seed2"
+ type: "int"
+ default_value {
+ i: 0
+ }
+ description: "An second seed to avoid seed collision."
+ }
+ summary: "Randomly crop `image`."
+ description: "`size` is a 1-D int64 tensor with 2 elements representing the crop height and\nwidth. The values must be non negative.\n\nThis Op picks a random location in `image` and crops a `height` by `width`\nrectangle from that location. The random location is picked so the cropped\narea will fit inside the original image."
+ is_stateful: true
+}
+op {
+ name: "RandomShuffle"
+ input_arg {
+ name: "value"
+ description: "The tensor to be shuffled."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ description: "A tensor of same shape and type as `value`, shuffled along its first\ndimension."
+ type_attr: "T"
+ }
+ attr {
+ name: "seed"
+ type: "int"
+ default_value {
+ i: 0
+ }
+ description: "If either `seed` or `seed2` are set to be non-zero, the random number\ngenerator is seeded by the given seed. Otherwise, it is seeded by a\nrandom seed."
+ }
+ attr {
+ name: "seed2"
+ type: "int"
+ default_value {
+ i: 0
+ }
+ description: "A second seed to avoid seed collision."
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ summary: "Randomly shuffles a tensor along its first dimension."
+ description: " The tensor is shuffled along dimension 0, such that each `value[j]` is mapped\n to one and only one `output[i]`. For example, a mapping that might occur for a\n 3x2 tensor is:\n\n```prettyprint\n[[1, 2], [[5, 6],\n [3, 4], ==> [1, 2],\n [5, 6]] [3, 4]]\n```"
+ is_stateful: true
+}
+op {
+ name: "RandomShuffleQueue"
+ output_arg {
+ name: "handle"
+ description: "The handle to the queue."
+ type: DT_STRING
+ is_ref: true
+ }
+ attr {
+ name: "component_types"
+ type: "list(type)"
+ description: "The type of each component in a value."
+ has_minimum: true
+ minimum: 1
+ }
+ attr {
+ name: "shapes"
+ type: "list(shape)"
+ default_value {
+ list {
+ }
+ }
+ description: "The shape of each component in a value. The length of this attr must\nbe either 0 or the same as the length of component_types. If the length of\nthis attr is 0, the shapes of queue elements are not constrained, and\nonly one element may be dequeued at a time."
+ has_minimum: true
+ }
+ attr {
+ name: "capacity"
+ type: "int"
+ default_value {
+ i: -1
+ }
+ description: "The upper bound on the number of elements in this queue.\nNegative numbers mean no limit."
+ }
+ attr {
+ name: "min_after_dequeue"
+ type: "int"
+ default_value {
+ i: 0
+ }
+ description: "Dequeue will block unless there would be this\nmany elements after the dequeue or the queue is closed. This\nensures a minimum level of mixing of elements."
+ }
+ attr {
+ name: "seed"
+ type: "int"
+ default_value {
+ i: 0
+ }
+ description: "If either seed or seed2 is set to be non-zero, the random number\ngenerator is seeded by the given seed. Otherwise, a random seed is used."
+ }
+ attr {
+ name: "seed2"
+ type: "int"
+ default_value {
+ i: 0
+ }
+ description: "A second seed to avoid seed collision."
+ }
+ attr {
+ name: "container"
+ type: "string"
+ default_value {
+ s: ""
+ }
+ description: "If non-empty, this queue is placed in the given container.\nOtherwise, a default container is used."
+ }
+ attr {
+ name: "shared_name"
+ type: "string"
+ default_value {
+ s: ""
+ }
+ description: "If non-empty, this queue will be shared under the given name\nacross multiple sessions."
+ }
+ summary: "A queue that randomizes the order of elements."
+ is_stateful: true
+}
+op {
+ name: "RandomStandardNormal"
+ input_arg {
+ name: "shape"
+ description: "The shape of the output tensor."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ description: "A tensor of the specified shape filled with random normal values."
+ type_attr: "dtype"
+ }
+ attr {
+ name: "seed"
+ type: "int"
+ default_value {
+ i: 0
+ }
+ description: "If either `seed` or `seed2` are set to be non-zero, the random number\ngenerator is seeded by the given seed. Otherwise, it is seeded by a\nrandom seed."
+ }
+ attr {
+ name: "seed2"
+ type: "int"
+ default_value {
+ i: 0
+ }
+ description: "A second seed to avoid seed collision."
+ }
+ attr {
+ name: "dtype"
+ type: "type"
+ description: "The type of the output."
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ }
+ }
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ summary: "Outputs random values from a normal distribution."
+ description: "The generated values will have mean 0 and standard deviation 1."
+ is_stateful: true
+}
+op {
+ name: "RandomUniform"
+ input_arg {
+ name: "shape"
+ description: "The shape of the output tensor."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ description: "A tensor of the specified shape filled with uniform random values."
+ type_attr: "dtype"
+ }
+ attr {
+ name: "seed"
+ type: "int"
+ default_value {
+ i: 0
+ }
+ description: "If either `seed` or `seed2` are set to be non-zero, the random number\ngenerator is seeded by the given seed. Otherwise, it is seeded by a\nrandom seed."
+ }
+ attr {
+ name: "seed2"
+ type: "int"
+ default_value {
+ i: 0
+ }
+ description: "A second seed to avoid seed collision."
+ }
+ attr {
+ name: "dtype"
+ type: "type"
+ description: "The type of the output."
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ }
+ }
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ summary: "Outputs random values from a uniform distribution."
+ description: "The generated values follow a uniform distribution in the range `[0, 1)`. The\nlower bound 0 is included in the range, while the upper bound 1 is excluded."
+ is_stateful: true
+}
+op {
+ name: "Range"
+ input_arg {
+ name: "start"
+ description: "0-D (scalar). First entry in the sequence."
+ type: DT_INT32
+ }
+ input_arg {
+ name: "limit"
+ description: "0-D (scalar). Upper limit of sequence, exclusive."
+ type: DT_INT32
+ }
+ input_arg {
+ name: "delta"
+ description: "0-D (scalar). Optional. Default is 1. Number that increments `start`."
+ type: DT_INT32
+ }
+ output_arg {
+ name: "output"
+ description: "1-D."
+ type: DT_INT32
+ }
+ summary: "Creates a sequence of integers."
+ description: "This operation creates a sequence of integers that begins at `start` and\nextends by increments of `delta` up to but not including `limit`.\n\nFor example:\n\n```\n# \'start\' is 3\n# \'limit\' is 18\n# \'delta\' is 3\ntf.range(start, limit, delta) ==> [3, 6, 9, 12, 15]\n```"
+}
+op {
+ name: "Rank"
+ input_arg {
+ name: "input"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ type: DT_INT32
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ summary: "Returns the rank of a tensor."
+ description: "This operation returns an integer representing the rank of `input`.\n\nFor example:\n\n```prettyprint\n# \'t\' is [[[1, 1, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]]\n# shape of tensor \'t\' is [2, 2, 3]\nrank(t) ==> 3\n```\n\n**Note**: The rank of a tensor is not the same as the rank of a matrix. The rank\nof a tensor is the number of indices required to uniquely select each element\nof the tensor. Rank is also known as \"order\", \"degree\", or \"ndims.\""
+}
+op {
+ name: "ReadFile"
+ input_arg {
+ name: "filename"
+ type: DT_STRING
+ }
+ output_arg {
+ name: "contents"
+ type: DT_STRING
+ }
+ summary: "Reads and outputs the entire contents of the input filename."
+}
+op {
+ name: "ReaderNumRecordsProduced"
+ input_arg {
+ name: "reader_handle"
+ description: "Handle to a Reader."
+ type: DT_STRING
+ is_ref: true
+ }
+ output_arg {
+ name: "records_produced"
+ type: DT_INT64
+ }
+ summary: "Returns the number of records this Reader has produced."
+ description: "This is the same as the number of ReaderRead executions that have\nsucceeded."
+}
+op {
+ name: "ReaderNumWorkUnitsCompleted"
+ input_arg {
+ name: "reader_handle"
+ description: "Handle to a Reader."
+ type: DT_STRING
+ is_ref: true
+ }
+ output_arg {
+ name: "units_completed"
+ type: DT_INT64
+ }
+ summary: "Returns the number of work units this Reader has finished processing."
+}
+op {
+ name: "ReaderRead"
+ input_arg {
+ name: "reader_handle"
+ description: "Handle to a Reader."
+ type: DT_STRING
+ is_ref: true
+ }
+ input_arg {
+ name: "queue_handle"
+ description: "Handle to a Queue, with string work items."
+ type: DT_STRING
+ is_ref: true
+ }
+ output_arg {
+ name: "key"
+ description: "A scalar."
+ type: DT_STRING
+ }
+ output_arg {
+ name: "value"
+ description: "A scalar."
+ type: DT_STRING
+ }
+ summary: "Returns the next record (key, value pair) produced by a Reader."
+ description: "Will dequeue from the input queue if necessary (e.g. when the\nReader needs to start reading from a new file since it has finished\nwith the previous file)."
+}
+op {
+ name: "ReaderReset"
+ input_arg {
+ name: "reader_handle"
+ description: "Handle to a Reader."
+ type: DT_STRING
+ is_ref: true
+ }
+ summary: "Restore a Reader to its initial clean state."
+}
+op {
+ name: "ReaderRestoreState"
+ input_arg {
+ name: "reader_handle"
+ description: "Handle to a Reader."
+ type: DT_STRING
+ is_ref: true
+ }
+ input_arg {
+ name: "state"
+ description: "Result of a ReaderSerializeState of a Reader with type\nmatching reader_handle."
+ type: DT_STRING
+ }
+ summary: "Restore a reader to a previously saved state."
+ description: "Not all Readers support being restored, so this can produce an\nUnimplemented error."
+}
+op {
+ name: "ReaderSerializeState"
+ input_arg {
+ name: "reader_handle"
+ description: "Handle to a Reader."
+ type: DT_STRING
+ is_ref: true
+ }
+ output_arg {
+ name: "state"
+ type: DT_STRING
+ }
+ summary: "Produce a string tensor that encodes the state of a Reader."
+ description: "Not all Readers support being serialized, so this can produce an\nUnimplemented error."
+}
+op {
+ name: "Real"
+ input_arg {
+ name: "in"
+ type: DT_COMPLEX64
+ }
+ output_arg {
+ name: "out"
+ type: DT_FLOAT
+ }
+ summary: "Returns the real part of a complex number."
+ description: "Given a tensor `in` of complex numbers, this operation returns a tensor of type\n`float` that is the real part of each element in `in`. All elements in `in`\nmust be complex numbers of the form \\\\(a + bj\\\\), where *a* is the real part\nreturned by this operation and *b* is the imaginary part.\n\nFor example:\n\n```\n# tensor \'in\' is [-2.25 + 4.75j, 3.25 + 5.75j]\ntf.real(in) ==> [-2.25, 3.25]\n```"
+}
+op {
+ name: "RefEnter"
+ input_arg {
+ name: "data"
+ description: "The tensor to be made available to the child frame."
+ type_attr: "T"
+ is_ref: true
+ }
+ output_arg {
+ name: "output"
+ description: "The same tensor as `data`."
+ type_attr: "T"
+ is_ref: true
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ attr {
+ name: "frame_name"
+ type: "string"
+ description: "The name of the child frame."
+ }
+ attr {
+ name: "is_constant"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ description: "If true, the output is constant within the child frame."
+ }
+ attr {
+ name: "parallel_iterations"
+ type: "int"
+ default_value {
+ i: 10
+ }
+ description: "The number of iterations allowed to run in parallel."
+ }
+ summary: "Creates or finds a child frame, and makes `data` available to the child frame."
+ description: "The unique `frame_name` is used by the `Executor` to identify frames. If\n`is_constant` is true, `output` is a constant in the child frame; otherwise\nit may be changed in the child frame. At most `parallel_iterations` iterations\nare run in parallel in the child frame."
+}
+op {
+ name: "RefIdentity"
+ input_arg {
+ name: "input"
+ type_attr: "T"
+ is_ref: true
+ }
+ output_arg {
+ name: "output"
+ type_attr: "T"
+ is_ref: true
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ summary: "Return the same ref tensor as the input ref tensor."
+}
+op {
+ name: "RefSelect"
+ input_arg {
+ name: "index"
+ description: "A scalar that determines the input that gets selected."
+ type: DT_INT32
+ }
+ input_arg {
+ name: "inputs"
+ description: "A list of ref tensors, one of which will be forwarded to `output`."
+ type_attr: "T"
+ number_attr: "N"
+ is_ref: true
+ }
+ output_arg {
+ name: "output"
+ description: "The forwarded tensor."
+ type_attr: "T"
+ is_ref: true
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ attr {
+ name: "N"
+ type: "int"
+ has_minimum: true
+ minimum: 1
+ }
+ summary: "Forwards the `index`th element of `inputs` to `output`."
+}
+op {
+ name: "RefSwitch"
+ input_arg {
+ name: "data"
+ description: "The ref tensor to be forwarded to the appropriate output."
+ type_attr: "T"
+ is_ref: true
+ }
+ input_arg {
+ name: "pred"
+ description: "A scalar that specifies which output port will receive data."
+ type: DT_BOOL
+ }
+ output_arg {
+ name: "output_false"
+ description: "If `pred` is false, data will be forwarded to this output."
+ type_attr: "T"
+ is_ref: true
+ }
+ output_arg {
+ name: "output_true"
+ description: "If `pred` is true, data will be forwarded to this output."
+ type_attr: "T"
+ is_ref: true
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ summary: "Forwards the ref tensor `data` to the output port determined by `pred`."
+ description: "If `pred` is true, the `data` input is forwared to `output_true`. Otherwise,\nthe data goes to `output_false`.\n\nSee also `Switch` and `Merge`."
+}
+op {
+ name: "Relu"
+ input_arg {
+ name: "features"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "activations"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ }
+ }
+ }
+ summary: "Computes rectified linear: `max(features, 0)`."
+}
+op {
+ name: "Relu6"
+ input_arg {
+ name: "features"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "activations"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ }
+ }
+ }
+ summary: "Computes rectified linear 6: `min(max(features, 0), 6)`."
+}
+op {
+ name: "Relu6Grad"
+ input_arg {
+ name: "gradients"
+ description: "The backpropagated gradients to the corresponding Relu6 operation."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "features"
+ description: "The features passed as input to the corresponding Relu6 operation."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "backprops"
+ description: "The gradients:\n`gradients * features * (features > 0) * (features < 6)`."
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ }
+ }
+ }
+ summary: "Computes rectified linear 6 gradients for a Relu6 operation."
+}
+op {
+ name: "ReluGrad"
+ input_arg {
+ name: "gradients"
+ description: "The backpropagated gradients to the corresponding Relu operation."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "features"
+ description: "The features passed as input to the corresponding Relu operation."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "backprops"
+ description: "The gradients: `gradients * features * (features > 0)`."
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ }
+ }
+ }
+ summary: "Computes rectified linear gradients for a Relu operation."
+}
+op {
+ name: "Reshape"
+ input_arg {
+ name: "tensor"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "shape"
+ description: "Defines the shape of the output tensor."
+ type: DT_INT32
+ }
+ output_arg {
+ name: "output"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ summary: "Reshapes a tensor."
+ description: "Given `tensor`, this operation returns a tensor that has the same values\nas `tensor` with shape `shape`.\n\nIf `shape` is the special value `[-1]`, then `tensor` is flattened and the\noperation outputs a 1-D tensor with all elements of `tensor`.\n\nIf `shape` is 1-D or higher, then the operation returns a tensor with shape\n`shape` filled with the values of `tensor`. In this case, the number of elements\nimplied by `shape` must be the same as the number of elements in `tensor`.\n\nFor example:\n\n```prettyprint\n# tensor \'t\' is [1, 2, 3, 4, 5, 6, 7, 8, 9]\n# tensor \'t\' has shape [9]\nreshape(t, [3, 3]) ==> [[1, 2, 3]\n [4, 5, 6]\n [7, 8, 9]]\n\n# tensor \'t\' is [[[1, 1], [2, 2]]\n# [[3, 3], [4, 4]]]\n# tensor \'t\' has shape [2, 2, 2]\nreshape(t, [2, 4]) ==> [[1, 1, 2, 2]\n [3, 3, 4, 4]]\n\n# tensor \'t\' is [[[1, 1, 1],\n# [2, 2, 2]],\n# [[3, 3, 3],\n# [4, 4, 4]],\n# [[5, 5, 5],\n# [6, 6, 6]]]\n# tensor \'t\' has shape [3, 2, 3]\n# pass \'[-1]\' to flatten \'t\'\nreshape(t, [-1]) ==> [1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6]\n```"
+}
+op {
+ name: "ResizeArea"
+ input_arg {
+ name: "images"
+ description: "4-D with shape `[batch, height, width, channels]`."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "size"
+ description: "= A 1-D int32 Tensor of 2 elements: `new_height, new_width`. The\nnew size for the images."
+ type: DT_INT32
+ }
+ output_arg {
+ name: "resized_images"
+ description: "4-D with shape\n`[batch, new_height, new_width, channels]`."
+ type: DT_FLOAT
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_UINT8
+ type: DT_INT8
+ type: DT_INT32
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ }
+ }
+ }
+ summary: "Resize `images` to `size` using area interpolation."
+ description: "Input images can be of different types but output images are always float."
+}
+op {
+ name: "ResizeBicubic"
+ input_arg {
+ name: "images"
+ description: "4-D with shape `[batch, height, width, channels]`."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "size"
+ description: "= A 1-D int32 Tensor of 2 elements: `new_height, new_width`. The\nnew size for the images."
+ type: DT_INT32
+ }
+ output_arg {
+ name: "resized_images"
+ description: "4-D with shape\n`[batch, new_height, new_width, channels]`."
+ type: DT_FLOAT
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_UINT8
+ type: DT_INT8
+ type: DT_INT32
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ }
+ }
+ }
+ summary: "Resize `images` to `size` using bicubic interpolation."
+ description: "Input images can be of different types but output images are always float."
+}
+op {
+ name: "ResizeBilinear"
+ input_arg {
+ name: "images"
+ description: "4-D with shape `[batch, height, width, channels]`."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "size"
+ description: "= A 1-D int32 Tensor of 2 elements: `new_height, new_width`. The\nnew size for the images."
+ type: DT_INT32
+ }
+ output_arg {
+ name: "resized_images"
+ description: "4-D with shape\n`[batch, new_height, new_width, channels]`."
+ type: DT_FLOAT
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_UINT8
+ type: DT_INT8
+ type: DT_INT32
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ }
+ }
+ }
+ summary: "Resize `images` to `size` using bilinear interpolation."
+ description: "Input images can be of different types but output images are always float."
+}
+op {
+ name: "ResizeNearestNeighbor"
+ input_arg {
+ name: "images"
+ description: "4-D with shape `[batch, height, width, channels]`."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "size"
+ description: "= A 1-D int32 Tensor of 2 elements: `new_height, new_width`. The\nnew size for the images."
+ type: DT_INT32
+ }
+ output_arg {
+ name: "resized_images"
+ description: "4-D with shape\n`[batch, new_height, new_width, channels]`."
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_UINT8
+ type: DT_INT8
+ type: DT_INT32
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ }
+ }
+ }
+ summary: "Resize `images` to `size` using nearest neighbor interpolation."
+ description: "Input images can be of different types but output images are always float."
+}
+op {
+ name: "Restore"
+ input_arg {
+ name: "file_pattern"
+ description: "Must have a single element. The pattern of the files from\nwhich we read the tensor."
+ type: DT_STRING
+ }
+ input_arg {
+ name: "tensor_name"
+ description: "Must have a single element. The name of the tensor to be\nrestored."
+ type: DT_STRING
+ }
+ output_arg {
+ name: "tensor"
+ description: "The restored tensor."
+ type_attr: "dt"
+ }
+ attr {
+ name: "dt"
+ type: "type"
+ description: "The type of the tensor to be restored."
+ }
+ attr {
+ name: "preferred_shard"
+ type: "int"
+ default_value {
+ i: -1
+ }
+ description: "Index of file to open first if multiple files match\n`file_pattern`."
+ }
+ summary: "Restores a tensor from checkpoint files."
+ description: "Reads a tensor stored in one or several files. If there are several files (for\ninstance because a tensor was saved as slices), `file_pattern` may contain\nwildcard symbols (`*` and `?`) in the filename portion only, not in the\ndirectory portion.\n\nIf a `file_pattern` matches several files, `preferred_shard` can be used to hint\nin which file the requested tensor is likely to be found. This op will first\nopen the file at index `preferred_shard` in the list of matching files and try\nto restore tensors from that file. Only if some tensors or tensor slices are\nnot found in that first file, then the Op opens all the files. Setting\n`preferred_shard` to match the value passed as the `shard` input\nof a matching `Save` Op may speed up Restore. This attribute only affects\nperformance, not correctness. The default value -1 means files are processed in\norder.\n\nSee also `RestoreSlice`."
+}
+op {
+ name: "RestoreSlice"
+ input_arg {
+ name: "file_pattern"
+ description: "Must have a single element. The pattern of the files from\nwhich we read the tensor."
+ type: DT_STRING
+ }
+ input_arg {
+ name: "tensor_name"
+ description: "Must have a single element. The name of the tensor to be\nrestored."
+ type: DT_STRING
+ }
+ input_arg {
+ name: "shape_and_slice"
+ description: "Scalar. The shapes and slice specifications to use when\nrestoring a tensors."
+ type: DT_STRING
+ }
+ output_arg {
+ name: "tensor"
+ description: "The restored tensor."
+ type_attr: "dt"
+ }
+ attr {
+ name: "dt"
+ type: "type"
+ description: "The type of the tensor to be restored."
+ }
+ attr {
+ name: "preferred_shard"
+ type: "int"
+ default_value {
+ i: -1
+ }
+ description: "Index of file to open first if multiple files match\n`file_pattern`. See the documentation for `Restore`."
+ }
+ summary: "Restores a tensor from checkpoint files."
+ description: "This is like `Restore` except that restored tensor can be listed as filling\nonly a slice of a larger tensor. `shape_and_slice` specifies the shape of the\nlarger tensor and the slice that the restored tensor covers.\n\nThe `shape_and_slice` input has the same format as the\nelements of the `shapes_and_slices` input of the `SaveSlices` op."
+}
+op {
+ name: "Reverse"
+ input_arg {
+ name: "tensor"
+ description: "Up to 8-D."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "dims"
+ description: "1-D. The dimensions to reverse."
+ type: DT_BOOL
+ }
+ output_arg {
+ name: "output"
+ description: "The same shape as `tensor`."
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_UINT8
+ type: DT_INT8
+ type: DT_INT32
+ type: DT_BOOL
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ }
+ }
+ }
+ summary: "Reverses specific dimensions of a tensor."
+ description: "Given a `tensor`, and a `bool` tensor `dims` representing the dimensions\nof `tensor`, this operation reverses each dimension i of `tensor` where\n`dims[i]` is `True`.\n\n`tensor` can have up to 8 dimensions. The number of dimensions\nof `tensor` must equal the number of elements in `dims`. In other words:\n\n`rank(tensor) = size(dims)`\n\nFor example:\n\n```prettyprint\n# tensor \'t\' is [[[[ 0, 1, 2, 3],\n# [ 4, 5, 6, 7],\n# [ 8, 9, 10, 11]],\n# [[12, 13, 14, 15],\n# [16, 17, 18, 19],\n# [20, 21, 22, 23]]]]\n# tensor \'t\' shape is [1, 2, 3, 4]\n\n# \'dims\' is [False, False, False, True]\nreverse(t, dims) ==> [[[[ 3, 2, 1, 0],\n [ 7, 6, 5, 4],\n [ 11, 10, 9, 8]],\n [[15, 14, 13, 12],\n [19, 18, 17, 16],\n [23, 22, 21, 20]]]]\n\n# \'dims\' is [False, True, False, False]\nreverse(t, dims) ==> [[[[12, 13, 14, 15],\n [16, 17, 18, 19],\n [20, 21, 22, 23]\n [[ 0, 1, 2, 3],\n [ 4, 5, 6, 7],\n [ 8, 9, 10, 11]]]]\n\n# \'dims\' is [False, False, True, False]\nreverse(t, dims) ==> [[[[8, 9, 10, 11],\n [4, 5, 6, 7],\n [0, 1, 2, 3]]\n [[20, 21, 22, 23],\n [16, 17, 18, 19],\n [12, 13, 14, 15]]]]\n```"
+}
+op {
+ name: "ReverseSequence"
+ input_arg {
+ name: "input"
+ description: "The input to reverse."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "seq_lengths"
+ description: "1-D with length `input.dims(0)` and\n`max(seq_lengths) < input.dims(seq_dim)`"
+ type: DT_INT64
+ }
+ output_arg {
+ name: "output"
+ description: "The partially reversed input. It has the same shape as `input`."
+ type_attr: "T"
+ }
+ attr {
+ name: "seq_dim"
+ type: "int"
+ description: "The dimension which is partially reversed."
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ summary: "Reverses variable length slices in dimension `seq_dim`."
+ description: "This op first slices `input` along the first dimension, and for each slice `i`,\nreverses the first `seq_lengths[i]` elements along the dimension `seq_dim`.\n\nThe elements of `seq_lengths` must obey `seq_lengths[i] < input.dims[seq_dim]`,\nand `seq_lengths` must be a vector of length `input.dims(0)`.\n\nThe output slice `i` along dimension 0 is then given by input slice `i`, with\nthe first `seq_lengths[i]` slices along dimension `seq_dim` reversed.\n\nFor example:\n\n```prettyprint\n# Given this:\nseq_dim = 1\ninput.dims = (4, ...)\nseq_lengths = [7, 2, 3, 5]\n\n# then slices of input are reversed on seq_dim, but only up to seq_lengths:\noutput[0, 0:7, :, ...] = input[0, 7:0:-1, :, ...]\noutput[1, 0:2, :, ...] = input[1, 2:0:-1, :, ...]\noutput[2, 0:3, :, ...] = input[2, 3:0:-1, :, ...]\noutput[3, 0:5, :, ...] = input[3, 5:0:-1, :, ...]\n\n# while entries past seq_lens are copied through:\noutput[0, 7:, :, ...] = input[0, 7:, :, ...]\noutput[1, 2:, :, ...] = input[1, 2:, :, ...]\noutput[2, 3:, :, ...] = input[2, 3:, :, ...]\noutput[3, 2:, :, ...] = input[3, 2:, :, ...]\n```"
+}
+op {
+ name: "Rsqrt"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_COMPLEX64
+ type: DT_INT64
+ }
+ }
+ }
+ summary: "Computes reciprocal of square root of x element-wise."
+ description: "I.e., \\\\(y = 1 / \\sqrt{x}\\\\)."
+}
+op {
+ name: "Save"
+ input_arg {
+ name: "filename"
+ description: "Must have a single element. The name of the file to which we write\nthe tensor."
+ type: DT_STRING
+ }
+ input_arg {
+ name: "tensor_names"
+ description: "Shape `[N]`. The names of the tensors to be saved."
+ type: DT_STRING
+ }
+ input_arg {
+ name: "data"
+ description: "`N` tensors to save."
+ type_list_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "list(type)"
+ has_minimum: true
+ minimum: 1
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_QUINT8
+ type: DT_QINT8
+ type: DT_QINT32
+ }
+ }
+ }
+ summary: "Saves the input tensors to disk."
+ description: "The size of `tensor_names` must match the number of tensors in `data`. `data[i]`\nis written to `filename` with name `tensor_names[i]`.\n\nSee also `SaveSlices`."
+}
+op {
+ name: "SaveSlices"
+ input_arg {
+ name: "filename"
+ description: "Must have a single element. The name of the file to which we write the\ntensor."
+ type: DT_STRING
+ }
+ input_arg {
+ name: "tensor_names"
+ description: "Shape `[N]`. The names of the tensors to be saved."
+ type: DT_STRING
+ }
+ input_arg {
+ name: "shapes_and_slices"
+ description: "Shape `[N]`. The shapes and slice specifications to use when\nsaving the tensors."
+ type: DT_STRING
+ }
+ input_arg {
+ name: "data"
+ description: "`N` tensors to save."
+ type_list_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "list(type)"
+ has_minimum: true
+ minimum: 1
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_QUINT8
+ type: DT_QINT8
+ type: DT_QINT32
+ }
+ }
+ }
+ summary: "Saves input tensors slices to disk."
+ description: "This is like `Save` except that tensors can be listed in the saved file as being\na slice of a larger tensor. `shapes_and_slices` specifies the shape of the\nlarger tensor and the slice that this tensor covers. `shapes_and_slices` must\nhave as many elements as `tensor_names`.\n\nElements of the `shapes_and_slices` input must either be:\n\n* The empty string, in which case the corresponding tensor is\n saved normally.\n* A string of the form `dim0 dim1 ... dimN-1 slice-spec` where the\n `dimI` are the dimensions of the larger tensor and `slice-spec`\n specifies what part is covered by the tensor to save.\n\n`slice-spec` itself is a `:`-separated list: `slice0:slice1:...:sliceN-1`\nwhere each `sliceI` is either:\n\n* The string `-` meaning that the slice covers all indices of this dimension\n* `start,length` where `start` and `length` are integers. In that\n case the slice covers `length` indices starting at `start`.\n\nSee also `Save`."
+}
+op {
+ name: "ScalarSummary"
+ input_arg {
+ name: "tags"
+ description: "1-D. Tags for the summary."
+ type: DT_STRING
+ }
+ input_arg {
+ name: "values"
+ description: "1-D, same size as `tags. Values for the summary."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "summary"
+ description: "Scalar. Serialized `Summary` protocol buffer."
+ type: DT_STRING
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ }
+ }
+ }
+ summary: "Outputs a `Summary` protocol buffer with scalar values."
+ description: "The input `tags` and `values` must have the same shape. The generated summary\nhas a summary value for each tag-value pair in `tags` and `values`."
+}
+op {
+ name: "ScatterAdd"
+ input_arg {
+ name: "ref"
+ description: "Should be from a `Variable` node."
+ type_attr: "T"
+ is_ref: true
+ }
+ input_arg {
+ name: "indices"
+ description: "A tensor of indices into the first dimension of `ref`."
+ type_attr: "Tindices"
+ }
+ input_arg {
+ name: "updates"
+ description: "A tensor of updated values to add to `ref`."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output_ref"
+ description: "= Same as `ref`. Returned as a convenience for operations that want\nto use the updated values after the update is done."
+ type_attr: "T"
+ is_ref: true
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT64
+ type: DT_INT32
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ type: DT_COMPLEX64
+ type: DT_QINT8
+ type: DT_QUINT8
+ type: DT_QINT32
+ }
+ }
+ }
+ attr {
+ name: "Tindices"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ attr {
+ name: "use_locking"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ description: "If True, the addition will be protected by a lock;\notherwise the behavior is undefined, but may exhibit less contention."
+ }
+ summary: "Adds sparse updates to a variable reference."
+ description: "This operation computes\n\n # Scalar indices\n ref[indices, ...] += updates[...]\n\n # Vector indices (for each i)\n ref[indices[i], ...] += updates[i, ...]\n\n # High rank indices (for each i, ..., j)\n ref[indices[i, ..., j], ...] += updates[i, ..., j, ...]\n\nThis operation outputs `ref` after the update is done.\nThis makes it easier to chain operations that need to use the reset value.\n\nDuplicate entries are handled correctly: if multiple `indices` reference\nthe same location, their contributions add.\n\nRequires `updates.shape = indices.shape + ref.shape[1:]`.\n\n<div style=\"width:70%; margin:auto; margin-bottom:10px; margin-top:20px;\">\n<img style=\"width:100%\" src=\"../images/ScatterAdd.png\" alt>\n</div>"
+}
+op {
+ name: "ScatterSub"
+ input_arg {
+ name: "ref"
+ description: "Should be from a `Variable` node."
+ type_attr: "T"
+ is_ref: true
+ }
+ input_arg {
+ name: "indices"
+ description: "A tensor of indices into the first dimension of `ref`."
+ type_attr: "Tindices"
+ }
+ input_arg {
+ name: "updates"
+ description: "A tensor of updated values to subtract from `ref`."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output_ref"
+ description: "= Same as `ref`. Returned as a convenience for operations that want\nto use the updated values after the update is done."
+ type_attr: "T"
+ is_ref: true
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT64
+ type: DT_INT32
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ type: DT_COMPLEX64
+ type: DT_QINT8
+ type: DT_QUINT8
+ type: DT_QINT32
+ }
+ }
+ }
+ attr {
+ name: "Tindices"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ attr {
+ name: "use_locking"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ description: "If True, the subtraction will be protected by a lock;\notherwise the behavior is undefined, but may exhibit less contention."
+ }
+ summary: "Subtracts sparse updates to a variable reference."
+ description: " # Scalar indices\n ref[indices, ...] -= updates[...]\n\n # Vector indices (for each i)\n ref[indices[i], ...] -= updates[i, ...]\n\n # High rank indices (for each i, ..., j)\n ref[indices[i, ..., j], ...] -= updates[i, ..., j, ...]\n\nThis operation outputs `ref` after the update is done.\nThis makes it easier to chain operations that need to use the reset value.\n\nDuplicate entries are handled correctly: if multiple `indices` reference\nthe same location, their (negated) contributions add.\n\nRequires `updates.shape = indices.shape + ref.shape[1:]`.\n\n<div style=\"width:70%; margin:auto; margin-bottom:10px; margin-top:20px;\">\n<img style=\"width:100%\" src=\"../images/ScatterSub.png\" alt>\n</div>"
+}
+op {
+ name: "ScatterUpdate"
+ input_arg {
+ name: "ref"
+ description: "Should be from a `Variable` node."
+ type_attr: "T"
+ is_ref: true
+ }
+ input_arg {
+ name: "indices"
+ description: "A tensor of indices into the first dimension of `ref`."
+ type_attr: "Tindices"
+ }
+ input_arg {
+ name: "updates"
+ description: "A tensor of updated values to store in `ref`."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output_ref"
+ description: "= Same as `ref`. Returned as a convenience for operations that want\nto use the updated values after the update is done."
+ type_attr: "T"
+ is_ref: true
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ attr {
+ name: "Tindices"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ attr {
+ name: "use_locking"
+ type: "bool"
+ default_value {
+ b: true
+ }
+ description: "If True, the assignment will be protected by a lock;\notherwise the behavior is undefined, but may exhibit less contention."
+ }
+ summary: "Applies sparse updates to a variable reference."
+ description: "This operation computes\n\n # Scalar indices\n ref[indices, ...] = updates[...]\n\n # Vector indices (for each i)\n ref[indices[i], ...] = updates[i, ...]\n\n # High rank indices (for each i, ..., j)\n ref[indices[i, ..., j], ...] = updates[i, ..., j, ...]\n\nThis operation outputs `ref` after the update is done.\nThis makes it easier to chain operations that need to use the reset value.\n\nIf `indices` contains duplicate entries, lexicographically later entries\noverride earlier entries.\n\nRequires `updates.shape = indices.shape + ref.shape[1:]`.\n\n<div style=\"width:70%; margin:auto; margin-bottom:10px; margin-top:20px;\">\n<img style=\"width:100%\" src=\"../images/ScatterUpdate.png\" alt>\n</div>"
+}
+op {
+ name: "SegmentMax"
+ input_arg {
+ name: "data"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "segment_ids"
+ description: "A 1-D tensor whose rank is equal to the rank of `data`\'s\nfirst dimension. Values should be sorted and can be repeated."
+ type_attr: "Tindices"
+ }
+ output_arg {
+ name: "output"
+ description: "Has same shape as data, except for dimension_0 which\nhas size `k`, the number of segments."
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ }
+ }
+ }
+ attr {
+ name: "Tindices"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ summary: "Computes the maximum along segments of a tensor."
+ description: "Read [the section on Segmentation](../../api_docs/python/math_ops.md#segmentation)\nfor an explanation of segments.\n\nComputes a tensor such that\n\\\\(output_i = \\max_j(data_j)\\\\) where `max` is over `j` such\nthat `segment_ids[j] == i`.\n\n<div style=\"width:70%; margin:auto; margin-bottom:10px; margin-top:20px;\">\n<img style=\"width:100%\" src=\"../images/SegmentMax.png\" alt>\n</div>"
+}
+op {
+ name: "SegmentMean"
+ input_arg {
+ name: "data"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "segment_ids"
+ description: "A 1-D tensor whose rank is equal to the rank of `data`\'s\nfirst dimension. Values should be sorted and can be repeated."
+ type_attr: "Tindices"
+ }
+ output_arg {
+ name: "output"
+ description: "Has same shape as data, except for dimension_0 which\nhas size `k`, the number of segments."
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ }
+ }
+ }
+ attr {
+ name: "Tindices"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ summary: "Computes the mean along segments of a tensor."
+ description: "Read [the section on\nSegmentation](../../api_docs/python/math_ops.md#segmentation) for an explanation\nof segments.\n\nComputes a tensor such that\n\\\\(output_i = \\frac{\\sum_j data_j}{N}\\\\) where `mean` is\nover `j` such that `segment_ids[j] == i` and `N` is the total number of\nvalues summed.\n\n<div style=\"width:70%; margin:auto; margin-bottom:10px; margin-top:20px;\">\n<img style=\"width:100%\" src=\"../images/SegmentMean.png\" alt>\n</div>"
+}
+op {
+ name: "SegmentMin"
+ input_arg {
+ name: "data"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "segment_ids"
+ description: "A 1-D tensor whose rank is equal to the rank of `data`\'s\nfirst dimension. Values should be sorted and can be repeated."
+ type_attr: "Tindices"
+ }
+ output_arg {
+ name: "output"
+ description: "Has same shape as data, except for dimension_0 which\nhas size `k`, the number of segments."
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ }
+ }
+ }
+ attr {
+ name: "Tindices"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ summary: "Computes the minimum along segments of a tensor."
+ description: "Read [the section on\nSegmentation](../../api_docs/python/math_ops.md#segmentation) for an explanation\nof segments.\n\nComputes a tensor such that\n\\\\(output_i = \\min_j(data_j)\\\\) where `min` is over `j` such\nthat `segment_ids[j] == i`.\n\n<div style=\"width:70%; margin:auto; margin-bottom:10px; margin-top:20px;\">\n<img style=\"width:100%\" src=\"../images/SegmentMin.png\" alt>\n</div>"
+}
+op {
+ name: "SegmentProd"
+ input_arg {
+ name: "data"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "segment_ids"
+ description: "A 1-D tensor whose rank is equal to the rank of `data`\'s\nfirst dimension. Values should be sorted and can be repeated."
+ type_attr: "Tindices"
+ }
+ output_arg {
+ name: "output"
+ description: "Has same shape as data, except for dimension_0 which\nhas size `k`, the number of segments."
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ }
+ }
+ }
+ attr {
+ name: "Tindices"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ summary: "Computes the product along segments of a tensor."
+ description: "Read [the section on\nSegmentation](../../api_docs/python/math_ops.md#segmentation) for an explanation\nof segments.\n\nComputes a tensor such that\n\\\\(output_i = \\prod_j data_j\\\\) where the product is over `j` such\nthat `segment_ids[j] == i`.\n\n<div style=\"width:70%; margin:auto; margin-bottom:10px; margin-top:20px;\">\n<img style=\"width:100%\" src=\"../images/SegmentProd.png\" alt>\n</div>"
+}
+op {
+ name: "SegmentSum"
+ input_arg {
+ name: "data"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "segment_ids"
+ description: "A 1-D tensor whose rank is equal to the rank of `data`\'s\nfirst dimension. Values should be sorted and can be repeated."
+ type_attr: "Tindices"
+ }
+ output_arg {
+ name: "output"
+ description: "Has same shape as data, except for dimension_0 which\nhas size `k`, the number of segments."
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ }
+ }
+ }
+ attr {
+ name: "Tindices"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ summary: "Computes the sum along segments of a tensor."
+ description: "Read [the section on Segmentation](../../api_docs/python/math_ops.md#segmentation)\nfor an explanation of segments.\n\nComputes a tensor such that\n\\\\(output_i = \\sum_j data_j\\\\) where sum is over `j` such\nthat `segment_ids[j] == i`.\n\n<div style=\"width:70%; margin:auto; margin-bottom:10px; margin-top:20px;\">\n<img style=\"width:100%\" src=\"../images/SegmentSum.png\" alt>\n</div>"
+}
+op {
+ name: "Select"
+ input_arg {
+ name: "condition"
+ type: DT_BOOL
+ }
+ input_arg {
+ name: "t"
+ description: "= A `Tensor` with the same shape as `condition`."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "e"
+ description: "= A `Tensor` with the same type and shape as `t`."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "out"
+ description: "= A `Tensor` with the same type and shape as `t` and `e`."
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ summary: "Selects elements from `t` or `e`, depending on `condition`."
+ description: "The `condition`, `t`, and `e` tensors must all have the same shape,\nand the output will also have that shape. The `condition` tensor acts\nas an element-wise mask that chooses, based on the value at each\nelement, whether the corresponding element in the output should be\ntaken from `t` (if true) or `e` (if false). For example:\n\nFor example:\n\n```prettyprint\n# \'condition\' tensor is [[True, False]\n# [True, False]]\n# \'t\' is [[1, 1],\n# [1, 1]]\n# \'e\' is [[2, 2],\n# [2, 2]]\nselect(condition, t, e) ==> [[1, 2],\n [1, 2]]\n```"
+}
+op {
+ name: "Shape"
+ input_arg {
+ name: "input"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ type: DT_INT32
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ summary: "Returns the shape of a tensor."
+ description: "This operation returns a 1-D integer tensor representing the shape of `input`.\n\nFor example:\n\n```prettyprint\n# \'t\' is [[[1, 1, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]]\nshape(t) ==> [2, 2, 3]\n```"
+}
+op {
+ name: "ShardedFilename"
+ input_arg {
+ name: "basename"
+ type: DT_STRING
+ }
+ input_arg {
+ name: "shard"
+ type: DT_INT32
+ }
+ input_arg {
+ name: "num_shards"
+ type: DT_INT32
+ }
+ output_arg {
+ name: "filename"
+ type: DT_STRING
+ }
+ summary: "Generate a sharded filename. The filename is printf formated as"
+ description: " %s-%05d-of-%05d, basename, shard, num_shards."
+}
+op {
+ name: "ShardedFilespec"
+ input_arg {
+ name: "basename"
+ type: DT_STRING
+ }
+ input_arg {
+ name: "num_shards"
+ type: DT_INT32
+ }
+ output_arg {
+ name: "filename"
+ type: DT_STRING
+ }
+ summary: "Generate a glob pattern matching all sharded file names."
+}
+op {
+ name: "Sigmoid"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_COMPLEX64
+ type: DT_INT64
+ }
+ }
+ }
+ summary: "Computes sigmoid of `x` element-wise."
+ description: "Specifically, `y = 1 / (1 + exp(-x))`."
+}
+op {
+ name: "Sign"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ summary: "Returns an element-wise indication of the sign of a number."
+ description: "y = sign(x) = -1 if x < 0; 0 if x == 0; 1 if x > 0."
+}
+op {
+ name: "Sin"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_COMPLEX64
+ type: DT_INT64
+ }
+ }
+ }
+ summary: "Computes sin of x element-wise."
+}
+op {
+ name: "Size"
+ input_arg {
+ name: "input"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ type: DT_INT32
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ summary: "Returns the size of a tensor."
+ description: "This operation returns an integer representing the number of elements in\n`input`.\n\nFor example:\n\n```prettyprint\n# \'t\' is [[[1, 1,, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]]]\nsize(t) ==> 12\n```"
+}
+op {
+ name: "Skipgram"
+ output_arg {
+ name: "vocab_word"
+ description: "A vector of words in the corpus."
+ type: DT_STRING
+ }
+ output_arg {
+ name: "vocab_freq"
+ description: "Frequencies of words. Sorted in the non-ascending order."
+ type: DT_INT32
+ }
+ output_arg {
+ name: "words_per_epoch"
+ description: "Number of words per epoch in the data file."
+ type: DT_INT64
+ }
+ output_arg {
+ name: "current_epoch"
+ description: "The current epoch number."
+ type: DT_INT32
+ }
+ output_arg {
+ name: "total_words_processed"
+ description: "The total number of words processed so far."
+ type: DT_INT64
+ }
+ output_arg {
+ name: "examples"
+ description: "A vector of word ids."
+ type: DT_INT32
+ }
+ output_arg {
+ name: "labels"
+ description: "A vector of word ids."
+ type: DT_INT32
+ }
+ attr {
+ name: "filename"
+ type: "string"
+ description: "The corpus\'s text file name."
+ }
+ attr {
+ name: "batch_size"
+ type: "int"
+ description: "The size of produced batch."
+ }
+ attr {
+ name: "window_size"
+ type: "int"
+ default_value {
+ i: 5
+ }
+ description: "The number of words to predict to the left and right of the target."
+ }
+ attr {
+ name: "min_count"
+ type: "int"
+ default_value {
+ i: 5
+ }
+ description: "The minimum number of word occurrences for it to be included in the\nvocabulary."
+ }
+ attr {
+ name: "subsample"
+ type: "float"
+ default_value {
+ f: 0.001
+ }
+ description: "Threshold for word occurrence. Words that appear with higher\nfrequency will be randomly down-sampled. Set to 0 to disable."
+ }
+ summary: "Parses a text file and creates a batch of examples."
+}
+op {
+ name: "Slice"
+ input_arg {
+ name: "input"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "begin"
+ description: "begin[i] specifies the offset into the \'i\'th dimension of\n\'input\' to slice from."
+ type_attr: "Index"
+ }
+ input_arg {
+ name: "size"
+ description: "size[i] specifies the number of elements of the \'i\'th dimension\nof \'input\' to slice. If size[i] is -1, all remaining elements in dimension\ni are included in the slice (i.e. this is equivalent to setting\nsize[i] = input.dim_size(i) - begin[i])."
+ type_attr: "Index"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ attr {
+ name: "Index"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ summary: "Return a slice from \'input\'."
+ description: "The output tensor is a tensor with dimensions described by \'size\'\nwhose values are extracted from \'input\' starting at the offsets in\n\'begin\'.\n\n*Requirements*:\n 0 <= begin[i] <= begin[i] + size[i] <= Di for i in [0, n)"
+}
+op {
+ name: "Softmax"
+ input_arg {
+ name: "logits"
+ description: "2-D with shape `[batch_size, num_classes]`."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "softmax"
+ description: "Same shape as `logits`."
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ }
+ }
+ }
+ summary: "Computes softmax activations."
+ description: "For each batch `i` and class `j` we have\n\n softmax[i, j] = exp(logits[i, j]) / sum(exp(logits[i]))"
+}
+op {
+ name: "SoftmaxCrossEntropyWithLogits"
+ input_arg {
+ name: "features"
+ description: "batch_size x num_classes matrix"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "labels"
+ description: "batch_size x num_classes matrix\nThe caller must ensure that each batch of labels represents a valid\nprobability distribution."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "loss"
+ description: "Per example loss (batch_size vector)."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "backprop"
+ description: "backpropagated gradients (batch_size x num_classes matrix)."
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ }
+ }
+ }
+ summary: "Computes softmax cross entropy cost and gradients to backpropagate."
+ description: "Inputs are the logits, not probabilities."
+}
+op {
+ name: "Softplus"
+ input_arg {
+ name: "features"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "activations"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ }
+ }
+ }
+ summary: "Computes softplus: `log(exp(features) + 1)`."
+}
+op {
+ name: "SoftplusGrad"
+ input_arg {
+ name: "gradients"
+ description: "The backpropagated gradients to the corresponding softplus operation."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "features"
+ description: "The features passed as input to the corresponding softplus operation."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "backprops"
+ description: "The gradients: `gradients / (1 + exp(-features))`."
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ }
+ }
+ }
+ summary: "Computes softplus gradients for a softplus operation."
+}
+op {
+ name: "SparseApplyAdagrad"
+ input_arg {
+ name: "var"
+ description: "Should be from a Variable()."
+ type_attr: "T"
+ is_ref: true
+ }
+ input_arg {
+ name: "accum"
+ description: "Should be from a Variable()."
+ type_attr: "T"
+ is_ref: true
+ }
+ input_arg {
+ name: "lr"
+ description: "Learning rate. Must be a scalar."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "grad"
+ description: "The gradient."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "indices"
+ description: "A vector of indices into the first dimension of var and accum."
+ type_attr: "Tindices"
+ }
+ output_arg {
+ name: "out"
+ description: "Same as \"var\"."
+ type_attr: "T"
+ is_ref: true
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT64
+ type: DT_INT32
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ type: DT_COMPLEX64
+ type: DT_QINT8
+ type: DT_QUINT8
+ type: DT_QINT32
+ }
+ }
+ }
+ attr {
+ name: "Tindices"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ attr {
+ name: "use_locking"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ description: "If True, updating of the var and accum tensors will be protected by\na lock; otherwise the behavior is undefined, but may exhibit less contention."
+ }
+ summary: "Update relevant entries in \'*var\' and \'*accum\' according to the adagrad scheme."
+ description: "That is for rows we have grad for, we update var and accum as follows:\naccum += grad * grad\nvar -= lr * grad * (1 / sqrt(accum))"
+}
+op {
+ name: "SparseApplyMomentum"
+ input_arg {
+ name: "var"
+ description: "Should be from a Variable()."
+ type_attr: "T"
+ is_ref: true
+ }
+ input_arg {
+ name: "accum"
+ description: "Should be from a Variable()."
+ type_attr: "T"
+ is_ref: true
+ }
+ input_arg {
+ name: "lr"
+ description: "Learning rate. Must be a scalar."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "grad"
+ description: "The gradient."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "indices"
+ description: "A vector of indices into the first dimension of var and accum."
+ type_attr: "Tindices"
+ }
+ input_arg {
+ name: "momentum"
+ description: "Momentum. Must be a scalar."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "out"
+ description: "Same as \"var\"."
+ type_attr: "T"
+ is_ref: true
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT64
+ type: DT_INT32
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ type: DT_COMPLEX64
+ type: DT_QINT8
+ type: DT_QUINT8
+ type: DT_QINT32
+ }
+ }
+ }
+ attr {
+ name: "Tindices"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ attr {
+ name: "use_locking"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ description: "If True, updating of the var and accum tensors will be protected by\na lock; otherwise the behavior is undefined, but may exhibit less contention."
+ }
+ summary: "Update relevant entries in \'*var\' and \'*accum\' according to the momentum scheme."
+ description: "That is for rows we have grad for, we update var and accum as follows:\n\naccum = accum * momentum + grad\nvar -= lr * accum"
+}
+op {
+ name: "SparseConcat"
+ input_arg {
+ name: "indices"
+ description: "2-D. Indices of each input `SparseTensor`."
+ type: DT_INT64
+ number_attr: "N"
+ }
+ input_arg {
+ name: "values"
+ description: "1-D. Non-empty values of each `SparseTensor`."
+ type_attr: "T"
+ number_attr: "N"
+ }
+ input_arg {
+ name: "shapes"
+ description: "1-D. Shapes of each `SparseTensor`."
+ type: DT_INT64
+ number_attr: "N"
+ }
+ output_arg {
+ name: "output_indices"
+ description: "2-D. Indices of the concatenated `SparseTensor`."
+ type: DT_INT64
+ }
+ output_arg {
+ name: "output_values"
+ description: "1-D. Non-empty values of the concatenated `SparseTensor`."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output_shape"
+ description: "1-D. Shape of the concatenated `SparseTensor`."
+ type: DT_INT64
+ }
+ attr {
+ name: "concat_dim"
+ type: "int"
+ description: "Dimension to concatenate along."
+ has_minimum: true
+ }
+ attr {
+ name: "N"
+ type: "int"
+ has_minimum: true
+ minimum: 2
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ summary: "Concatenates a list of `SparseTensor` along the specified dimension."
+ description: "Concatenation is with respect to the dense versions of these sparse tensors.\nIt is assumed that each input is a `SparseTensor` whose elements are ordered\nalong increasing dimension number.\n\nAll inputs\' shapes must match, except for the concat dimension. The\n`indices`, `values`, and `shapes` lists must have the same length.\n\nThe output shape is identical to the inputs\', except along the concat\ndimension, where it is the sum of the inputs\' sizes along that dimension.\n\nThe output elements will be resorted to preserve the sort order along\nincreasing dimension number.\n\nThis op runs in `O(M log M)` time, where `M` is the total number of non-empty\nvalues across all inputs. This is due to the need for an internal sort in\norder to concatenate efficiently across an arbitrary dimension.\n\nFor example, if `concat_dim = 1` and the inputs are\n\n sp_inputs[0]: shape = [2, 3]\n [0, 2]: \"a\"\n [1, 0]: \"b\"\n [1, 1]: \"c\"\n\n sp_inputs[1]: shape = [2, 4]\n [0, 1]: \"d\"\n [0, 2]: \"e\"\n\nthen the output will be\n\n shape = [2, 7]\n [0, 2]: \"a\"\n [0, 4]: \"d\"\n [0, 5]: \"e\"\n [1, 0]: \"b\"\n [1, 1]: \"c\"\n\nGraphically this is equivalent to doing\n\n [ a] concat [ d e ] = [ a d e ]\n [b c ] [ ] [b c ]"
+}
+op {
+ name: "SparseMatMul"
+ input_arg {
+ name: "a"
+ type: DT_FLOAT
+ }
+ input_arg {
+ name: "b"
+ type: DT_FLOAT
+ }
+ output_arg {
+ name: "product"
+ type: DT_FLOAT
+ }
+ attr {
+ name: "transpose_a"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ }
+ attr {
+ name: "transpose_b"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ }
+ attr {
+ name: "a_is_sparse"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ }
+ attr {
+ name: "b_is_sparse"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ }
+ summary: "Multiply matrix \"a\" by matrix \"b\"."
+ description: "The inputs must be two-dimensional matrices and the inner dimension of \"a\" must\nmatch the outer dimension of \"b\". This op is optimized for the case where at\nleast one of \"a\" or \"b\" is sparse. The breakeven for using this versus a dense\nmatrix multiply on one platform was 30% zero values in the sparse matrix."
+}
+op {
+ name: "SparseReorder"
+ input_arg {
+ name: "input_indices"
+ description: "2-D. `N x R` matrix with the indices of non-empty values in a\nSparseTensor, possibly not in canonical ordering."
+ type: DT_INT64
+ }
+ input_arg {
+ name: "input_values"
+ description: "1-D. `N` non-empty values corresponding to `input_indices`."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "input_shape"
+ description: "1-D. Shape of the input SparseTensor."
+ type: DT_INT64
+ }
+ output_arg {
+ name: "output_indices"
+ description: "2-D. `N x R` matrix with the same indices as input_indices, but\nin canonical row-major ordering."
+ type: DT_INT64
+ }
+ output_arg {
+ name: "output_values"
+ description: "1-D. `N` non-empty values corresponding to `output_indices`."
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ summary: "Reorders a SparseTensor into the canonical, row-major ordering."
+ description: "Note that by convention, all sparse ops preserve the canonical ordering along\nincreasing dimension number. The only time ordering can be violated is during\nmanual manipulation of the indices and values vectors to add entries.\n\nReordering does not affect the shape of the SparseTensor.\n\nIf the tensor has rank `R` and `N` non-empty values, `input_indices` has\nshape `[N, R]`, input_values has length `N`, and input_shape has length `R`."
+}
+op {
+ name: "SparseSegmentMean"
+ input_arg {
+ name: "data"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "indices"
+ description: "A 1-D tensor. Has same rank as `segment_ids`."
+ type: DT_INT32
+ }
+ input_arg {
+ name: "segment_ids"
+ description: "A 1-D tensor. Values should be sorted and can be repeated."
+ type: DT_INT32
+ }
+ output_arg {
+ name: "output"
+ description: "Has same shape as data, except for dimension_0 which\nhas size `k`, the number of segments."
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ }
+ }
+ }
+ summary: "Computes the mean along sparse segments of a tensor."
+ description: "Read [the section on\nSegmentation](../../api_docs/python/math_ops.md#segmentation) for an explanation\nof segments.\n\nLike `SegmentMean`, but `segment_ids` can have rank less than `data`\'s first\ndimension, selecting a subset of dimension_0, specified by `indices`."
+}
+op {
+ name: "SparseSegmentMeanGrad"
+ input_arg {
+ name: "grad"
+ description: "gradient propagated to the SparseSegmentMean op."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "indices"
+ description: "indices passed to the corresponding SparseSegmentMean op."
+ type: DT_INT32
+ }
+ input_arg {
+ name: "segment_ids"
+ description: "segment_ids passed to the corresponding SparseSegmentMean op."
+ type: DT_INT32
+ }
+ input_arg {
+ name: "output_dim0"
+ description: "dimension_0 of \"data\" passed to SparseSegmentMean op."
+ type: DT_INT32
+ }
+ output_arg {
+ name: "output"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ }
+ }
+ }
+ summary: "Computes gradients for SparseSegmentMean."
+ description: "Returns tensor \"output\" with same shape as grad, except for dimension_0 whose\nvalue is output_dim0."
+}
+op {
+ name: "SparseSegmentSum"
+ input_arg {
+ name: "data"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "indices"
+ description: "A 1-D tensor. Has same rank as `segment_ids`."
+ type: DT_INT32
+ }
+ input_arg {
+ name: "segment_ids"
+ description: "A 1-D tensor. Values should be sorted and can be repeated."
+ type: DT_INT32
+ }
+ output_arg {
+ name: "output"
+ description: "Has same shape as data, except for dimension_0 which\nhas size `k`, the number of segments."
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ }
+ }
+ }
+ summary: "Computes the sum along sparse segments of a tensor."
+ description: "Read [the section on\nSegmentation](../../api_docs/python/math_ops.md#segmentation) for an explanation\nof segments.\n\nLike `SegmentSum`, but `segment_ids` can have rank less than `data`\'s first\ndimension, selecting a subset of dimension_0, specified by `indices`.\n\nFor example:\n\n```prettyprint\nc = tf.constant([[1,2,3,4], [-1,-2,-3,-4], [5,6,7,8]])\n\n# Select two rows, one segment.\ntf.sparse_segment_sum(c, tf.constant([0, 1]), tf.constant([0, 0]))\n ==> [[0 0 0 0]]\n\n# Select two rows, two segment.\ntf.sparse_segment_sum(c, tf.constant([0, 1]), tf.constant([0, 1]))\n ==> [[ 1 2 3 4]\n [-1 -2 -3 -4]]\n\n# Select all rows, two segments.\ntf.sparse_segment_sum(c, tf.constant([0, 1, 2]), tf.constant([0, 0, 1]))\n ==> [[0 0 0 0]\n [5 6 7 8]]\n\n# Which is equivalent to:\ntf.segment_sum(c, tf.constant([0, 0, 1]))\n```"
+}
+op {
+ name: "SparseToDense"
+ input_arg {
+ name: "sparse_indices"
+ description: "0-D, 1-D, or 2-D. `sparse_indices[i]` contains the complete\nindex where `sparse_values[i]` will be placed."
+ type_attr: "Tindices"
+ }
+ input_arg {
+ name: "output_shape"
+ description: "1-D. Shape of the dense output tensor."
+ type_attr: "Tindices"
+ }
+ input_arg {
+ name: "sparse_values"
+ description: "1-D. Values corresponding to each row of `sparse_indices`,\nor a scalar value to be used for all sparse indices."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "default_value"
+ description: "Scalar value to set for indices not specified in\n`sparse_indices`."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "dense"
+ description: "Dense output tensor of shape `output_shape`."
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ attr {
+ name: "Tindices"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ summary: "Converts a sparse representation into a dense tensor."
+ description: "Builds an array `dense` with shape `output_shape` such that\n\n```prettyprint\n# If sparse_indices is scalar\ndense[i] = (i == sparse_indices ? sparse_values : default_value)\n\n# If sparse_indices is a vector, then for each i\ndense[sparse_indices[i]] = sparse_values[i]\n\n# If sparse_indices is an n by d matrix, then for each i in [0, n)\ndense[sparse_indices[i][0], ..., sparse_indices[i][d-1]] = sparse_values[i]\n```\n\nAll other values in `dense` are set to `default_value`. If `sparse_values` is a\nscalar, all sparse indices are set to this single value."
+}
+op {
+ name: "Split"
+ input_arg {
+ name: "split_dim"
+ description: "0-D. The dimension along which to split. Must be in the range\n`[0, rank(value))`."
+ type: DT_INT32
+ }
+ input_arg {
+ name: "value"
+ description: "The tensor to split."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ description: "They are identically shaped tensors, whose shape matches that of `value`\nexcept along `split_dim`, where their sizes are\n`values.shape[split_dim] / num_split`."
+ type_attr: "T"
+ number_attr: "num_split"
+ }
+ attr {
+ name: "num_split"
+ type: "int"
+ description: "The number of ways to split. Must evenly divide\n`value.shape[split_dim]`."
+ has_minimum: true
+ minimum: 1
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ summary: "Splits a tensor into `num_split` tensors along one dimension."
+}
+op {
+ name: "Sqrt"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_COMPLEX64
+ type: DT_INT64
+ }
+ }
+ }
+ summary: "Computes square root of x element-wise."
+ description: "I.e., \\\\(y = \\sqrt{x} = x^{1/2}\\\\)."
+}
+op {
+ name: "Square"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_COMPLEX64
+ type: DT_INT64
+ }
+ }
+ }
+ summary: "Computes square of x element-wise."
+ description: "I.e., \\\\(y = x * x = x^2\\\\)."
+}
+op {
+ name: "Squeeze"
+ input_arg {
+ name: "input"
+ description: "The `input` to squeeze."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ description: "Contains the same data as `input`, but has one or more dimensions of\nsize 1 removed."
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ attr {
+ name: "squeeze_dims"
+ type: "list(int)"
+ default_value {
+ list {
+ }
+ }
+ description: "If specified, only squeezes the dimensions listed. The dimension\nindex starts at 0. It is an error to squeeze a dimension that is not 1."
+ has_minimum: true
+ }
+ summary: "Removes dimensions of size 1 from the shape of a tensor."
+ description: "Given a tensor `input`, this operation returns a tensor of the same type with\nall dimensions of size 1 removed. If you don\'t want to remove all size 1\ndimensions, you can remove specific size 1 dimensions by specifying\n`squeeze_dims`.\n\nFor example:\n\n```prettyprint\n# \'t\' is a tensor of shape [1, 2, 1, 3, 1, 1]\nshape(squeeze(t)) ==> [2, 3]\n```\n\nOr, to remove specific size 1 dimensions:\n\n```prettyprint\n# \'t\' is a tensor of shape [1, 2, 1, 3, 1, 1]\nshape(squeeze(t, [2, 4])) ==> [1, 2, 3, 1]\n```"
+}
+op {
+ name: "StopGradient"
+ input_arg {
+ name: "input"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ summary: "Stops gradient computation."
+ description: "When executed in a graph, this op outputs its input tensor as-is.\n\nWhen building ops to compute gradients, this op prevents the contribution of\nits inputs to be taken into account. Normally, the gradient generator adds ops\nto a graph to compute the derivatives of a specified \'loss\' by recursively\nfinding out inputs that contributed to its computation. If you insert this op\nin the graph it inputs are masked from the gradient generator. They are not\ntaken into account for computing gradients.\n\nThis is useful any time you want to compute a value with TensorFlow but need\nto pretend that the value was a constant. Some examples include:\n\n* The *EM* algorithm where the *M-step* should not involve backpropagation\n through the output of the *E-step*.\n* Contrastive divergence training of Boltzmann machines where, when\n differentiating the energy function, the training must not backpropagate\n through the graph that generated the samples from the model.\n* Adversarial training, where no backprop should happen through the adversarial\n example generation process."
+}
+op {
+ name: "StringToHashBucket"
+ input_arg {
+ name: "string_tensor"
+ type: DT_STRING
+ }
+ output_arg {
+ name: "output"
+ description: "A Tensor of the same shape as the input string_tensor."
+ type: DT_INT64
+ }
+ attr {
+ name: "num_buckets"
+ type: "int"
+ description: "The number of buckets."
+ has_minimum: true
+ minimum: 1
+ }
+ summary: "Converts each string in the input Tensor to its hash mod by a number of buckets."
+ description: "The hash function is deterministic on the content of the string within the\nprocess.\n\nNote that the hash function may change from time to time."
+}
+op {
+ name: "StringToNumber"
+ input_arg {
+ name: "string_tensor"
+ type: DT_STRING
+ }
+ output_arg {
+ name: "output"
+ description: "A Tensor of the same shape as the input string_tensor."
+ type_attr: "out_type"
+ }
+ attr {
+ name: "out_type"
+ type: "type"
+ default_value {
+ type: DT_FLOAT
+ }
+ description: "The numeric type to interpret each string in string_tensor as."
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_INT32
+ }
+ }
+ }
+ summary: "Converts each string in the input Tensor to the specified numeric type."
+ description: "(Note that int32 overflow results in an error while float overflow\nresults in a rounded value.)"
+}
+op {
+ name: "Sub"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "z"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_COMPLEX64
+ type: DT_INT64
+ }
+ }
+ }
+ summary: "Returns x - y element-wise."
+}
+op {
+ name: "Sum"
+ input_arg {
+ name: "input"
+ description: "The tensor to reduce."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "reduction_indices"
+ description: "The dimensions to reduce."
+ type: DT_INT32
+ }
+ output_arg {
+ name: "output"
+ description: "The reduced tensor."
+ type_attr: "T"
+ }
+ attr {
+ name: "keep_dims"
+ type: "bool"
+ default_value {
+ b: false
+ }
+ description: "If true, retain reduced dimensions with length 1."
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT64
+ type: DT_INT32
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ type: DT_COMPLEX64
+ type: DT_QINT8
+ type: DT_QUINT8
+ type: DT_QINT32
+ }
+ }
+ }
+ summary: "Computes the sum of elements across dimensions of a tensor."
+ description: "Reduces `input` along the dimensions given in `reduction_indices`. Unless\n`keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in\n`reduction_indices`. If `keep_dims` is true, the reduced dimensions are\nretained with length 1."
+}
+op {
+ name: "Switch"
+ input_arg {
+ name: "data"
+ description: "The tensor to be forwarded to the appropriate output."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "pred"
+ description: "A scalar that specifies which output port will receive data."
+ type: DT_BOOL
+ }
+ output_arg {
+ name: "output_false"
+ description: "If `pred` is false, data will be forwarded to this output."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output_true"
+ description: "If `pred` is true, data will be forwarded to this output."
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ summary: "Forwards `data` to the output port determined by `pred`."
+ description: "If `pred` is true, the `data` input is forwared to `output_true`. Otherwise,\nthe data goes to `output_false`.\n\nSee also `RefSwitch` and `Merge`."
+}
+op {
+ name: "TFRecordReader"
+ output_arg {
+ name: "reader_handle"
+ description: "The handle to reference the Reader."
+ type: DT_STRING
+ is_ref: true
+ }
+ attr {
+ name: "container"
+ type: "string"
+ default_value {
+ s: ""
+ }
+ description: "If non-empty, this reader is placed in the given container.\nOtherwise, a default container is used."
+ }
+ attr {
+ name: "shared_name"
+ type: "string"
+ default_value {
+ s: ""
+ }
+ description: "If non-empty, this reader is named in the given bucket\nwith this shared_name. Otherwise, the node name is used instead."
+ }
+ summary: "A Reader that outputs the records from a TensorFlow Records file."
+ is_stateful: true
+}
+op {
+ name: "Tanh"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_COMPLEX64
+ type: DT_INT64
+ }
+ }
+ }
+ summary: "Computes hyperbolic tangent of `x` element-wise."
+}
+op {
+ name: "TemporaryVariable"
+ output_arg {
+ name: "ref"
+ description: "A reference to the variable tensor."
+ type_attr: "dtype"
+ is_ref: true
+ }
+ attr {
+ name: "shape"
+ type: "shape"
+ description: "The shape of the variable tensor."
+ }
+ attr {
+ name: "dtype"
+ type: "type"
+ description: "The type of elements in the variable tensor."
+ }
+ attr {
+ name: "var_name"
+ type: "string"
+ default_value {
+ s: ""
+ }
+ description: "Overrides the name used for the temporary variable resource. Default\nvalue is the name of the \'TemporaryVariable\' op (which is guaranteed unique)."
+ }
+ summary: "Returns a tensor that may be mutated, but only persists within a single step."
+ description: "This is an experimental op for internal use only and it is possible to use this\nop in unsafe ways. DO NOT USE unless you fully understand the risks.\n\nIt is the caller\'s responsibility to ensure that \'ref\' is eventually passed to a\nmatching \'DestroyTemporaryVariable\' op after all other uses have completed.\n\nOutputs a ref to the tensor state so it may be read or modified.\n\n E.g.\n var = state_ops._temporary_variable([1, 2], types.float_)\n var_name = var.op.name\n var = state_ops.assign(var, [[4.0, 5.0]])\n var = state_ops.assign_add(var, [[6.0, 7.0]])\n final = state_ops._destroy_temporary_variable(var, var_name=var_name)"
+ is_stateful: true
+}
+op {
+ name: "TextLineReader"
+ output_arg {
+ name: "reader_handle"
+ description: "The handle to reference the Reader."
+ type: DT_STRING
+ is_ref: true
+ }
+ attr {
+ name: "skip_header_lines"
+ type: "int"
+ default_value {
+ i: 0
+ }
+ description: "Number of lines to skip from the beginning of every file."
+ }
+ attr {
+ name: "container"
+ type: "string"
+ default_value {
+ s: ""
+ }
+ description: "If non-empty, this reader is placed in the given container.\nOtherwise, a default container is used."
+ }
+ attr {
+ name: "shared_name"
+ type: "string"
+ default_value {
+ s: ""
+ }
+ description: "If non-empty, this reader is named in the given bucket\nwith this shared_name. Otherwise, the node name is used instead."
+ }
+ summary: "A Reader that outputs the lines of a file delimited by \'\\n\'."
+ is_stateful: true
+}
+op {
+ name: "ThreadUnsafeUnigramCandidateSampler"
+ input_arg {
+ name: "true_classes"
+ description: "A batch_size * num_true matrix, in which each row contains the\nIDs of the num_true target_classes in the corresponding original label."
+ type: DT_INT64
+ }
+ output_arg {
+ name: "sampled_candidates"
+ description: "A vector of length num_sampled, in which each element is\nthe ID of a sampled candidate."
+ type: DT_INT64
+ }
+ output_arg {
+ name: "true_expected_count"
+ description: "A batch_size * num_true matrix, representing\nthe number of times each candidate is expected to occur in a batch\nof sampled candidates. If unique=true, then this is a probability."
+ type: DT_FLOAT
+ }
+ output_arg {
+ name: "sampled_expected_count"
+ description: "A vector of length num_sampled, for each sampled\ncandidate represting the number of times the candidate is expected\nto occur in a batch of sampled candidates. If unique=true, then this is a\nprobability."
+ type: DT_FLOAT
+ }
+ attr {
+ name: "num_true"
+ type: "int"
+ description: "Number of true labels per context."
+ has_minimum: true
+ minimum: 1
+ }
+ attr {
+ name: "num_sampled"
+ type: "int"
+ description: "Number of candidates to randomly sample per batch."
+ has_minimum: true
+ minimum: 1
+ }
+ attr {
+ name: "unique"
+ type: "bool"
+ description: "If unique is true, we sample with rejection, so that all sampled\ncandidates in a batch are unique. This requires some approximation to\nestimate the post-rejection sampling probabilities."
+ }
+ attr {
+ name: "range_max"
+ type: "int"
+ description: "The sampler will sample integers from the interval [0, range_max)."
+ has_minimum: true
+ minimum: 1
+ }
+ attr {
+ name: "seed"
+ type: "int"
+ default_value {
+ i: 0
+ }
+ description: "If either seed or seed2 are set to be non-zero, the random number\ngenerator is seeded by the given seed. Otherwise, it is seeded by a\nrandom seed."
+ }
+ attr {
+ name: "seed2"
+ type: "int"
+ default_value {
+ i: 0
+ }
+ description: "An second seed to avoid seed collision."
+ }
+ summary: "Generates labels for candidate sampling with a learned unigram distribution."
+ description: "See explanations of candidate sampling and the data formats at\ngo/candidate-sampling.\n\nFor each batch, this op picks a single set of sampled candidate labels.\n\nThe advantages of sampling candidates per-batch are simplicity and the\npossibility of efficient dense matrix multiplication. The disadvantage is that\nthe sampled candidates must be chosen independently of the context and of the\ntrue labels."
+}
+op {
+ name: "Tile"
+ input_arg {
+ name: "input"
+ description: "1-D or higher."
+ type_attr: "T"
+ }
+ input_arg {
+ name: "multiples"
+ description: "1-D. Length must be the same as the number of dimensions in `input`"
+ type: DT_INT32
+ }
+ output_arg {
+ name: "output"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ summary: "Constructs a tensor by tiling a given tensor."
+ description: "This operation creates a new tensor by replicating `input` `multiples` times.\nThe output tensor\'s i\'th dimension has `input.dims(i) * multiples[i]` elements,\nand the values of `input` are replicated `multiples[i]` times along the \'i\'th\ndimension. For example, tiling `[a b c d]` by `[2]` produces\n`[a b c d a b c d]`."
+}
+op {
+ name: "TileGrad"
+ input_arg {
+ name: "input"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "multiples"
+ type: DT_INT32
+ }
+ output_arg {
+ name: "output"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ summary: "Returns the gradient of `Tile`."
+ description: "Since `Tile` takes an input and repeats the input `multiples` times\nalong each dimension, `TileGrad` takes in `multiples` and aggregates\neach repeated tile of `input` into `output`."
+}
+op {
+ name: "TopK"
+ input_arg {
+ name: "input"
+ description: "A batch_size x classes tensor"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "values"
+ description: "A batch_size x k tensor with the k largest elements for each row,\nsorted in descending order"
+ type_attr: "T"
+ }
+ output_arg {
+ name: "indices"
+ description: "A batch_size x k tensor with the index of each value within each row"
+ type: DT_INT32
+ }
+ attr {
+ name: "k"
+ type: "int"
+ description: "Number of top elements to look for within each row"
+ has_minimum: true
+ minimum: 1
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ }
+ }
+ }
+ summary: "Returns the values and indices of the k largest elements for each row."
+ description: "\\\\(values_{i, j}\\\\) represents the j-th largest element in \\\\(input_i\\\\).\n\n\\\\(indices_{i, j}\\\\) gives the column index of the corresponding element,\nsuch that \\\\(input_{i, indices_{i, j}} = values_{i, j}\\\\). If two\nelements are equal, the lower-index element appears first."
+}
+op {
+ name: "Transpose"
+ input_arg {
+ name: "x"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "perm"
+ type: DT_INT32
+ }
+ output_arg {
+ name: "y"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ summary: "Shuffle dimensions of x according to a permutation."
+ description: "The output `y` has the same rank as `x`. The shapes of `x` and `y` satisfy:\n `y.shape[i] == x.shape[perm[i]] for i in [0, 1, ..., rank(x) - 1]`"
+}
+op {
+ name: "TruncatedNormal"
+ input_arg {
+ name: "shape"
+ description: "The shape of the output tensor."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ description: "A tensor of the specified shape filled with random truncated normal\nvalues."
+ type_attr: "dtype"
+ }
+ attr {
+ name: "seed"
+ type: "int"
+ default_value {
+ i: 0
+ }
+ description: "If either `seed` or `seed2` are set to be non-zero, the random number\ngenerator is seeded by the given seed. Otherwise, it is seeded by a\nrandom seed."
+ }
+ attr {
+ name: "seed2"
+ type: "int"
+ default_value {
+ i: 0
+ }
+ description: "A second seed to avoid seed collision."
+ }
+ attr {
+ name: "dtype"
+ type: "type"
+ description: "The type of the output."
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ }
+ }
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ summary: "Outputs random values from a truncated normal distribution."
+ description: "The generated values follow a normal distribution with mean 0 and standard\ndeviation 1, except that values whose magnitude is more than 2 standard\ndeviations from the mean are dropped and re-picked."
+ is_stateful: true
+}
+op {
+ name: "UniformCandidateSampler"
+ input_arg {
+ name: "true_classes"
+ description: "A batch_size * num_true matrix, in which each row contains the\nIDs of the num_true target_classes in the corresponding original label."
+ type: DT_INT64
+ }
+ output_arg {
+ name: "sampled_candidates"
+ description: "A vector of length num_sampled, in which each element is\nthe ID of a sampled candidate."
+ type: DT_INT64
+ }
+ output_arg {
+ name: "true_expected_count"
+ description: "A batch_size * num_true matrix, representing\nthe number of times each candidate is expected to occur in a batch\nof sampled candidates. If unique=true, then this is a probability."
+ type: DT_FLOAT
+ }
+ output_arg {
+ name: "sampled_expected_count"
+ description: "A vector of length num_sampled, for each sampled\ncandidate represting the number of times the candidate is expected\nto occur in a batch of sampled candidates. If unique=true, then this is a\nprobability."
+ type: DT_FLOAT
+ }
+ attr {
+ name: "num_true"
+ type: "int"
+ description: "Number of true labels per context."
+ has_minimum: true
+ minimum: 1
+ }
+ attr {
+ name: "num_sampled"
+ type: "int"
+ description: "Number of candidates to randomly sample per batch."
+ has_minimum: true
+ minimum: 1
+ }
+ attr {
+ name: "unique"
+ type: "bool"
+ description: "If unique is true, we sample with rejection, so that all sampled\ncandidates in a batch are unique. This requires some approximation to\nestimate the post-rejection sampling probabilities."
+ }
+ attr {
+ name: "range_max"
+ type: "int"
+ description: "The sampler will sample integers from the interval [0, range_max)."
+ has_minimum: true
+ minimum: 1
+ }
+ attr {
+ name: "seed"
+ type: "int"
+ default_value {
+ i: 0
+ }
+ description: "If either seed or seed2 are set to be non-zero, the random number\ngenerator is seeded by the given seed. Otherwise, it is seeded by a\nrandom seed."
+ }
+ attr {
+ name: "seed2"
+ type: "int"
+ default_value {
+ i: 0
+ }
+ description: "An second seed to avoid seed collision."
+ }
+ summary: "Generates labels for candidate sampling with a uniform distribution."
+ description: "See explanations of candidate sampling and the data formats at\ngo/candidate-sampling.\n\nFor each batch, this op picks a single set of sampled candidate labels.\n\nThe advantages of sampling candidates per-batch are simplicity and the\npossibility of efficient dense matrix multiplication. The disadvantage is that\nthe sampled candidates must be chosen independently of the context and of the\ntrue labels."
+}
+op {
+ name: "Unique"
+ input_arg {
+ name: "x"
+ description: "1-D."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ description: "1-D."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "idx"
+ description: "1-D."
+ type: DT_INT32
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ summary: "Finds unique elements in a 1-D tensor."
+ description: "This operation returns a tensor `y` containing all of the unique elements of `x`\nsorted in the same order that they occur in `x`. This operation also returns a\ntensor `idx` the same size as `x` that contains the index of each value of `x`\nin the unique output `y`. In other words:\n\n`y[idx[i]] = x[i] for i in [0, 1,...,rank(x) - 1]`\n\nFor example:\n\n```prettyprint\n# tensor \'x\' is [1, 1, 2, 4, 4, 4, 7, 8, 8]\ny, idx = unique(x)\ny ==> [1, 2, 4, 7, 8]\nidx ==> [0, 0, 1, 2, 2, 2, 3, 4, 4]\n```"
+}
+op {
+ name: "Unpack"
+ input_arg {
+ name: "value"
+ description: "1-D or higher, with first dimension `num`."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "output"
+ description: "The list of tensors unpacked from `value`."
+ type_attr: "T"
+ number_attr: "num"
+ }
+ attr {
+ name: "num"
+ type: "int"
+ has_minimum: true
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ summary: "Unpacks the outer dimension of a rank-`R` tensor into `num` rank-`(R-1)` tensors."
+ description: "Unpacks `num` tensors from `value` by chipping it along the first dimension.\nThe i\'th tensor in `output` is the slice `value[i, ...]`. Each tensor in\n`output` has shape `value.shape[1:]`.\n\nThis is the opposite of `pack`."
+}
+op {
+ name: "UnsortedSegmentSum"
+ input_arg {
+ name: "data"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "segment_ids"
+ description: "A 1-D tensor whose rank is equal to the rank of `data`\'s\nfirst dimension."
+ type_attr: "Tindices"
+ }
+ input_arg {
+ name: "num_segments"
+ type: DT_INT32
+ }
+ output_arg {
+ name: "output"
+ description: "Has same shape as data, except for dimension_0 which\nhas size `num_segments`."
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_FLOAT
+ type: DT_DOUBLE
+ type: DT_INT32
+ type: DT_INT64
+ type: DT_UINT8
+ type: DT_INT16
+ type: DT_INT8
+ }
+ }
+ }
+ attr {
+ name: "Tindices"
+ type: "type"
+ allowed_values {
+ list {
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ summary: "Computes the sum along segments of a tensor."
+ description: "Read [the section on\nSegmentation](../../api_docs/python/math_ops.md#segmentation) for an explanation\nof segments.\n\nComputes a tensor such that\n\\\\(output_i = \\sum_j data_j\\\\) where sum is over `j` such\nthat `segment_ids[j] == i`. Unlike `SegmentSum`, `segment_ids`\nneed not be sorted and need not cover all values in the full\n range of valid values.\n\nIf the sum is empty for a given segment ID `i`, `output[i] = 0`.\n\n`num_segments` should equal the number of distinct segment IDs.\n\n<div style=\"width:70%; margin:auto; margin-bottom:10px; margin-top:20px;\">\n<img style=\"width:100%\" src=\"../images/UnsortedSegmentSum.png\" alt>\n</div>"
+}
+op {
+ name: "Variable"
+ output_arg {
+ name: "ref"
+ description: "A reference to the variable tensor."
+ type_attr: "dtype"
+ is_ref: true
+ }
+ attr {
+ name: "shape"
+ type: "shape"
+ description: "The shape of the variable tensor."
+ }
+ attr {
+ name: "dtype"
+ type: "type"
+ description: "The type of elements in the variable tensor."
+ }
+ attr {
+ name: "container"
+ type: "string"
+ default_value {
+ s: ""
+ }
+ description: "If non-empty, this variable is placed in the given container.\nOtherwise, a default container is used."
+ }
+ attr {
+ name: "shared_name"
+ type: "string"
+ default_value {
+ s: ""
+ }
+ description: "If non-empty, this variable is named in the given bucket\nwith this shared_name. Otherwise, the node name is used instead."
+ }
+ summary: "Holds state in the form of a tensor that persists across steps."
+ description: "Outputs a ref to the tensor state so it may be read or modified.\nTODO(zhifengc/mrry): Adds a pointer to a more detail document\nabout sharing states in tensorflow."
+ is_stateful: true
+}
+op {
+ name: "Where"
+ input_arg {
+ name: "input"
+ type: DT_BOOL
+ }
+ output_arg {
+ name: "index"
+ type: DT_INT64
+ }
+ summary: "Returns locations of true values in a boolean tensor."
+ description: "This operation returns the coordinates of true elements in `input`. The\ncoordinates are returned in a 2-D tensor where the first dimension (rows)\nrepresents the number of true elements, and the second dimension (columns)\nrepresents the coordinates of the true elements. Keep in mind, the shape of\nthe output tensor can vary depending on how many true values there are in\n`input`. Indices are output in row-major order.\n\nFor example:\n\n```prettyprint\n# \'input\' tensor is [[True, False]\n# [True, False]]\n# \'input\' has two true values, so output has two coordinates.\n# \'input\' has rank of 2, so coordinates have two indices.\nwhere(input) ==> [[0, 0],\n [1, 0]]\n\n# `input` tensor is [[[True, False]\n# [True, False]]\n# [[False, True]\n# [False, True]]\n# [[False, False]\n# [False, True]]]\n# \'input\' has 5 true values, so output has 5 coordinates.\n# \'input\' has rank of 3, so coordinates have three indices.\nwhere(input) ==> [[0, 0, 0],\n [0, 1, 0],\n [1, 0, 1],\n [1, 1, 1],\n [2, 1, 1]]\n```"
+}
+op {
+ name: "WholeFileReader"
+ output_arg {
+ name: "reader_handle"
+ description: "The handle to reference the Reader."
+ type: DT_STRING
+ is_ref: true
+ }
+ attr {
+ name: "container"
+ type: "string"
+ default_value {
+ s: ""
+ }
+ description: "If non-empty, this reader is placed in the given container.\nOtherwise, a default container is used."
+ }
+ attr {
+ name: "shared_name"
+ type: "string"
+ default_value {
+ s: ""
+ }
+ description: "If non-empty, this reader is named in the given bucket\nwith this shared_name. Otherwise, the node name is used instead."
+ }
+ summary: "A Reader that outputs the entire contents of a file as a value."
+ description: "To use, enqueue filenames in a Queue. The output of ReaderRead will\nbe a filename (key) and the contents of that file (value)."
+ is_stateful: true
+}
+op {
+ name: "ZerosLike"
+ input_arg {
+ name: "x"
+ description: "a tensor of type T."
+ type_attr: "T"
+ }
+ output_arg {
+ name: "y"
+ description: "a tensor of the same shape and type as x but filled with zeros."
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ summary: "Returns a tensor of zeros with the same shape and type as x."
+}
diff --git a/tensorflow/core/ops/summary_ops.cc b/tensorflow/core/ops/summary_ops.cc
index 5f46c871b6..0b640ac78a 100644
--- a/tensorflow/core/ops/summary_ops.cc
+++ b/tensorflow/core/ops/summary_ops.cc
@@ -23,8 +23,9 @@ summary: Scalar. Serialized `Summary` protocol buffer.
REGISTER_OP("HistogramSummary")
.Input("tag: string")
- .Input("values: float")
+ .Input("values: T")
.Output("summary: string")
+ .Attr("T: {float, double} = DT_FLOAT")
.Doc(R"doc(
Outputs a `Summary` protocol buffer with a histogram.
diff --git a/tensorflow/core/platform/protobuf.h b/tensorflow/core/platform/protobuf.h
index 3a166b3973..299d6c6cb2 100644
--- a/tensorflow/core/platform/protobuf.h
+++ b/tensorflow/core/platform/protobuf.h
@@ -4,8 +4,8 @@
// Import whatever namespace protobuf comes from into the
// ::tensorflow::protobuf namespace.
//
-// TensorFlow code should the ::tensorflow::protobuf namespace to refer
-// to all protobuf APIs.
+// TensorFlow code should use the ::tensorflow::protobuf namespace to
+// refer to all protobuf APIs.
#include "tensorflow/core/platform/port.h"
#if defined(PLATFORM_GOOGLE)
diff --git a/tensorflow/core/public/version.h b/tensorflow/core/public/version.h
new file mode 100644
index 0000000000..f17a5e1a04
--- /dev/null
+++ b/tensorflow/core/public/version.h
@@ -0,0 +1,24 @@
+#ifndef THIRD_PARTY_TENSORFLOW_CORE_PUBLIC_VERSION_H_
+#define THIRD_PARTY_TENSORFLOW_CORE_PUBLIC_VERSION_H_
+
+// TensorFlow uses semantic versioning, see http://semver.org/.
+
+#define TF_MAJOR_VERSION 0
+#define TF_MINOR_VERSION 5
+#define TF_PATCH_VERSION 0
+
+// TF_VERSION_SUFFIX is non-empty for pre-releases (e.g. "-alpha", "-alpha.1",
+// "-beta", "-rc", "-rc.1")
+#define TF_VERSION_SUFFIX ""
+
+#define TF_STR_HELPER(x) #x
+#define TF_STR(x) TF_STR_HELPER(x)
+
+// e.g. "0.5.0" or "0.6.0-alpha".
+#define TF_VERSION_STRING \
+ (TF_STR(TF_MAJOR_VERSION) "." TF_STR(TF_MINOR_VERSION) "." TF_STR( \
+ TF_PATCH_VERSION) TF_VERSION_SUFFIX)
+
+// TODO(josh11b): Public API functions for exporting the above.
+
+#endif // THIRD_PARTY_TENSORFLOW_CORE_PUBLIC_VERSION_H_
diff --git a/tensorflow/core/util/cuda_kernel_helper.h b/tensorflow/core/util/cuda_kernel_helper.h
new file mode 100644
index 0000000000..09304af13c
--- /dev/null
+++ b/tensorflow/core/util/cuda_kernel_helper.h
@@ -0,0 +1,52 @@
+#ifndef THIRD_PARTY_TENSORFLOW_CORE_UTIL_CUDA_KERNEL_HELPER_H_
+#define THIRD_PARTY_TENSORFLOW_CORE_UTIL_CUDA_KERNEL_HELPER_H_
+
+#if GOOGLE_CUDA
+
+#include <algorithm>
+
+#define CUDA_1D_KERNEL_LOOP(i, n) \
+ for (int i = blockIdx.x * blockDim.x + threadIdx.x; i < n; \
+ i += blockDim.x * gridDim.x)
+
+namespace tensorflow {
+
+typedef Eigen::GpuDevice GPUDevice;
+
+struct CudaLaunchConfig {
+ // Logical number of thread that works on the elements. If each logic thread
+ // works on exactly a single element, this is the same as the working element
+ // count.
+ int virtual_thread_count = -1;
+ // Number of threads per block.
+ int thread_per_block = -1;
+ // Number of blocks for Cuda kernel launch.
+ int block_count = -1;
+};
+
+// Calculate the Cuda launch config we should use for a kernel launch.
+// This is assuming the kernel is quite simple and will largely be
+// memory-limited.
+inline CudaLaunchConfig GetCudaLaunchConfig(int work_element_count,
+ const GPUDevice& d) {
+ const int virtual_thread_count = work_element_count;
+ const int physical_thread_count = std::min(
+ d.getNumCudaMultiProcessors() * d.maxCudaThreadsPerMultiProcessor(),
+ virtual_thread_count);
+ const int thread_per_block = std::min(1024, d.maxCudaThreadsPerBlock());
+ const int block_count = std::min(
+ (physical_thread_count + thread_per_block - 1) / thread_per_block,
+ d.getNumCudaMultiProcessors());
+
+ CudaLaunchConfig config;
+ config.virtual_thread_count = virtual_thread_count;
+ config.thread_per_block = thread_per_block;
+ config.block_count = block_count;
+ return config;
+}
+
+} // namespace tensorflow
+
+#endif // GOOGLE_CUDA
+
+#endif // THIRD_PARTY_TENSORFLOW_CORE_UTIL_CUDA_KERNEL_HELPER_H_
diff --git a/tensorflow/g3doc/api_docs/cc/ClassEnv.md b/tensorflow/g3doc/api_docs/cc/ClassEnv.md
index 642b65392f..62bc69ada8 100644
--- a/tensorflow/g3doc/api_docs/cc/ClassEnv.md
+++ b/tensorflow/g3doc/api_docs/cc/ClassEnv.md
@@ -1,4 +1,4 @@
-# Class `tensorflow::Env` <a class="md-anchor" id="AUTOGENERATED-class--tensorflow--env-"></a>
+# Class `tensorflow::Env`
An interface used by the tensorflow implementation to access operating system functionality like the filesystem etc.
@@ -6,7 +6,7 @@ Callers may wish to provide a custom Env object to get fine grain control.
All Env implementations are safe for concurrent access from multiple threads without any external synchronization.
-##Member Summary <a class="md-anchor" id="AUTOGENERATED-member-summary"></a>
+##Member Summary
* [`tensorflow::Env::Env()`](#tensorflow_Env_Env)
* [`virtual tensorflow::Env::~Env()`](#virtual_tensorflow_Env_Env)
@@ -39,21 +39,21 @@ All Env implementations are safe for concurrent access from multiple threads wit
* [`static Env* tensorflow::Env::Default()`](#static_Env_tensorflow_Env_Default)
* Returns a default environment suitable for the current operating system.
-##Member Details <a class="md-anchor" id="AUTOGENERATED-member-details"></a>
+##Member Details
-#### `tensorflow::Env::Env()` <a class="md-anchor" id="tensorflow_Env_Env"></a>
+#### `tensorflow::Env::Env()` {#tensorflow_Env_Env}
-#### `virtual tensorflow::Env::~Env()` <a class="md-anchor" id="virtual_tensorflow_Env_Env"></a>
+#### `virtual tensorflow::Env::~Env()` {#virtual_tensorflow_Env_Env}
-#### `virtual Status tensorflow::Env::NewRandomAccessFile(const string &fname, RandomAccessFile **result)=0` <a class="md-anchor" id="virtual_Status_tensorflow_Env_NewRandomAccessFile"></a>
+#### `virtual Status tensorflow::Env::NewRandomAccessFile(const string &fname, RandomAccessFile **result)=0` {#virtual_Status_tensorflow_Env_NewRandomAccessFile}
Creates a brand new random access read-only file with the specified name.
@@ -61,7 +61,7 @@ On success, stores a pointer to the new file in *result and returns OK. On failu
The returned file may be concurrently accessed by multiple threads.
-#### `virtual Status tensorflow::Env::NewWritableFile(const string &fname, WritableFile **result)=0` <a class="md-anchor" id="virtual_Status_tensorflow_Env_NewWritableFile"></a>
+#### `virtual Status tensorflow::Env::NewWritableFile(const string &fname, WritableFile **result)=0` {#virtual_Status_tensorflow_Env_NewWritableFile}
Creates an object that writes to a new file with the specified name.
@@ -69,7 +69,7 @@ Deletes any existing file with the same name and creates a new file. On success,
The returned file will only be accessed by one thread at a time.
-#### `virtual Status tensorflow::Env::NewAppendableFile(const string &fname, WritableFile **result)=0` <a class="md-anchor" id="virtual_Status_tensorflow_Env_NewAppendableFile"></a>
+#### `virtual Status tensorflow::Env::NewAppendableFile(const string &fname, WritableFile **result)=0` {#virtual_Status_tensorflow_Env_NewAppendableFile}
Creates an object that either appends to an existing file, or writes to a new file (if the file does not exist to begin with).
@@ -77,67 +77,67 @@ On success, stores a pointer to the new file in *result and returns OK. On failu
The returned file will only be accessed by one thread at a time.
-#### `virtual bool tensorflow::Env::FileExists(const string &fname)=0` <a class="md-anchor" id="virtual_bool_tensorflow_Env_FileExists"></a>
+#### `virtual bool tensorflow::Env::FileExists(const string &fname)=0` {#virtual_bool_tensorflow_Env_FileExists}
Returns true iff the named file exists.
-#### `virtual Status tensorflow::Env::GetChildren(const string &dir, std::vector< string > *result)=0` <a class="md-anchor" id="virtual_Status_tensorflow_Env_GetChildren"></a>
+#### `virtual Status tensorflow::Env::GetChildren(const string &dir, std::vector< string > *result)=0` {#virtual_Status_tensorflow_Env_GetChildren}
Stores in *result the names of the children of the specified directory. The names are relative to "dir".
Original contents of *results are dropped.
-#### `virtual Status tensorflow::Env::DeleteFile(const string &fname)=0` <a class="md-anchor" id="virtual_Status_tensorflow_Env_DeleteFile"></a>
+#### `virtual Status tensorflow::Env::DeleteFile(const string &fname)=0` {#virtual_Status_tensorflow_Env_DeleteFile}
Deletes the named file.
-#### `virtual Status tensorflow::Env::CreateDir(const string &dirname)=0` <a class="md-anchor" id="virtual_Status_tensorflow_Env_CreateDir"></a>
+#### `virtual Status tensorflow::Env::CreateDir(const string &dirname)=0` {#virtual_Status_tensorflow_Env_CreateDir}
Creates the specified directory.
-#### `virtual Status tensorflow::Env::DeleteDir(const string &dirname)=0` <a class="md-anchor" id="virtual_Status_tensorflow_Env_DeleteDir"></a>
+#### `virtual Status tensorflow::Env::DeleteDir(const string &dirname)=0` {#virtual_Status_tensorflow_Env_DeleteDir}
Deletes the specified directory.
-#### `virtual Status tensorflow::Env::GetFileSize(const string &fname, uint64 *file_size)=0` <a class="md-anchor" id="virtual_Status_tensorflow_Env_GetFileSize"></a>
+#### `virtual Status tensorflow::Env::GetFileSize(const string &fname, uint64 *file_size)=0` {#virtual_Status_tensorflow_Env_GetFileSize}
Stores the size of fname in *file_size.
-#### `virtual Status tensorflow::Env::RenameFile(const string &src, const string &target)=0` <a class="md-anchor" id="virtual_Status_tensorflow_Env_RenameFile"></a>
+#### `virtual Status tensorflow::Env::RenameFile(const string &src, const string &target)=0` {#virtual_Status_tensorflow_Env_RenameFile}
Renames file src to target. If target already exists, it will be replaced.
-#### `virtual uint64 tensorflow::Env::NowMicros()=0` <a class="md-anchor" id="virtual_uint64_tensorflow_Env_NowMicros"></a>
+#### `virtual uint64 tensorflow::Env::NowMicros()=0` {#virtual_uint64_tensorflow_Env_NowMicros}
Returns the number of micro-seconds since some fixed point in time. Only useful for computing deltas of time.
-#### `virtual void tensorflow::Env::SleepForMicroseconds(int micros)=0` <a class="md-anchor" id="virtual_void_tensorflow_Env_SleepForMicroseconds"></a>
+#### `virtual void tensorflow::Env::SleepForMicroseconds(int micros)=0` {#virtual_void_tensorflow_Env_SleepForMicroseconds}
Sleeps/delays the thread for the prescribed number of micro-seconds.
-#### `virtual Thread* tensorflow::Env::StartThread(const ThreadOptions &thread_options, const string &name, std::function< void()> fn) TF_MUST_USE_RESULT=0` <a class="md-anchor" id="virtual_Thread_tensorflow_Env_StartThread"></a>
+#### `virtual Thread* tensorflow::Env::StartThread(const ThreadOptions &thread_options, const string &name, std::function< void()> fn) TF_MUST_USE_RESULT=0` {#virtual_Thread_tensorflow_Env_StartThread}
Returns a new thread that is running fn() and is identified (for debugging/performance-analysis) by "name".
Caller takes ownership of the result and must delete it eventually (the deletion will block until fn() stops running).
-#### `static Env* tensorflow::Env::Default()` <a class="md-anchor" id="static_Env_tensorflow_Env_Default"></a>
+#### `static Env* tensorflow::Env::Default()` {#static_Env_tensorflow_Env_Default}
Returns a default environment suitable for the current operating system.
diff --git a/tensorflow/g3doc/api_docs/cc/ClassEnvWrapper.md b/tensorflow/g3doc/api_docs/cc/ClassEnvWrapper.md
index cd18bb24bf..54ffc6f559 100644
--- a/tensorflow/g3doc/api_docs/cc/ClassEnvWrapper.md
+++ b/tensorflow/g3doc/api_docs/cc/ClassEnvWrapper.md
@@ -1,10 +1,10 @@
-# Class `tensorflow::EnvWrapper` <a class="md-anchor" id="AUTOGENERATED-class--tensorflow--envwrapper-"></a>
+# Class `tensorflow::EnvWrapper`
An implementation of Env that forwards all calls to another Env .
May be useful to clients who wish to override just part of the functionality of another Env .
-##Member Summary <a class="md-anchor" id="AUTOGENERATED-member-summary"></a>
+##Member Summary
* [`tensorflow::EnvWrapper::EnvWrapper(Env *t)`](#tensorflow_EnvWrapper_EnvWrapper)
* Initializes an EnvWrapper that delegates all calls to *t.
@@ -38,27 +38,27 @@ May be useful to clients who wish to override just part of the functionality of
* [`Thread* tensorflow::EnvWrapper::StartThread(const ThreadOptions &thread_options, const string &name, std::function< void()> fn) override`](#Thread_tensorflow_EnvWrapper_StartThread)
* Returns a new thread that is running fn() and is identified (for debugging/performance-analysis) by "name".
-##Member Details <a class="md-anchor" id="AUTOGENERATED-member-details"></a>
+##Member Details
-#### `tensorflow::EnvWrapper::EnvWrapper(Env *t)` <a class="md-anchor" id="tensorflow_EnvWrapper_EnvWrapper"></a>
+#### `tensorflow::EnvWrapper::EnvWrapper(Env *t)` {#tensorflow_EnvWrapper_EnvWrapper}
Initializes an EnvWrapper that delegates all calls to *t.
-#### `virtual tensorflow::EnvWrapper::~EnvWrapper()` <a class="md-anchor" id="virtual_tensorflow_EnvWrapper_EnvWrapper"></a>
+#### `virtual tensorflow::EnvWrapper::~EnvWrapper()` {#virtual_tensorflow_EnvWrapper_EnvWrapper}
-#### `Env* tensorflow::EnvWrapper::target() const` <a class="md-anchor" id="Env_tensorflow_EnvWrapper_target"></a>
+#### `Env* tensorflow::EnvWrapper::target() const` {#Env_tensorflow_EnvWrapper_target}
Returns the target to which this Env forwards all calls.
-#### `Status tensorflow::EnvWrapper::NewRandomAccessFile(const string &f, RandomAccessFile **r) override` <a class="md-anchor" id="Status_tensorflow_EnvWrapper_NewRandomAccessFile"></a>
+#### `Status tensorflow::EnvWrapper::NewRandomAccessFile(const string &f, RandomAccessFile **r) override` {#Status_tensorflow_EnvWrapper_NewRandomAccessFile}
Creates a brand new random access read-only file with the specified name.
@@ -66,7 +66,7 @@ On success, stores a pointer to the new file in *result and returns OK. On failu
The returned file may be concurrently accessed by multiple threads.
-#### `Status tensorflow::EnvWrapper::NewWritableFile(const string &f, WritableFile **r) override` <a class="md-anchor" id="Status_tensorflow_EnvWrapper_NewWritableFile"></a>
+#### `Status tensorflow::EnvWrapper::NewWritableFile(const string &f, WritableFile **r) override` {#Status_tensorflow_EnvWrapper_NewWritableFile}
Creates an object that writes to a new file with the specified name.
@@ -74,7 +74,7 @@ Deletes any existing file with the same name and creates a new file. On success,
The returned file will only be accessed by one thread at a time.
-#### `Status tensorflow::EnvWrapper::NewAppendableFile(const string &f, WritableFile **r) override` <a class="md-anchor" id="Status_tensorflow_EnvWrapper_NewAppendableFile"></a>
+#### `Status tensorflow::EnvWrapper::NewAppendableFile(const string &f, WritableFile **r) override` {#Status_tensorflow_EnvWrapper_NewAppendableFile}
Creates an object that either appends to an existing file, or writes to a new file (if the file does not exist to begin with).
@@ -82,61 +82,61 @@ On success, stores a pointer to the new file in *result and returns OK. On failu
The returned file will only be accessed by one thread at a time.
-#### `bool tensorflow::EnvWrapper::FileExists(const string &f) override` <a class="md-anchor" id="bool_tensorflow_EnvWrapper_FileExists"></a>
+#### `bool tensorflow::EnvWrapper::FileExists(const string &f) override` {#bool_tensorflow_EnvWrapper_FileExists}
Returns true iff the named file exists.
-#### `Status tensorflow::EnvWrapper::GetChildren(const string &dir, std::vector< string > *r) override` <a class="md-anchor" id="Status_tensorflow_EnvWrapper_GetChildren"></a>
+#### `Status tensorflow::EnvWrapper::GetChildren(const string &dir, std::vector< string > *r) override` {#Status_tensorflow_EnvWrapper_GetChildren}
Stores in *result the names of the children of the specified directory. The names are relative to "dir".
Original contents of *results are dropped.
-#### `Status tensorflow::EnvWrapper::DeleteFile(const string &f) override` <a class="md-anchor" id="Status_tensorflow_EnvWrapper_DeleteFile"></a>
+#### `Status tensorflow::EnvWrapper::DeleteFile(const string &f) override` {#Status_tensorflow_EnvWrapper_DeleteFile}
Deletes the named file.
-#### `Status tensorflow::EnvWrapper::CreateDir(const string &d) override` <a class="md-anchor" id="Status_tensorflow_EnvWrapper_CreateDir"></a>
+#### `Status tensorflow::EnvWrapper::CreateDir(const string &d) override` {#Status_tensorflow_EnvWrapper_CreateDir}
Creates the specified directory.
-#### `Status tensorflow::EnvWrapper::DeleteDir(const string &d) override` <a class="md-anchor" id="Status_tensorflow_EnvWrapper_DeleteDir"></a>
+#### `Status tensorflow::EnvWrapper::DeleteDir(const string &d) override` {#Status_tensorflow_EnvWrapper_DeleteDir}
Deletes the specified directory.
-#### `Status tensorflow::EnvWrapper::GetFileSize(const string &f, uint64 *s) override` <a class="md-anchor" id="Status_tensorflow_EnvWrapper_GetFileSize"></a>
+#### `Status tensorflow::EnvWrapper::GetFileSize(const string &f, uint64 *s) override` {#Status_tensorflow_EnvWrapper_GetFileSize}
Stores the size of fname in *file_size.
-#### `Status tensorflow::EnvWrapper::RenameFile(const string &s, const string &t) override` <a class="md-anchor" id="Status_tensorflow_EnvWrapper_RenameFile"></a>
+#### `Status tensorflow::EnvWrapper::RenameFile(const string &s, const string &t) override` {#Status_tensorflow_EnvWrapper_RenameFile}
Renames file src to target. If target already exists, it will be replaced.
-#### `uint64 tensorflow::EnvWrapper::NowMicros() override` <a class="md-anchor" id="uint64_tensorflow_EnvWrapper_NowMicros"></a>
+#### `uint64 tensorflow::EnvWrapper::NowMicros() override` {#uint64_tensorflow_EnvWrapper_NowMicros}
Returns the number of micro-seconds since some fixed point in time. Only useful for computing deltas of time.
-#### `void tensorflow::EnvWrapper::SleepForMicroseconds(int micros) override` <a class="md-anchor" id="void_tensorflow_EnvWrapper_SleepForMicroseconds"></a>
+#### `void tensorflow::EnvWrapper::SleepForMicroseconds(int micros) override` {#void_tensorflow_EnvWrapper_SleepForMicroseconds}
Sleeps/delays the thread for the prescribed number of micro-seconds.
-#### `Thread* tensorflow::EnvWrapper::StartThread(const ThreadOptions &thread_options, const string &name, std::function< void()> fn) override` <a class="md-anchor" id="Thread_tensorflow_EnvWrapper_StartThread"></a>
+#### `Thread* tensorflow::EnvWrapper::StartThread(const ThreadOptions &thread_options, const string &name, std::function< void()> fn) override` {#Thread_tensorflow_EnvWrapper_StartThread}
Returns a new thread that is running fn() and is identified (for debugging/performance-analysis) by "name".
diff --git a/tensorflow/g3doc/api_docs/cc/ClassRandomAccessFile.md b/tensorflow/g3doc/api_docs/cc/ClassRandomAccessFile.md
index 78a25054aa..6afcf1ee9f 100644
--- a/tensorflow/g3doc/api_docs/cc/ClassRandomAccessFile.md
+++ b/tensorflow/g3doc/api_docs/cc/ClassRandomAccessFile.md
@@ -1,31 +1,31 @@
-# Class `tensorflow::RandomAccessFile` <a class="md-anchor" id="AUTOGENERATED-class--tensorflow--randomaccessfile-"></a>
+# Class `tensorflow::RandomAccessFile`
A file abstraction for randomly reading the contents of a file.
-##Member Summary <a class="md-anchor" id="AUTOGENERATED-member-summary"></a>
+##Member Summary
* [`tensorflow::RandomAccessFile::RandomAccessFile()`](#tensorflow_RandomAccessFile_RandomAccessFile)
* [`virtual tensorflow::RandomAccessFile::~RandomAccessFile()`](#virtual_tensorflow_RandomAccessFile_RandomAccessFile)
* [`virtual Status tensorflow::RandomAccessFile::Read(uint64 offset, size_t n, StringPiece *result, char *scratch) const =0`](#virtual_Status_tensorflow_RandomAccessFile_Read)
* Reads up to "n" bytes from the file starting at "offset".
-##Member Details <a class="md-anchor" id="AUTOGENERATED-member-details"></a>
+##Member Details
-#### `tensorflow::RandomAccessFile::RandomAccessFile()` <a class="md-anchor" id="tensorflow_RandomAccessFile_RandomAccessFile"></a>
+#### `tensorflow::RandomAccessFile::RandomAccessFile()` {#tensorflow_RandomAccessFile_RandomAccessFile}
-#### `virtual tensorflow::RandomAccessFile::~RandomAccessFile()` <a class="md-anchor" id="virtual_tensorflow_RandomAccessFile_RandomAccessFile"></a>
+#### `virtual tensorflow::RandomAccessFile::~RandomAccessFile()` {#virtual_tensorflow_RandomAccessFile_RandomAccessFile}
-#### `virtual Status tensorflow::RandomAccessFile::Read(uint64 offset, size_t n, StringPiece *result, char *scratch) const =0` <a class="md-anchor" id="virtual_Status_tensorflow_RandomAccessFile_Read"></a>
+#### `virtual Status tensorflow::RandomAccessFile::Read(uint64 offset, size_t n, StringPiece *result, char *scratch) const =0` {#virtual_Status_tensorflow_RandomAccessFile_Read}
Reads up to "n" bytes from the file starting at "offset".
diff --git a/tensorflow/g3doc/api_docs/cc/ClassSession.md b/tensorflow/g3doc/api_docs/cc/ClassSession.md
index ebdd9a4a0f..a0fe3a4a30 100644
--- a/tensorflow/g3doc/api_docs/cc/ClassSession.md
+++ b/tensorflow/g3doc/api_docs/cc/ClassSession.md
@@ -1,4 +1,4 @@
-# Class `tensorflow::Session` <a class="md-anchor" id="AUTOGENERATED-class--tensorflow--session-"></a>
+# Class `tensorflow::Session`
A Session instance lets a caller drive a TensorFlow graph computation.
@@ -41,7 +41,7 @@ A Session allows concurrent calls to Run() , though a Session must be created /
Only one thread must call Close() , and Close() must only be called after all other calls to Run() have returned.
-##Member Summary <a class="md-anchor" id="AUTOGENERATED-member-summary"></a>
+##Member Summary
* [`virtual Status tensorflow::Session::Create(const GraphDef &graph)=0`](#virtual_Status_tensorflow_Session_Create)
* Create the graph to be used for the session.
@@ -53,21 +53,21 @@ Only one thread must call Close() , and Close() must only be called after all ot
* Closes this session.
* [`virtual tensorflow::Session::~Session()`](#virtual_tensorflow_Session_Session)
-##Member Details <a class="md-anchor" id="AUTOGENERATED-member-details"></a>
+##Member Details
-#### `virtual Status tensorflow::Session::Create(const GraphDef &graph)=0` <a class="md-anchor" id="virtual_Status_tensorflow_Session_Create"></a>
+#### `virtual Status tensorflow::Session::Create(const GraphDef &graph)=0` {#virtual_Status_tensorflow_Session_Create}
Create the graph to be used for the session.
Returns an error if this session has already been created with a graph. To re-use the session with a different graph, the caller must Close() the session first.
-#### `virtual Status tensorflow::Session::Extend(const GraphDef &graph)=0` <a class="md-anchor" id="virtual_Status_tensorflow_Session_Extend"></a>
+#### `virtual Status tensorflow::Session::Extend(const GraphDef &graph)=0` {#virtual_Status_tensorflow_Session_Extend}
Adds operations to the graph that is already registered with the Session .
The names of new operations in "graph" must not exist in the graph that is already registered.
-#### `virtual Status tensorflow::Session::Run(const std::vector< std::pair< string, Tensor > > &inputs, const std::vector< string > &output_tensor_names, const std::vector< string > &target_node_names, std::vector< Tensor > *outputs)=0` <a class="md-anchor" id="virtual_Status_tensorflow_Session_Run"></a>
+#### `virtual Status tensorflow::Session::Run(const std::vector< std::pair< string, Tensor > > &inputs, const std::vector< string > &output_tensor_names, const std::vector< string > &target_node_names, std::vector< Tensor > *outputs)=0` {#virtual_Status_tensorflow_Session_Run}
Runs the graph with the provided input tensors and fills `outputs` for the endpoints specified in `output_tensor_names`. Runs to but does not return Tensors for the nodes in `target_node_names`.
@@ -79,13 +79,13 @@ REQUIRES: The name of each Tensor of the input or output must match a "Tensor en
REQUIRES: outputs is not nullptr if `output_tensor_names` is non-empty.
-#### `virtual Status tensorflow::Session::Close()=0` <a class="md-anchor" id="virtual_Status_tensorflow_Session_Close"></a>
+#### `virtual Status tensorflow::Session::Close()=0` {#virtual_Status_tensorflow_Session_Close}
Closes this session.
Closing a session releases the resources used by this session on the TensorFlow runtime (specified during session creation by the ` SessionOptions::target ` field).
-#### `virtual tensorflow::Session::~Session()` <a class="md-anchor" id="virtual_tensorflow_Session_Session"></a>
+#### `virtual tensorflow::Session::~Session()` {#virtual_tensorflow_Session_Session}
diff --git a/tensorflow/g3doc/api_docs/cc/ClassStatus.md b/tensorflow/g3doc/api_docs/cc/ClassStatus.md
index 3817873181..5730b7606a 100644
--- a/tensorflow/g3doc/api_docs/cc/ClassStatus.md
+++ b/tensorflow/g3doc/api_docs/cc/ClassStatus.md
@@ -1,10 +1,10 @@
-# Class `tensorflow::Status` <a class="md-anchor" id="AUTOGENERATED-class--tensorflow--status-"></a>
+# Class `tensorflow::Status`
-##Member Summary <a class="md-anchor" id="AUTOGENERATED-member-summary"></a>
+##Member Summary
* [`tensorflow::Status::Status()`](#tensorflow_Status_Status)
* Create a success status.
@@ -26,81 +26,81 @@
* Return a string representation of this status suitable for printing. Returns the string `"OK"` for success.
* [`static Status tensorflow::Status::OK()`](#static_Status_tensorflow_Status_OK)
-##Member Details <a class="md-anchor" id="AUTOGENERATED-member-details"></a>
+##Member Details
-#### `tensorflow::Status::Status()` <a class="md-anchor" id="tensorflow_Status_Status"></a>
+#### `tensorflow::Status::Status()` {#tensorflow_Status_Status}
Create a success status.
-#### `tensorflow::Status::~Status()` <a class="md-anchor" id="tensorflow_Status_Status"></a>
+#### `tensorflow::Status::~Status()` {#tensorflow_Status_Status}
-#### `tensorflow::Status::Status(tensorflow::error::Code code, tensorflow::StringPiece msg)` <a class="md-anchor" id="tensorflow_Status_Status"></a>
+#### `tensorflow::Status::Status(tensorflow::error::Code code, tensorflow::StringPiece msg)` {#tensorflow_Status_Status}
Create a status with the specified error code and msg as a human-readable string containing more detailed information.
-#### `tensorflow::Status::Status(const Status &s)` <a class="md-anchor" id="tensorflow_Status_Status"></a>
+#### `tensorflow::Status::Status(const Status &s)` {#tensorflow_Status_Status}
Copy the specified status.
-#### `void tensorflow::Status::operator=(const Status &s)` <a class="md-anchor" id="void_tensorflow_Status_operator_"></a>
+#### `void tensorflow::Status::operator=(const Status &s)` {#void_tensorflow_Status_operator_}
-#### `bool tensorflow::Status::ok() const` <a class="md-anchor" id="bool_tensorflow_Status_ok"></a>
+#### `bool tensorflow::Status::ok() const` {#bool_tensorflow_Status_ok}
Returns true iff the status indicates success.
-#### `tensorflow::error::Code tensorflow::Status::code() const` <a class="md-anchor" id="tensorflow_error_Code_tensorflow_Status_code"></a>
+#### `tensorflow::error::Code tensorflow::Status::code() const` {#tensorflow_error_Code_tensorflow_Status_code}
-#### `const string& tensorflow::Status::error_message() const` <a class="md-anchor" id="const_string_tensorflow_Status_error_message"></a>
+#### `const string& tensorflow::Status::error_message() const` {#const_string_tensorflow_Status_error_message}
-#### `bool tensorflow::Status::operator==(const Status &x) const` <a class="md-anchor" id="bool_tensorflow_Status_operator_"></a>
+#### `bool tensorflow::Status::operator==(const Status &x) const` {#bool_tensorflow_Status_operator_}
-#### `bool tensorflow::Status::operator!=(const Status &x) const` <a class="md-anchor" id="bool_tensorflow_Status_operator_"></a>
+#### `bool tensorflow::Status::operator!=(const Status &x) const` {#bool_tensorflow_Status_operator_}
-#### `void tensorflow::Status::Update(const Status &new_status)` <a class="md-anchor" id="void_tensorflow_Status_Update"></a>
+#### `void tensorflow::Status::Update(const Status &new_status)` {#void_tensorflow_Status_Update}
If ` ok() `, stores `new_status` into `*this`. If `!ok()`, preserves the current status, but may augment with additional information about `new_status`.
Convenient way of keeping track of the first error encountered. Instead of: `if (overall_status.ok()) overall_status = new_status` Use: `overall_status.Update(new_status);`
-#### `string tensorflow::Status::ToString() const` <a class="md-anchor" id="string_tensorflow_Status_ToString"></a>
+#### `string tensorflow::Status::ToString() const` {#string_tensorflow_Status_ToString}
Return a string representation of this status suitable for printing. Returns the string `"OK"` for success.
-#### `static Status tensorflow::Status::OK()` <a class="md-anchor" id="static_Status_tensorflow_Status_OK"></a>
+#### `static Status tensorflow::Status::OK()` {#static_Status_tensorflow_Status_OK}
diff --git a/tensorflow/g3doc/api_docs/cc/ClassTensor.md b/tensorflow/g3doc/api_docs/cc/ClassTensor.md
index 9bc97fe1d7..13627402e9 100644
--- a/tensorflow/g3doc/api_docs/cc/ClassTensor.md
+++ b/tensorflow/g3doc/api_docs/cc/ClassTensor.md
@@ -1,10 +1,10 @@
-# Class `tensorflow::Tensor` <a class="md-anchor" id="AUTOGENERATED-class--tensorflow--tensor-"></a>
+# Class `tensorflow::Tensor`
Represents an n-dimensional array of values.
-##Member Summary <a class="md-anchor" id="AUTOGENERATED-member-summary"></a>
+##Member Summary
* [`tensorflow::Tensor::Tensor()`](#tensorflow_Tensor_Tensor)
* Default Tensor constructor. Creates a 1-dimension, 0-element float tensor.
@@ -76,105 +76,105 @@ Represents an n-dimensional array of values.
* [`StringPiece tensorflow::Tensor::tensor_data() const`](#StringPiece_tensorflow_Tensor_tensor_data)
* Returns a `StringPiece` mapping the current tensor&apos;s buffer.
-##Member Details <a class="md-anchor" id="AUTOGENERATED-member-details"></a>
+##Member Details
-#### `tensorflow::Tensor::Tensor()` <a class="md-anchor" id="tensorflow_Tensor_Tensor"></a>
+#### `tensorflow::Tensor::Tensor()` {#tensorflow_Tensor_Tensor}
Default Tensor constructor. Creates a 1-dimension, 0-element float tensor.
-#### `tensorflow::Tensor::Tensor(DataType type, const TensorShape &shape)` <a class="md-anchor" id="tensorflow_Tensor_Tensor"></a>
+#### `tensorflow::Tensor::Tensor(DataType type, const TensorShape &shape)` {#tensorflow_Tensor_Tensor}
Creates a Tensor of the given `type` and `shape`.
The underlying buffer is allocated using a `CPUAllocator`.
-#### `tensorflow::Tensor::Tensor(Allocator *a, DataType type, const TensorShape &shape)` <a class="md-anchor" id="tensorflow_Tensor_Tensor"></a>
+#### `tensorflow::Tensor::Tensor(Allocator *a, DataType type, const TensorShape &shape)` {#tensorflow_Tensor_Tensor}
Creates a tensor with the input `type` and `shape`, using the allocator `a` to allocate the underlying buffer.
`a` must outlive the lifetime of this Tensor .
-#### `tensorflow::Tensor::Tensor(DataType type)` <a class="md-anchor" id="tensorflow_Tensor_Tensor"></a>
+#### `tensorflow::Tensor::Tensor(DataType type)` {#tensorflow_Tensor_Tensor}
Creates an uninitialized Tensor of the given data type.
-#### `tensorflow::Tensor::Tensor(const Tensor &other)` <a class="md-anchor" id="tensorflow_Tensor_Tensor"></a>
+#### `tensorflow::Tensor::Tensor(const Tensor &other)` {#tensorflow_Tensor_Tensor}
-#### `tensorflow::Tensor::~Tensor()` <a class="md-anchor" id="tensorflow_Tensor_Tensor"></a>
+#### `tensorflow::Tensor::~Tensor()` {#tensorflow_Tensor_Tensor}
Copy constructor.
-#### `DataType tensorflow::Tensor::dtype() const` <a class="md-anchor" id="DataType_tensorflow_Tensor_dtype"></a>
+#### `DataType tensorflow::Tensor::dtype() const` {#DataType_tensorflow_Tensor_dtype}
Returns the data type.
-#### `const TensorShape& tensorflow::Tensor::shape() const` <a class="md-anchor" id="const_TensorShape_tensorflow_Tensor_shape"></a>
+#### `const TensorShape& tensorflow::Tensor::shape() const` {#const_TensorShape_tensorflow_Tensor_shape}
Returns the shape of the tensor.
-#### `int tensorflow::Tensor::dims() const` <a class="md-anchor" id="int_tensorflow_Tensor_dims"></a>
+#### `int tensorflow::Tensor::dims() const` {#int_tensorflow_Tensor_dims}
Convenience accessor for the tensor shape.
For all shape accessors, see comments for relevant methods of ` TensorShape ` in ` tensor_shape.h `.
-#### `int64 tensorflow::Tensor::dim_size(int d) const` <a class="md-anchor" id="int64_tensorflow_Tensor_dim_size"></a>
+#### `int64 tensorflow::Tensor::dim_size(int d) const` {#int64_tensorflow_Tensor_dim_size}
Convenience accessor for the tensor shape.
-#### `int64 tensorflow::Tensor::NumElements() const` <a class="md-anchor" id="int64_tensorflow_Tensor_NumElements"></a>
+#### `int64 tensorflow::Tensor::NumElements() const` {#int64_tensorflow_Tensor_NumElements}
Convenience accessor for the tensor shape.
-#### `bool tensorflow::Tensor::IsSameSize(const Tensor &b) const` <a class="md-anchor" id="bool_tensorflow_Tensor_IsSameSize"></a>
+#### `bool tensorflow::Tensor::IsSameSize(const Tensor &b) const` {#bool_tensorflow_Tensor_IsSameSize}
-#### `bool tensorflow::Tensor::IsInitialized() const` <a class="md-anchor" id="bool_tensorflow_Tensor_IsInitialized"></a>
+#### `bool tensorflow::Tensor::IsInitialized() const` {#bool_tensorflow_Tensor_IsInitialized}
Has this Tensor been initialized?
-#### `size_t tensorflow::Tensor::TotalBytes() const` <a class="md-anchor" id="size_t_tensorflow_Tensor_TotalBytes"></a>
+#### `size_t tensorflow::Tensor::TotalBytes() const` {#size_t_tensorflow_Tensor_TotalBytes}
Returns the estimated memory usage of this tensor.
-#### `Tensor& tensorflow::Tensor::operator=(const Tensor &other)` <a class="md-anchor" id="Tensor_tensorflow_Tensor_operator_"></a>
+#### `Tensor& tensorflow::Tensor::operator=(const Tensor &other)` {#Tensor_tensorflow_Tensor_operator_}
Assign operator. This tensor shares other&apos;s underlying storage.
-#### `bool tensorflow::Tensor::CopyFrom(const Tensor &other, const TensorShape &shape) TF_MUST_USE_RESULT` <a class="md-anchor" id="bool_tensorflow_Tensor_CopyFrom"></a>
+#### `bool tensorflow::Tensor::CopyFrom(const Tensor &other, const TensorShape &shape) TF_MUST_USE_RESULT` {#bool_tensorflow_Tensor_CopyFrom}
Copy the other tensor into this tensor and reshape it.
This tensor shares other&apos;s underlying storage. Returns `true` iff `other.shape()` has the same number of elements of the given `shape`.
-#### `Tensor tensorflow::Tensor::Slice(int64 dim0_start, int64 dim0_limit) const` <a class="md-anchor" id="Tensor_tensorflow_Tensor_Slice"></a>
+#### `Tensor tensorflow::Tensor::Slice(int64 dim0_start, int64 dim0_limit) const` {#Tensor_tensorflow_Tensor_Slice}
Slice this tensor along the 1st dimension.
@@ -184,31 +184,31 @@ NOTE: The returned tensor may not satisfies the same alignment requirement as th
REQUIRES: ` dims() ` >= 1 REQUIRES: `0 <= dim0_start <= dim0_limit <= dim_size(0)`
-#### `bool tensorflow::Tensor::FromProto(const TensorProto &other) TF_MUST_USE_RESULT` <a class="md-anchor" id="bool_tensorflow_Tensor_FromProto"></a>
+#### `bool tensorflow::Tensor::FromProto(const TensorProto &other) TF_MUST_USE_RESULT` {#bool_tensorflow_Tensor_FromProto}
Parse `other` and construct the tensor.
Returns `true` iff the parsing succeeds. If the parsing fails, the state of `*this` is unchanged.
-#### `bool tensorflow::Tensor::FromProto(Allocator *a, const TensorProto &other) TF_MUST_USE_RESULT` <a class="md-anchor" id="bool_tensorflow_Tensor_FromProto"></a>
+#### `bool tensorflow::Tensor::FromProto(Allocator *a, const TensorProto &other) TF_MUST_USE_RESULT` {#bool_tensorflow_Tensor_FromProto}
-#### `void tensorflow::Tensor::AsProtoField(TensorProto *proto) const` <a class="md-anchor" id="void_tensorflow_Tensor_AsProtoField"></a>
+#### `void tensorflow::Tensor::AsProtoField(TensorProto *proto) const` {#void_tensorflow_Tensor_AsProtoField}
Fills in `proto` with `*this` tensor&apos;s content.
` AsProtoField() ` fills in the repeated field for `proto.dtype()`, while `AsProtoTensorContent()` encodes the content in `proto.tensor_content()` in a compact form.
-#### `void tensorflow::Tensor::AsProtoTensorContent(TensorProto *proto) const` <a class="md-anchor" id="void_tensorflow_Tensor_AsProtoTensorContent"></a>
+#### `void tensorflow::Tensor::AsProtoTensorContent(TensorProto *proto) const` {#void_tensorflow_Tensor_AsProtoTensorContent}
-#### `TTypes<T>::Vec tensorflow::Tensor::vec()` <a class="md-anchor" id="TTypes_T_Vec_tensorflow_Tensor_vec"></a>
+#### `TTypes<T>::Vec tensorflow::Tensor::vec()` {#TTypes_T_Vec_tensorflow_Tensor_vec}
Return the tensor data as an `Eigen::Tensor` with the type and sizes of this ` Tensor `.
@@ -226,19 +226,19 @@ auto mat = my_mat.matrix<int32>();// CHECK fails as type mismatch.
```
-#### `TTypes<T>::Matrix tensorflow::Tensor::matrix()` <a class="md-anchor" id="TTypes_T_Matrix_tensorflow_Tensor_matrix"></a>
+#### `TTypes<T>::Matrix tensorflow::Tensor::matrix()` {#TTypes_T_Matrix_tensorflow_Tensor_matrix}
-#### `TTypes< T, NDIMS >::Tensor tensorflow::Tensor::tensor()` <a class="md-anchor" id="TTypes_T_NDIMS_Tensor_tensorflow_Tensor_tensor"></a>
+#### `TTypes< T, NDIMS >::Tensor tensorflow::Tensor::tensor()` {#TTypes_T_NDIMS_Tensor_tensorflow_Tensor_tensor}
-#### `TTypes<T>::Flat tensorflow::Tensor::flat()` <a class="md-anchor" id="TTypes_T_Flat_tensorflow_Tensor_flat"></a>
+#### `TTypes<T>::Flat tensorflow::Tensor::flat()` {#TTypes_T_Flat_tensorflow_Tensor_flat}
Return the tensor data as an `Eigen::Tensor` of the data type and a specified shape.
@@ -263,121 +263,121 @@ auto bad = my_ten.flat<int32>();
```
-#### `TTypes<T>::UnalignedFlat tensorflow::Tensor::unaligned_flat()` <a class="md-anchor" id="TTypes_T_UnalignedFlat_tensorflow_Tensor_unaligned_flat"></a>
+#### `TTypes<T>::UnalignedFlat tensorflow::Tensor::unaligned_flat()` {#TTypes_T_UnalignedFlat_tensorflow_Tensor_unaligned_flat}
-#### `TTypes<T>::Matrix tensorflow::Tensor::flat_inner_dims()` <a class="md-anchor" id="TTypes_T_Matrix_tensorflow_Tensor_flat_inner_dims"></a>
+#### `TTypes<T>::Matrix tensorflow::Tensor::flat_inner_dims()` {#TTypes_T_Matrix_tensorflow_Tensor_flat_inner_dims}
Returns the data as an Eigen::Tensor with 2 dimensions, collapsing all Tensor dimensions but the last one into the first dimension of the result.
-#### `TTypes<T>::Matrix tensorflow::Tensor::flat_outer_dims()` <a class="md-anchor" id="TTypes_T_Matrix_tensorflow_Tensor_flat_outer_dims"></a>
+#### `TTypes<T>::Matrix tensorflow::Tensor::flat_outer_dims()` {#TTypes_T_Matrix_tensorflow_Tensor_flat_outer_dims}
Returns the data as an Eigen::Tensor with 2 dimensions, collapsing all Tensor dimensions but the first one into the last dimension of the result.
-#### `TTypes< T, NDIMS >::Tensor tensorflow::Tensor::shaped(gtl::ArraySlice< int64 > new_sizes)` <a class="md-anchor" id="TTypes_T_NDIMS_Tensor_tensorflow_Tensor_shaped"></a>
+#### `TTypes< T, NDIMS >::Tensor tensorflow::Tensor::shaped(gtl::ArraySlice< int64 > new_sizes)` {#TTypes_T_NDIMS_Tensor_tensorflow_Tensor_shaped}
-#### `TTypes< T, NDIMS >::UnalignedTensor tensorflow::Tensor::unaligned_shaped(gtl::ArraySlice< int64 > new_sizes)` <a class="md-anchor" id="TTypes_T_NDIMS_UnalignedTensor_tensorflow_Tensor_unaligned_shaped"></a>
+#### `TTypes< T, NDIMS >::UnalignedTensor tensorflow::Tensor::unaligned_shaped(gtl::ArraySlice< int64 > new_sizes)` {#TTypes_T_NDIMS_UnalignedTensor_tensorflow_Tensor_unaligned_shaped}
-#### `TTypes< T >::Scalar tensorflow::Tensor::scalar()` <a class="md-anchor" id="TTypes_T_Scalar_tensorflow_Tensor_scalar"></a>
+#### `TTypes< T >::Scalar tensorflow::Tensor::scalar()` {#TTypes_T_Scalar_tensorflow_Tensor_scalar}
Return the Tensor data as a `TensorMap` of fixed size 1: `TensorMap<TensorFixedSize<T, 1>>`.
Using ` scalar() ` allows the compiler to perform optimizations as the size of the tensor is known at compile time.
-#### `TTypes<T>::ConstVec tensorflow::Tensor::vec() const` <a class="md-anchor" id="TTypes_T_ConstVec_tensorflow_Tensor_vec"></a>
+#### `TTypes<T>::ConstVec tensorflow::Tensor::vec() const` {#TTypes_T_ConstVec_tensorflow_Tensor_vec}
Const versions of all the methods above.
-#### `TTypes<T>::ConstMatrix tensorflow::Tensor::matrix() const` <a class="md-anchor" id="TTypes_T_ConstMatrix_tensorflow_Tensor_matrix"></a>
+#### `TTypes<T>::ConstMatrix tensorflow::Tensor::matrix() const` {#TTypes_T_ConstMatrix_tensorflow_Tensor_matrix}
-#### `TTypes< T, NDIMS >::ConstTensor tensorflow::Tensor::tensor() const` <a class="md-anchor" id="TTypes_T_NDIMS_ConstTensor_tensorflow_Tensor_tensor"></a>
+#### `TTypes< T, NDIMS >::ConstTensor tensorflow::Tensor::tensor() const` {#TTypes_T_NDIMS_ConstTensor_tensorflow_Tensor_tensor}
-#### `TTypes<T>::ConstFlat tensorflow::Tensor::flat() const` <a class="md-anchor" id="TTypes_T_ConstFlat_tensorflow_Tensor_flat"></a>
+#### `TTypes<T>::ConstFlat tensorflow::Tensor::flat() const` {#TTypes_T_ConstFlat_tensorflow_Tensor_flat}
-#### `TTypes<T>::UnalignedConstFlat tensorflow::Tensor::unaligned_flat() const` <a class="md-anchor" id="TTypes_T_UnalignedConstFlat_tensorflow_Tensor_unaligned_flat"></a>
+#### `TTypes<T>::UnalignedConstFlat tensorflow::Tensor::unaligned_flat() const` {#TTypes_T_UnalignedConstFlat_tensorflow_Tensor_unaligned_flat}
-#### `TTypes<T>::ConstMatrix tensorflow::Tensor::flat_inner_dims() const` <a class="md-anchor" id="TTypes_T_ConstMatrix_tensorflow_Tensor_flat_inner_dims"></a>
+#### `TTypes<T>::ConstMatrix tensorflow::Tensor::flat_inner_dims() const` {#TTypes_T_ConstMatrix_tensorflow_Tensor_flat_inner_dims}
-#### `TTypes<T>::ConstMatrix tensorflow::Tensor::flat_outer_dims() const` <a class="md-anchor" id="TTypes_T_ConstMatrix_tensorflow_Tensor_flat_outer_dims"></a>
+#### `TTypes<T>::ConstMatrix tensorflow::Tensor::flat_outer_dims() const` {#TTypes_T_ConstMatrix_tensorflow_Tensor_flat_outer_dims}
-#### `TTypes< T, NDIMS >::ConstTensor tensorflow::Tensor::shaped(gtl::ArraySlice< int64 > new_sizes) const` <a class="md-anchor" id="TTypes_T_NDIMS_ConstTensor_tensorflow_Tensor_shaped"></a>
+#### `TTypes< T, NDIMS >::ConstTensor tensorflow::Tensor::shaped(gtl::ArraySlice< int64 > new_sizes) const` {#TTypes_T_NDIMS_ConstTensor_tensorflow_Tensor_shaped}
-#### `TTypes< T, NDIMS >::UnalignedConstTensor tensorflow::Tensor::unaligned_shaped(gtl::ArraySlice< int64 > new_sizes) const` <a class="md-anchor" id="TTypes_T_NDIMS_UnalignedConstTensor_tensorflow_Tensor_unaligned_shaped"></a>
+#### `TTypes< T, NDIMS >::UnalignedConstTensor tensorflow::Tensor::unaligned_shaped(gtl::ArraySlice< int64 > new_sizes) const` {#TTypes_T_NDIMS_UnalignedConstTensor_tensorflow_Tensor_unaligned_shaped}
-#### `TTypes< T >::ConstScalar tensorflow::Tensor::scalar() const` <a class="md-anchor" id="TTypes_T_ConstScalar_tensorflow_Tensor_scalar"></a>
+#### `TTypes< T >::ConstScalar tensorflow::Tensor::scalar() const` {#TTypes_T_ConstScalar_tensorflow_Tensor_scalar}
-#### `string tensorflow::Tensor::SummarizeValue(int64 max_entries) const` <a class="md-anchor" id="string_tensorflow_Tensor_SummarizeValue"></a>
+#### `string tensorflow::Tensor::SummarizeValue(int64 max_entries) const` {#string_tensorflow_Tensor_SummarizeValue}
Render the first `max_entries` values in `*this` into a string.
-#### `string tensorflow::Tensor::DebugString() const` <a class="md-anchor" id="string_tensorflow_Tensor_DebugString"></a>
+#### `string tensorflow::Tensor::DebugString() const` {#string_tensorflow_Tensor_DebugString}
A human-readable summary of the tensor suitable for debugging.
-#### `void tensorflow::Tensor::FillDescription(TensorDescription *description) const` <a class="md-anchor" id="void_tensorflow_Tensor_FillDescription"></a>
+#### `void tensorflow::Tensor::FillDescription(TensorDescription *description) const` {#void_tensorflow_Tensor_FillDescription}
Fill in the `TensorDescription` proto with metadata about the tensor that is useful for monitoring and debugging.
-#### `StringPiece tensorflow::Tensor::tensor_data() const` <a class="md-anchor" id="StringPiece_tensorflow_Tensor_tensor_data"></a>
+#### `StringPiece tensorflow::Tensor::tensor_data() const` {#StringPiece_tensorflow_Tensor_tensor_data}
Returns a `StringPiece` mapping the current tensor&apos;s buffer.
diff --git a/tensorflow/g3doc/api_docs/cc/ClassTensorShape.md b/tensorflow/g3doc/api_docs/cc/ClassTensorShape.md
index d0abee31b1..2850da0cca 100644
--- a/tensorflow/g3doc/api_docs/cc/ClassTensorShape.md
+++ b/tensorflow/g3doc/api_docs/cc/ClassTensorShape.md
@@ -1,10 +1,10 @@
-# Class `tensorflow::TensorShape` <a class="md-anchor" id="AUTOGENERATED-class--tensorflow--tensorshape-"></a>
+# Class `tensorflow::TensorShape`
Manages the dimensions of a Tensor and their sizes.
-##Member Summary <a class="md-anchor" id="AUTOGENERATED-member-summary"></a>
+##Member Summary
* [`tensorflow::TensorShape::TensorShape(gtl::ArraySlice< int64 > dim_sizes)`](#tensorflow_TensorShape_TensorShape)
* Construct a ` TensorShape ` from the provided sizes. REQUIRES: `dim_sizes[i] >= 0`
@@ -48,147 +48,147 @@ Manages the dimensions of a Tensor and their sizes.
* [`static bool tensorflow::TensorShape::IsValid(const TensorShapeProto &proto)`](#static_bool_tensorflow_TensorShape_IsValid)
* Returns `true` iff `proto` is a valid tensor shape.
-##Member Details <a class="md-anchor" id="AUTOGENERATED-member-details"></a>
+##Member Details
-#### `tensorflow::TensorShape::TensorShape(gtl::ArraySlice< int64 > dim_sizes)` <a class="md-anchor" id="tensorflow_TensorShape_TensorShape"></a>
+#### `tensorflow::TensorShape::TensorShape(gtl::ArraySlice< int64 > dim_sizes)` {#tensorflow_TensorShape_TensorShape}
Construct a ` TensorShape ` from the provided sizes. REQUIRES: `dim_sizes[i] >= 0`
-#### `tensorflow::TensorShape::TensorShape(std::initializer_list< int64 > dim_sizes)` <a class="md-anchor" id="tensorflow_TensorShape_TensorShape"></a>
+#### `tensorflow::TensorShape::TensorShape(std::initializer_list< int64 > dim_sizes)` {#tensorflow_TensorShape_TensorShape}
-#### `tensorflow::TensorShape::TensorShape(const TensorShapeProto &proto)` <a class="md-anchor" id="tensorflow_TensorShape_TensorShape"></a>
+#### `tensorflow::TensorShape::TensorShape(const TensorShapeProto &proto)` {#tensorflow_TensorShape_TensorShape}
REQUIRES: `IsValid(proto)`
-#### `tensorflow::TensorShape::TensorShape()` <a class="md-anchor" id="tensorflow_TensorShape_TensorShape"></a>
+#### `tensorflow::TensorShape::TensorShape()` {#tensorflow_TensorShape_TensorShape}
Create a tensor shape with no dimensions and one element, which you can then call ` AddDim() ` on.
-#### `void tensorflow::TensorShape::Clear()` <a class="md-anchor" id="void_tensorflow_TensorShape_Clear"></a>
+#### `void tensorflow::TensorShape::Clear()` {#void_tensorflow_TensorShape_Clear}
Clear a tensor shape.
-#### `void tensorflow::TensorShape::AddDim(int64 size)` <a class="md-anchor" id="void_tensorflow_TensorShape_AddDim"></a>
+#### `void tensorflow::TensorShape::AddDim(int64 size)` {#void_tensorflow_TensorShape_AddDim}
Add a dimension to the end ("inner-most"). REQUIRES: `size >= 0`
-#### `void tensorflow::TensorShape::AppendShape(const TensorShape &shape)` <a class="md-anchor" id="void_tensorflow_TensorShape_AppendShape"></a>
+#### `void tensorflow::TensorShape::AppendShape(const TensorShape &shape)` {#void_tensorflow_TensorShape_AppendShape}
Appends all the dimensions from `shape`.
-#### `void tensorflow::TensorShape::InsertDim(int d, int64 size)` <a class="md-anchor" id="void_tensorflow_TensorShape_InsertDim"></a>
+#### `void tensorflow::TensorShape::InsertDim(int d, int64 size)` {#void_tensorflow_TensorShape_InsertDim}
Insert a dimension somewhere in the ` TensorShape `. REQUIRES: `0 <= d <= dims() ` REQUIRES: `size >= 0`
-#### `void tensorflow::TensorShape::set_dim(int d, int64 size)` <a class="md-anchor" id="void_tensorflow_TensorShape_set_dim"></a>
+#### `void tensorflow::TensorShape::set_dim(int d, int64 size)` {#void_tensorflow_TensorShape_set_dim}
Modifies the size of the dimension `d` to be `size` REQUIRES: `0 <= d < dims() ` REQUIRES: `size >= 0`
-#### `void tensorflow::TensorShape::RemoveDim(int d)` <a class="md-anchor" id="void_tensorflow_TensorShape_RemoveDim"></a>
+#### `void tensorflow::TensorShape::RemoveDim(int d)` {#void_tensorflow_TensorShape_RemoveDim}
Removes dimension `d` from the ` TensorShape `. REQUIRES: `0 <= d < dims() `
-#### `int tensorflow::TensorShape::dims() const` <a class="md-anchor" id="int_tensorflow_TensorShape_dims"></a>
+#### `int tensorflow::TensorShape::dims() const` {#int_tensorflow_TensorShape_dims}
Return the number of dimensions in the tensor.
-#### `int64 tensorflow::TensorShape::dim_size(int d) const` <a class="md-anchor" id="int64_tensorflow_TensorShape_dim_size"></a>
+#### `int64 tensorflow::TensorShape::dim_size(int d) const` {#int64_tensorflow_TensorShape_dim_size}
Returns the number of elements in dimension `d`. REQUIRES: `0 <= d < dims() `
-#### `gtl::ArraySlice<int64> tensorflow::TensorShape::dim_sizes() const` <a class="md-anchor" id="gtl_ArraySlice_int64_tensorflow_TensorShape_dim_sizes"></a>
+#### `gtl::ArraySlice<int64> tensorflow::TensorShape::dim_sizes() const` {#gtl_ArraySlice_int64_tensorflow_TensorShape_dim_sizes}
Returns sizes of all dimensions.
-#### `int64 tensorflow::TensorShape::num_elements() const` <a class="md-anchor" id="int64_tensorflow_TensorShape_num_elements"></a>
+#### `int64 tensorflow::TensorShape::num_elements() const` {#int64_tensorflow_TensorShape_num_elements}
Returns the number of elements in the tensor.
We use `int64` and not `size_t` to be compatible with `Eigen::Tensor` which uses `ptrdiff_t`.
-#### `bool tensorflow::TensorShape::IsSameSize(const TensorShape &b) const` <a class="md-anchor" id="bool_tensorflow_TensorShape_IsSameSize"></a>
+#### `bool tensorflow::TensorShape::IsSameSize(const TensorShape &b) const` {#bool_tensorflow_TensorShape_IsSameSize}
Returns true if `*this` and `b` have the same sizes. Ignores dimension names.
-#### `bool tensorflow::TensorShape::operator==(const TensorShape &b) const` <a class="md-anchor" id="bool_tensorflow_TensorShape_operator_"></a>
+#### `bool tensorflow::TensorShape::operator==(const TensorShape &b) const` {#bool_tensorflow_TensorShape_operator_}
-#### `void tensorflow::TensorShape::AsProto(TensorShapeProto *proto) const` <a class="md-anchor" id="void_tensorflow_TensorShape_AsProto"></a>
+#### `void tensorflow::TensorShape::AsProto(TensorShapeProto *proto) const` {#void_tensorflow_TensorShape_AsProto}
Fill `*proto` from `*this`.
-#### `Eigen::DSizes< Eigen::DenseIndex, NDIMS > tensorflow::TensorShape::AsEigenDSizes() const` <a class="md-anchor" id="Eigen_DSizes_Eigen_DenseIndex_NDIMS_tensorflow_TensorShape_AsEigenDSizes"></a>
+#### `Eigen::DSizes< Eigen::DenseIndex, NDIMS > tensorflow::TensorShape::AsEigenDSizes() const` {#Eigen_DSizes_Eigen_DenseIndex_NDIMS_tensorflow_TensorShape_AsEigenDSizes}
Fill `*dsizes` from `*this`.
-#### `Eigen::DSizes< Eigen::DenseIndex, NDIMS > tensorflow::TensorShape::AsEigenDSizesWithPadding() const` <a class="md-anchor" id="Eigen_DSizes_Eigen_DenseIndex_NDIMS_tensorflow_TensorShape_AsEigenDSizesWithPadding"></a>
+#### `Eigen::DSizes< Eigen::DenseIndex, NDIMS > tensorflow::TensorShape::AsEigenDSizesWithPadding() const` {#Eigen_DSizes_Eigen_DenseIndex_NDIMS_tensorflow_TensorShape_AsEigenDSizesWithPadding}
Same as ` AsEigenDSizes() ` but allows for `NDIMS > dims() ` in which case we pad the rest of the sizes with 1.
-#### `TensorShapeIter tensorflow::TensorShape::begin() const` <a class="md-anchor" id="TensorShapeIter_tensorflow_TensorShape_begin"></a>
+#### `TensorShapeIter tensorflow::TensorShape::begin() const` {#TensorShapeIter_tensorflow_TensorShape_begin}
For iterating through the dimensions.
-#### `TensorShapeIter tensorflow::TensorShape::end() const` <a class="md-anchor" id="TensorShapeIter_tensorflow_TensorShape_end"></a>
+#### `TensorShapeIter tensorflow::TensorShape::end() const` {#TensorShapeIter_tensorflow_TensorShape_end}
-#### `string tensorflow::TensorShape::DebugString() const` <a class="md-anchor" id="string_tensorflow_TensorShape_DebugString"></a>
+#### `string tensorflow::TensorShape::DebugString() const` {#string_tensorflow_TensorShape_DebugString}
For error messages.
-#### `string tensorflow::TensorShape::ShortDebugString() const` <a class="md-anchor" id="string_tensorflow_TensorShape_ShortDebugString"></a>
+#### `string tensorflow::TensorShape::ShortDebugString() const` {#string_tensorflow_TensorShape_ShortDebugString}
-#### `static bool tensorflow::TensorShape::IsValid(const TensorShapeProto &proto)` <a class="md-anchor" id="static_bool_tensorflow_TensorShape_IsValid"></a>
+#### `static bool tensorflow::TensorShape::IsValid(const TensorShapeProto &proto)` {#static_bool_tensorflow_TensorShape_IsValid}
Returns `true` iff `proto` is a valid tensor shape.
diff --git a/tensorflow/g3doc/api_docs/cc/ClassTensorShapeUtils.md b/tensorflow/g3doc/api_docs/cc/ClassTensorShapeUtils.md
index 115b3a1759..4bd57fb5ed 100644
--- a/tensorflow/g3doc/api_docs/cc/ClassTensorShapeUtils.md
+++ b/tensorflow/g3doc/api_docs/cc/ClassTensorShapeUtils.md
@@ -1,10 +1,10 @@
-# Class `tensorflow::TensorShapeUtils` <a class="md-anchor" id="AUTOGENERATED-class--tensorflow--tensorshapeutils-"></a>
+# Class `tensorflow::TensorShapeUtils`
Static helper routines for ` TensorShape `. Includes a few common predicates on a tensor shape.
-##Member Summary <a class="md-anchor" id="AUTOGENERATED-member-summary"></a>
+##Member Summary
* [`static bool tensorflow::TensorShapeUtils::IsScalar(const TensorShape &shape)`](#static_bool_tensorflow_TensorShapeUtils_IsScalar)
* [`static bool tensorflow::TensorShapeUtils::IsVector(const TensorShape &shape)`](#static_bool_tensorflow_TensorShapeUtils_IsVector)
@@ -18,63 +18,63 @@ Static helper routines for ` TensorShape `. Includes a few common predicates on
* [`static string tensorflow::TensorShapeUtils::ShapeListString(const gtl::ArraySlice< TensorShape > &shapes)`](#static_string_tensorflow_TensorShapeUtils_ShapeListString)
* [`static bool tensorflow::TensorShapeUtils::StartsWith(const TensorShape &shape0, const TensorShape &shape1)`](#static_bool_tensorflow_TensorShapeUtils_StartsWith)
-##Member Details <a class="md-anchor" id="AUTOGENERATED-member-details"></a>
+##Member Details
-#### `static bool tensorflow::TensorShapeUtils::IsScalar(const TensorShape &shape)` <a class="md-anchor" id="static_bool_tensorflow_TensorShapeUtils_IsScalar"></a>
+#### `static bool tensorflow::TensorShapeUtils::IsScalar(const TensorShape &shape)` {#static_bool_tensorflow_TensorShapeUtils_IsScalar}
-#### `static bool tensorflow::TensorShapeUtils::IsVector(const TensorShape &shape)` <a class="md-anchor" id="static_bool_tensorflow_TensorShapeUtils_IsVector"></a>
+#### `static bool tensorflow::TensorShapeUtils::IsVector(const TensorShape &shape)` {#static_bool_tensorflow_TensorShapeUtils_IsVector}
-#### `static bool tensorflow::TensorShapeUtils::IsLegacyScalar(const TensorShape &shape)` <a class="md-anchor" id="static_bool_tensorflow_TensorShapeUtils_IsLegacyScalar"></a>
+#### `static bool tensorflow::TensorShapeUtils::IsLegacyScalar(const TensorShape &shape)` {#static_bool_tensorflow_TensorShapeUtils_IsLegacyScalar}
-#### `static bool tensorflow::TensorShapeUtils::IsLegacyVector(const TensorShape &shape)` <a class="md-anchor" id="static_bool_tensorflow_TensorShapeUtils_IsLegacyVector"></a>
+#### `static bool tensorflow::TensorShapeUtils::IsLegacyVector(const TensorShape &shape)` {#static_bool_tensorflow_TensorShapeUtils_IsLegacyVector}
-#### `static bool tensorflow::TensorShapeUtils::IsVectorOrHigher(const TensorShape &shape)` <a class="md-anchor" id="static_bool_tensorflow_TensorShapeUtils_IsVectorOrHigher"></a>
+#### `static bool tensorflow::TensorShapeUtils::IsVectorOrHigher(const TensorShape &shape)` {#static_bool_tensorflow_TensorShapeUtils_IsVectorOrHigher}
-#### `static bool tensorflow::TensorShapeUtils::IsMatrix(const TensorShape &shape)` <a class="md-anchor" id="static_bool_tensorflow_TensorShapeUtils_IsMatrix"></a>
+#### `static bool tensorflow::TensorShapeUtils::IsMatrix(const TensorShape &shape)` {#static_bool_tensorflow_TensorShapeUtils_IsMatrix}
-#### `static bool tensorflow::TensorShapeUtils::IsMatrixOrHigher(const TensorShape &shape)` <a class="md-anchor" id="static_bool_tensorflow_TensorShapeUtils_IsMatrixOrHigher"></a>
+#### `static bool tensorflow::TensorShapeUtils::IsMatrixOrHigher(const TensorShape &shape)` {#static_bool_tensorflow_TensorShapeUtils_IsMatrixOrHigher}
-#### `static TensorShape tensorflow::TensorShapeUtils::MakeShape(const T *dims, int n)` <a class="md-anchor" id="static_TensorShape_tensorflow_TensorShapeUtils_MakeShape"></a>
+#### `static TensorShape tensorflow::TensorShapeUtils::MakeShape(const T *dims, int n)` {#static_TensorShape_tensorflow_TensorShapeUtils_MakeShape}
Returns a ` TensorShape ` whose dimensions are `dims[0]`, `dims[1]`, ..., `dims[n-1]`.
-#### `static string tensorflow::TensorShapeUtils::ShapeListString(const gtl::ArraySlice< TensorShape > &shapes)` <a class="md-anchor" id="static_string_tensorflow_TensorShapeUtils_ShapeListString"></a>
+#### `static string tensorflow::TensorShapeUtils::ShapeListString(const gtl::ArraySlice< TensorShape > &shapes)` {#static_string_tensorflow_TensorShapeUtils_ShapeListString}
-#### `static bool tensorflow::TensorShapeUtils::StartsWith(const TensorShape &shape0, const TensorShape &shape1)` <a class="md-anchor" id="static_bool_tensorflow_TensorShapeUtils_StartsWith"></a>
+#### `static bool tensorflow::TensorShapeUtils::StartsWith(const TensorShape &shape0, const TensorShape &shape1)` {#static_bool_tensorflow_TensorShapeUtils_StartsWith}
diff --git a/tensorflow/g3doc/api_docs/cc/ClassThread.md b/tensorflow/g3doc/api_docs/cc/ClassThread.md
index 118f1eab53..b01168aaca 100644
--- a/tensorflow/g3doc/api_docs/cc/ClassThread.md
+++ b/tensorflow/g3doc/api_docs/cc/ClassThread.md
@@ -1,24 +1,24 @@
-# Class `tensorflow::Thread` <a class="md-anchor" id="AUTOGENERATED-class--tensorflow--thread-"></a>
+# Class `tensorflow::Thread`
-##Member Summary <a class="md-anchor" id="AUTOGENERATED-member-summary"></a>
+##Member Summary
* [`tensorflow::Thread::Thread()`](#tensorflow_Thread_Thread)
* [`virtual tensorflow::Thread::~Thread()`](#virtual_tensorflow_Thread_Thread)
* Blocks until the thread of control stops running.
-##Member Details <a class="md-anchor" id="AUTOGENERATED-member-details"></a>
+##Member Details
-#### `tensorflow::Thread::Thread()` <a class="md-anchor" id="tensorflow_Thread_Thread"></a>
+#### `tensorflow::Thread::Thread()` {#tensorflow_Thread_Thread}
-#### `virtual tensorflow::Thread::~Thread()` <a class="md-anchor" id="virtual_tensorflow_Thread_Thread"></a>
+#### `virtual tensorflow::Thread::~Thread()` {#virtual_tensorflow_Thread_Thread}
Blocks until the thread of control stops running.
diff --git a/tensorflow/g3doc/api_docs/cc/ClassWritableFile.md b/tensorflow/g3doc/api_docs/cc/ClassWritableFile.md
index 075632f91c..83c430c3bf 100644
--- a/tensorflow/g3doc/api_docs/cc/ClassWritableFile.md
+++ b/tensorflow/g3doc/api_docs/cc/ClassWritableFile.md
@@ -1,10 +1,10 @@
-# Class `tensorflow::WritableFile` <a class="md-anchor" id="AUTOGENERATED-class--tensorflow--writablefile-"></a>
+# Class `tensorflow::WritableFile`
A file abstraction for sequential writing.
The implementation must provide buffering since callers may append small fragments at a time to the file.
-##Member Summary <a class="md-anchor" id="AUTOGENERATED-member-summary"></a>
+##Member Summary
* [`tensorflow::WritableFile::WritableFile()`](#tensorflow_WritableFile_WritableFile)
* [`virtual tensorflow::WritableFile::~WritableFile()`](#virtual_tensorflow_WritableFile_WritableFile)
@@ -13,39 +13,39 @@ The implementation must provide buffering since callers may append small fragmen
* [`virtual Status tensorflow::WritableFile::Flush()=0`](#virtual_Status_tensorflow_WritableFile_Flush)
* [`virtual Status tensorflow::WritableFile::Sync()=0`](#virtual_Status_tensorflow_WritableFile_Sync)
-##Member Details <a class="md-anchor" id="AUTOGENERATED-member-details"></a>
+##Member Details
-#### `tensorflow::WritableFile::WritableFile()` <a class="md-anchor" id="tensorflow_WritableFile_WritableFile"></a>
+#### `tensorflow::WritableFile::WritableFile()` {#tensorflow_WritableFile_WritableFile}
-#### `virtual tensorflow::WritableFile::~WritableFile()` <a class="md-anchor" id="virtual_tensorflow_WritableFile_WritableFile"></a>
+#### `virtual tensorflow::WritableFile::~WritableFile()` {#virtual_tensorflow_WritableFile_WritableFile}
-#### `virtual Status tensorflow::WritableFile::Append(const StringPiece &data)=0` <a class="md-anchor" id="virtual_Status_tensorflow_WritableFile_Append"></a>
+#### `virtual Status tensorflow::WritableFile::Append(const StringPiece &data)=0` {#virtual_Status_tensorflow_WritableFile_Append}
-#### `virtual Status tensorflow::WritableFile::Close()=0` <a class="md-anchor" id="virtual_Status_tensorflow_WritableFile_Close"></a>
+#### `virtual Status tensorflow::WritableFile::Close()=0` {#virtual_Status_tensorflow_WritableFile_Close}
-#### `virtual Status tensorflow::WritableFile::Flush()=0` <a class="md-anchor" id="virtual_Status_tensorflow_WritableFile_Flush"></a>
+#### `virtual Status tensorflow::WritableFile::Flush()=0` {#virtual_Status_tensorflow_WritableFile_Flush}
-#### `virtual Status tensorflow::WritableFile::Sync()=0` <a class="md-anchor" id="virtual_Status_tensorflow_WritableFile_Sync"></a>
+#### `virtual Status tensorflow::WritableFile::Sync()=0` {#virtual_Status_tensorflow_WritableFile_Sync}
diff --git a/tensorflow/g3doc/api_docs/cc/StructSessionOptions.md b/tensorflow/g3doc/api_docs/cc/StructSessionOptions.md
index 0643d917fc..10c8204921 100644
--- a/tensorflow/g3doc/api_docs/cc/StructSessionOptions.md
+++ b/tensorflow/g3doc/api_docs/cc/StructSessionOptions.md
@@ -1,10 +1,10 @@
-# Struct `tensorflow::SessionOptions` <a class="md-anchor" id="AUTOGENERATED-struct--tensorflow--sessionoptions-"></a>
+# Struct `tensorflow::SessionOptions`
Configuration information for a Session .
-##Member Summary <a class="md-anchor" id="AUTOGENERATED-member-summary"></a>
+##Member Summary
* [`Env* tensorflow::SessionOptions::env`](#Env_tensorflow_SessionOptions_env)
* The environment to use.
@@ -14,15 +14,15 @@ Configuration information for a Session .
* Configuration options.
* [`tensorflow::SessionOptions::SessionOptions()`](#tensorflow_SessionOptions_SessionOptions)
-##Member Details <a class="md-anchor" id="AUTOGENERATED-member-details"></a>
+##Member Details
-#### `Env* tensorflow::SessionOptions::env` <a class="md-anchor" id="Env_tensorflow_SessionOptions_env"></a>
+#### `Env* tensorflow::SessionOptions::env` {#Env_tensorflow_SessionOptions_env}
The environment to use.
-#### `string tensorflow::SessionOptions::target` <a class="md-anchor" id="string_tensorflow_SessionOptions_target"></a>
+#### `string tensorflow::SessionOptions::target` {#string_tensorflow_SessionOptions_target}
The TensorFlow runtime to connect to.
@@ -36,13 +36,13 @@ Upon creation, a single session affines itself to one of the remote processes, w
If the session disconnects from the remote process during its lifetime, session calls may fail immediately.
-#### `ConfigProto tensorflow::SessionOptions::config` <a class="md-anchor" id="ConfigProto_tensorflow_SessionOptions_config"></a>
+#### `ConfigProto tensorflow::SessionOptions::config` {#ConfigProto_tensorflow_SessionOptions_config}
Configuration options.
-#### `tensorflow::SessionOptions::SessionOptions()` <a class="md-anchor" id="tensorflow_SessionOptions_SessionOptions"></a>
+#### `tensorflow::SessionOptions::SessionOptions()` {#tensorflow_SessionOptions_SessionOptions}
diff --git a/tensorflow/g3doc/api_docs/cc/StructState.md b/tensorflow/g3doc/api_docs/cc/StructState.md
index 8961925cfe..903d03fa97 100644
--- a/tensorflow/g3doc/api_docs/cc/StructState.md
+++ b/tensorflow/g3doc/api_docs/cc/StructState.md
@@ -1,23 +1,23 @@
-# Struct `tensorflow::Status::State` <a class="md-anchor" id="AUTOGENERATED-struct--tensorflow--status--state-"></a>
+# Struct `tensorflow::Status::State`
-##Member Summary <a class="md-anchor" id="AUTOGENERATED-member-summary"></a>
+##Member Summary
* [`tensorflow::error::Code tensorflow::Status::State::code`](#tensorflow_error_Code_tensorflow_Status_State_code)
* [`string tensorflow::Status::State::msg`](#string_tensorflow_Status_State_msg)
-##Member Details <a class="md-anchor" id="AUTOGENERATED-member-details"></a>
+##Member Details
-#### `tensorflow::error::Code tensorflow::Status::State::code` <a class="md-anchor" id="tensorflow_error_Code_tensorflow_Status_State_code"></a>
+#### `tensorflow::error::Code tensorflow::Status::State::code` {#tensorflow_error_Code_tensorflow_Status_State_code}
-#### `string tensorflow::Status::State::msg` <a class="md-anchor" id="string_tensorflow_Status_State_msg"></a>
+#### `string tensorflow::Status::State::msg` {#string_tensorflow_Status_State_msg}
diff --git a/tensorflow/g3doc/api_docs/cc/StructTensorShapeDim.md b/tensorflow/g3doc/api_docs/cc/StructTensorShapeDim.md
index d37948f1dc..b325bc6937 100644
--- a/tensorflow/g3doc/api_docs/cc/StructTensorShapeDim.md
+++ b/tensorflow/g3doc/api_docs/cc/StructTensorShapeDim.md
@@ -1,23 +1,23 @@
-# Struct `tensorflow::TensorShapeDim` <a class="md-anchor" id="AUTOGENERATED-struct--tensorflow--tensorshapedim-"></a>
+# Struct `tensorflow::TensorShapeDim`
-##Member Summary <a class="md-anchor" id="AUTOGENERATED-member-summary"></a>
+##Member Summary
* [`int tensorflow::TensorShapeDim::size`](#int_tensorflow_TensorShapeDim_size)
* [`tensorflow::TensorShapeDim::TensorShapeDim(int64 s)`](#tensorflow_TensorShapeDim_TensorShapeDim)
-##Member Details <a class="md-anchor" id="AUTOGENERATED-member-details"></a>
+##Member Details
-#### `int tensorflow::TensorShapeDim::size` <a class="md-anchor" id="int_tensorflow_TensorShapeDim_size"></a>
+#### `int tensorflow::TensorShapeDim::size` {#int_tensorflow_TensorShapeDim_size}
-#### `tensorflow::TensorShapeDim::TensorShapeDim(int64 s)` <a class="md-anchor" id="tensorflow_TensorShapeDim_TensorShapeDim"></a>
+#### `tensorflow::TensorShapeDim::TensorShapeDim(int64 s)` {#tensorflow_TensorShapeDim_TensorShapeDim}
diff --git a/tensorflow/g3doc/api_docs/cc/StructThreadOptions.md b/tensorflow/g3doc/api_docs/cc/StructThreadOptions.md
index 6a7ee7fd6f..56b501acf8 100644
--- a/tensorflow/g3doc/api_docs/cc/StructThreadOptions.md
+++ b/tensorflow/g3doc/api_docs/cc/StructThreadOptions.md
@@ -1,25 +1,25 @@
-# Struct `tensorflow::ThreadOptions` <a class="md-anchor" id="AUTOGENERATED-struct--tensorflow--threadoptions-"></a>
+# Struct `tensorflow::ThreadOptions`
Options to configure a Thread .
Note that the options are all hints, and the underlying implementation may choose to ignore it.
-##Member Summary <a class="md-anchor" id="AUTOGENERATED-member-summary"></a>
+##Member Summary
* [`size_t tensorflow::ThreadOptions::stack_size`](#size_t_tensorflow_ThreadOptions_stack_size)
* Thread stack size to use (in bytes).
* [`size_t tensorflow::ThreadOptions::guard_size`](#size_t_tensorflow_ThreadOptions_guard_size)
* Guard area size to use near thread stacks to use (in bytes)
-##Member Details <a class="md-anchor" id="AUTOGENERATED-member-details"></a>
+##Member Details
-#### `size_t tensorflow::ThreadOptions::stack_size` <a class="md-anchor" id="size_t_tensorflow_ThreadOptions_stack_size"></a>
+#### `size_t tensorflow::ThreadOptions::stack_size` {#size_t_tensorflow_ThreadOptions_stack_size}
Thread stack size to use (in bytes).
-#### `size_t tensorflow::ThreadOptions::guard_size` <a class="md-anchor" id="size_t_tensorflow_ThreadOptions_guard_size"></a>
+#### `size_t tensorflow::ThreadOptions::guard_size` {#size_t_tensorflow_ThreadOptions_guard_size}
Guard area size to use near thread stacks to use (in bytes)
diff --git a/tensorflow/g3doc/api_docs/cc/index.md b/tensorflow/g3doc/api_docs/cc/index.md
index ddbdd72e16..374fafc372 100644
--- a/tensorflow/g3doc/api_docs/cc/index.md
+++ b/tensorflow/g3doc/api_docs/cc/index.md
@@ -1,4 +1,4 @@
-# TensorFlow C++ Session API reference documentation <a class="md-anchor" id="AUTOGENERATED-tensorflow-c---session-api-reference-documentation"></a>
+# TensorFlow C++ Session API reference documentation
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++:
@@ -23,31 +23,31 @@ write the graph to a file.
1. Run the graph with a call to `session->Run()`
-## Env <a class="md-anchor" id="AUTOGENERATED-env"></a>
+## Env
* [tensorflow::Env](../../api_docs/cc/ClassEnv.md)
* [tensorflow::RandomAccessFile](../../api_docs/cc/ClassRandomAccessFile.md)
* [tensorflow::WritableFile](../../api_docs/cc/ClassWritableFile.md)
* [tensorflow::EnvWrapper](../../api_docs/cc/ClassEnvWrapper.md)
-## Session <a class="md-anchor" id="AUTOGENERATED-session"></a>
+## Session
* [tensorflow::Session](../../api_docs/cc/ClassSession.md)
* [tensorflow::SessionOptions](../../api_docs/cc/StructSessionOptions.md)
-## Status <a class="md-anchor" id="AUTOGENERATED-status"></a>
+## Status
* [tensorflow::Status](../../api_docs/cc/ClassStatus.md)
* [tensorflow::Status::State](../../api_docs/cc/StructState.md)
-## Tensor <a class="md-anchor" id="AUTOGENERATED-tensor"></a>
+## Tensor
* [tensorflow::Tensor](../../api_docs/cc/ClassTensor.md)
* [tensorflow::TensorShape](../../api_docs/cc/ClassTensorShape.md)
* [tensorflow::TensorShapeDim](../../api_docs/cc/StructTensorShapeDim.md)
* [tensorflow::TensorShapeUtils](../../api_docs/cc/ClassTensorShapeUtils.md)
-## Thread <a class="md-anchor" id="AUTOGENERATED-thread"></a>
+## Thread
* [tensorflow::Thread](../../api_docs/cc/ClassThread.md)
* [tensorflow::ThreadOptions](../../api_docs/cc/StructThreadOptions.md)
diff --git a/tensorflow/g3doc/api_docs/index.md b/tensorflow/g3doc/api_docs/index.md
index d6b1b86fcf..7e41a44d7f 100644
--- a/tensorflow/g3doc/api_docs/index.md
+++ b/tensorflow/g3doc/api_docs/index.md
@@ -1,4 +1,4 @@
-# Overview <a class="md-anchor" id="AUTOGENERATED-overview"></a>
+# Overview
TensorFlow has APIs available in several languages both for constructing and
executing a TensorFlow graph. The Python API is at present the most complete
diff --git a/tensorflow/g3doc/api_docs/python/array_ops.md b/tensorflow/g3doc/api_docs/python/array_ops.md
index 1b05a48862..fe92f98ec6 100644
--- a/tensorflow/g3doc/api_docs/python/array_ops.md
+++ b/tensorflow/g3doc/api_docs/python/array_ops.md
@@ -1,61 +1,27 @@
<!-- This file is machine generated: DO NOT EDIT! -->
-# Tensor Transformations <a class="md-anchor" id="AUTOGENERATED-tensor-transformations"></a>
+# Tensor Transformations
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
-### [Tensor Transformations](#AUTOGENERATED-tensor-transformations)
-* [Casting](#AUTOGENERATED-casting)
- * [`tf.string_to_number(string_tensor, out_type=None, name=None)`](#string_to_number)
- * [`tf.to_double(x, name='ToDouble')`](#to_double)
- * [`tf.to_float(x, name='ToFloat')`](#to_float)
- * [`tf.to_bfloat16(x, name='ToBFloat16')`](#to_bfloat16)
- * [`tf.to_int32(x, name='ToInt32')`](#to_int32)
- * [`tf.to_int64(x, name='ToInt64')`](#to_int64)
- * [`tf.cast(x, dtype, name=None)`](#cast)
-* [Shapes and Shaping](#AUTOGENERATED-shapes-and-shaping)
- * [`tf.shape(input, name=None)`](#shape)
- * [`tf.size(input, name=None)`](#size)
- * [`tf.rank(input, name=None)`](#rank)
- * [`tf.reshape(tensor, shape, name=None)`](#reshape)
- * [`tf.squeeze(input, squeeze_dims=None, name=None)`](#squeeze)
- * [`tf.expand_dims(input, dim, name=None)`](#expand_dims)
-* [Slicing and Joining](#AUTOGENERATED-slicing-and-joining)
- * [`tf.slice(input_, begin, size, name=None)`](#slice)
- * [`tf.split(split_dim, num_split, value, name='split')`](#split)
- * [`tf.tile(input, multiples, name=None)`](#tile)
- * [`tf.pad(input, paddings, name=None)`](#pad)
- * [`tf.concat(concat_dim, values, name='concat')`](#concat)
- * [`tf.pack(values, name='pack')`](#pack)
- * [`tf.unpack(value, num=None, name='unpack')`](#unpack)
- * [`tf.reverse_sequence(input, seq_lengths, seq_dim, name=None)`](#reverse_sequence)
- * [`tf.reverse(tensor, dims, name=None)`](#reverse)
- * [`tf.transpose(a, perm=None, name='transpose')`](#transpose)
- * [`tf.gather(params, indices, name=None)`](#gather)
- * [`tf.dynamic_partition(data, partitions, num_partitions, name=None)`](#dynamic_partition)
- * [`tf.dynamic_stitch(indices, data, name=None)`](#dynamic_stitch)
-
-
-<!-- TOC-END This section was generated by neural network, THANKS FOR READING! -->
-
-## Casting <a class="md-anchor" id="AUTOGENERATED-casting"></a>
+[TOC]
+
+## Casting
TensorFlow provides several operations that you can use to cast tensor data
types in your graph.
- - -
-### `tf.string_to_number(string_tensor, out_type=None, name=None)` <a class="md-anchor" id="string_to_number"></a>
+### `tf.string_to_number(string_tensor, out_type=None, name=None)` {#string_to_number}
Converts each string in the input Tensor to the specified numeric type.
(Note that int32 overflow results in an error while float overflow
results in a rounded value.)
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`string_tensor`</b>: A `Tensor` of type `string`.
@@ -63,7 +29,7 @@ results in a rounded value.)
The numeric type to interpret each string in string_tensor as.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` of type `out_type`.
A Tensor of the same shape as the input string_tensor.
@@ -71,21 +37,21 @@ results in a rounded value.)
- - -
-### `tf.to_double(x, name='ToDouble')` <a class="md-anchor" id="to_double"></a>
+### `tf.to_double(x, name='ToDouble')` {#to_double}
Casts a tensor to type `float64`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor` or `SparseTensor`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` or `SparseTensor` with same shape as `x` with type `float64`.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`TypeError`</b>: If `x` cannot be cast to the `float64`.
@@ -93,21 +59,21 @@ Casts a tensor to type `float64`.
- - -
-### `tf.to_float(x, name='ToFloat')` <a class="md-anchor" id="to_float"></a>
+### `tf.to_float(x, name='ToFloat')` {#to_float}
Casts a tensor to type `float32`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor` or `SparseTensor`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` or `SparseTensor` with same shape as `x` with type `float32`.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`TypeError`</b>: If `x` cannot be cast to the `float32`.
@@ -115,21 +81,21 @@ Casts a tensor to type `float32`.
- - -
-### `tf.to_bfloat16(x, name='ToBFloat16')` <a class="md-anchor" id="to_bfloat16"></a>
+### `tf.to_bfloat16(x, name='ToBFloat16')` {#to_bfloat16}
Casts a tensor to type `bfloat16`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor` or `SparseTensor`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` or `SparseTensor` with same shape as `x` with type `bfloat16`.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`TypeError`</b>: If `x` cannot be cast to the `bfloat16`.
@@ -137,21 +103,21 @@ Casts a tensor to type `bfloat16`.
- - -
-### `tf.to_int32(x, name='ToInt32')` <a class="md-anchor" id="to_int32"></a>
+### `tf.to_int32(x, name='ToInt32')` {#to_int32}
Casts a tensor to type `int32`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor` or `SparseTensor`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` or `SparseTensor` with same shape as `x` with type `int32`.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`TypeError`</b>: If `x` cannot be cast to the `int32`.
@@ -159,21 +125,21 @@ Casts a tensor to type `int32`.
- - -
-### `tf.to_int64(x, name='ToInt64')` <a class="md-anchor" id="to_int64"></a>
+### `tf.to_int64(x, name='ToInt64')` {#to_int64}
Casts a tensor to type `int64`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor` or `SparseTensor`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` or `SparseTensor` with same shape as `x` with type `int64`.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`TypeError`</b>: If `x` cannot be cast to the `int64`.
@@ -181,7 +147,7 @@ Casts a tensor to type `int64`.
- - -
-### `tf.cast(x, dtype, name=None)` <a class="md-anchor" id="cast"></a>
+### `tf.cast(x, dtype, name=None)` {#cast}
Casts a tensor to a new type.
@@ -195,32 +161,32 @@ For example:
tf.cast(a, tf.int32) ==> [1, 2] # dtype=tf.int32
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor` or `SparseTensor`.
* <b>`dtype`</b>: The destination type.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` or `SparseTensor` with same shape as `x`.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`TypeError`</b>: If `x` cannot be cast to the `dtype`.
-## Shapes and Shaping <a class="md-anchor" id="AUTOGENERATED-shapes-and-shaping"></a>
+## Shapes and Shaping
TensorFlow provides several operations that you can use to determine the shape
of a tensor and change the shape of a tensor.
- - -
-### `tf.shape(input, name=None)` <a class="md-anchor" id="shape"></a>
+### `tf.shape(input, name=None)` {#shape}
Returns the shape of a tensor.
@@ -233,20 +199,20 @@ For example:
shape(t) ==> [2, 2, 3]
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`input`</b>: A `Tensor`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` of type `int32`.
- - -
-### `tf.size(input, name=None)` <a class="md-anchor" id="size"></a>
+### `tf.size(input, name=None)` {#size}
Returns the size of a tensor.
@@ -260,20 +226,20 @@ For example:
size(t) ==> 12
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`input`</b>: A `Tensor`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` of type `int32`.
- - -
-### `tf.rank(input, name=None)` <a class="md-anchor" id="rank"></a>
+### `tf.rank(input, name=None)` {#rank}
Returns the rank of a tensor.
@@ -291,20 +257,20 @@ rank(t) ==> 3
of a tensor is the number of indices required to uniquely select each element
of the tensor. Rank is also known as "order", "degree", or "ndims."
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`input`</b>: A `Tensor`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` of type `int32`.
- - -
-### `tf.reshape(tensor, shape, name=None)` <a class="md-anchor" id="reshape"></a>
+### `tf.reshape(tensor, shape, name=None)` {#reshape}
Reshapes a tensor.
@@ -344,21 +310,21 @@ reshape(t, [2, 4]) ==> [[1, 1, 2, 2]
reshape(t, [-1]) ==> [1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6]
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`tensor`</b>: A `Tensor`.
* <b>`shape`</b>: A `Tensor` of type `int32`. Defines the shape of the output tensor.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `tensor`.
- - -
-### `tf.squeeze(input, squeeze_dims=None, name=None)` <a class="md-anchor" id="squeeze"></a>
+### `tf.squeeze(input, squeeze_dims=None, name=None)` {#squeeze}
Removes dimensions of size 1 from the shape of a tensor.
@@ -381,7 +347,7 @@ Or, to remove specific size 1 dimensions:
shape(squeeze(t, [2, 4])) ==> [1, 2, 3, 1]
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`input`</b>: A `Tensor`. The `input` to squeeze.
@@ -390,7 +356,7 @@ shape(squeeze(t, [2, 4])) ==> [1, 2, 3, 1]
index starts at 0. It is an error to squeeze a dimension that is not 1.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `input`.
Contains the same data as `input`, but has one or more dimensions of
@@ -399,7 +365,7 @@ shape(squeeze(t, [2, 4])) ==> [1, 2, 3, 1]
- - -
-### `tf.expand_dims(input, dim, name=None)` <a class="md-anchor" id="expand_dims"></a>
+### `tf.expand_dims(input, dim, name=None)` {#expand_dims}
Inserts a dimension of 1 into a tensor's shape.
@@ -434,7 +400,7 @@ This operation requires that:
This operation is related to `squeeze()`, which removes dimensions of
size 1.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`input`</b>: A `Tensor`.
@@ -443,7 +409,7 @@ size 1.
expand the shape of `input`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `input`.
Contains the same data as `input`, but its shape has an additional
@@ -451,14 +417,14 @@ size 1.
-## Slicing and Joining <a class="md-anchor" id="AUTOGENERATED-slicing-and-joining"></a>
+## Slicing and Joining
TensorFlow provides several operations to slice or extract parts of a tensor,
or join multiple tensors together.
- - -
-### `tf.slice(input_, begin, size, name=None)` <a class="md-anchor" id="slice"></a>
+### `tf.slice(input_, begin, size, name=None)` {#slice}
Extracts a slice from a tensor.
@@ -493,7 +459,7 @@ tf.slice(input, [1, 0, 0], [2, 1, 3]) ==> [[[3, 3, 3]],
[[5, 5, 5]]]
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`input_`</b>: A `Tensor`.
@@ -501,14 +467,14 @@ tf.slice(input, [1, 0, 0], [2, 1, 3]) ==> [[[3, 3, 3]],
* <b>`size`</b>: An `int32` or `int64` `Tensor`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` the same type as `input`.
- - -
-### `tf.split(split_dim, num_split, value, name='split')` <a class="md-anchor" id="split"></a>
+### `tf.split(split_dim, num_split, value, name='split')` {#split}
Splits a tensor into `num_split` tensors along one dimension.
@@ -524,7 +490,7 @@ split0, split1, split2 = tf.split(1, 3, value)
tf.shape(split0) ==> [5, 10]
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`split_dim`</b>: A 0-D `int32` `Tensor`. The dimension along which to split.
@@ -533,14 +499,14 @@ tf.shape(split0) ==> [5, 10]
* <b>`value`</b>: The `Tensor` to split.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
`num_split` `Tensor` objects resulting from splitting `value`.
- - -
-### `tf.tile(input, multiples, name=None)` <a class="md-anchor" id="tile"></a>
+### `tf.tile(input, multiples, name=None)` {#tile}
Constructs a tensor by tiling a given tensor.
@@ -550,7 +516,7 @@ and the values of `input` are replicated `multiples[i]` times along the 'i'th
dimension. For example, tiling `[a b c d]` by `[2]` produces
`[a b c d a b c d]`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`input`</b>: A `Tensor`. 1-D or higher.
@@ -558,14 +524,14 @@ dimension. For example, tiling `[a b c d]` by `[2]` produces
1-D. Length must be the same as the number of dimensions in `input`
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `input`.
- - -
-### `tf.pad(input, paddings, name=None)` <a class="md-anchor" id="pad"></a>
+### `tf.pad(input, paddings, name=None)` {#pad}
Pads a tensor with zeros.
@@ -593,21 +559,21 @@ pad(t, paddings) ==> [[0, 0, 0, 0, 0]
[0, 0, 0, 0, 0]]
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`input`</b>: A `Tensor`.
* <b>`paddings`</b>: A `Tensor` of type `int32`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `input`.
- - -
-### `tf.concat(concat_dim, values, name='concat')` <a class="md-anchor" id="concat"></a>
+### `tf.concat(concat_dim, values, name='concat')` {#concat}
Concatenates tensors along one dimension.
@@ -641,21 +607,21 @@ tf.shape(tf.concat(0, [t3, t4])) ==> [4, 3]
tf.shape(tf.concat(1, [t3, t4])) ==> [2, 6]
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`concat_dim`</b>: 0-D `int32` `Tensor`. Dimension along which to concatenate.
* <b>`values`</b>: A list of `Tensor` objects or a single `Tensor`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` resulting from concatenation of the input tensors.
- - -
-### `tf.pack(values, name='pack')` <a class="md-anchor" id="pack"></a>
+### `tf.pack(values, name='pack')` {#pack}
Packs a list of rank-`R` tensors into one rank-`(R+1)` tensor.
@@ -667,13 +633,13 @@ This is the opposite of unpack. The numpy equivalent is
tf.pack([x, y, z]) = np.asarray([x, y, z])
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`values`</b>: A list of `Tensor` objects with the same shape and type.
* <b>`name`</b>: A name for this operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
* <b>`output`</b>: A packed `Tensor` with the same type as `values`.
@@ -681,7 +647,7 @@ This is the opposite of unpack. The numpy equivalent is
- - -
-### `tf.unpack(value, num=None, name='unpack')` <a class="md-anchor" id="unpack"></a>
+### `tf.unpack(value, num=None, name='unpack')` {#unpack}
Unpacks the outer dimension of a rank-`R` tensor into rank-`(R-1)` tensors.
@@ -696,7 +662,7 @@ This is the opposite of pack. The numpy equivalent is
tf.unpack(x, n) = list(x)
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`value`</b>: A rank `R > 0` `Tensor` to be unpacked.
@@ -704,11 +670,11 @@ This is the opposite of pack. The numpy equivalent is
`None` (the default).
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
The list of `Tensor` objects unpacked from `value`.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`ValueError`</b>: If `num` is unspecified and cannot be inferred.
@@ -716,7 +682,7 @@ This is the opposite of pack. The numpy equivalent is
- - -
-### `tf.reverse_sequence(input, seq_lengths, seq_dim, name=None)` <a class="md-anchor" id="reverse_sequence"></a>
+### `tf.reverse_sequence(input, seq_lengths, seq_dim, name=None)` {#reverse_sequence}
Reverses variable length slices in dimension `seq_dim`.
@@ -750,7 +716,7 @@ output[2, 3:, :, ...] = input[2, 3:, :, ...]
output[3, 2:, :, ...] = input[3, 2:, :, ...]
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`input`</b>: A `Tensor`. The input to reverse.
@@ -760,7 +726,7 @@ output[3, 2:, :, ...] = input[3, 2:, :, ...]
* <b>`seq_dim`</b>: An `int`. The dimension which is partially reversed.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `input`.
The partially reversed input. It has the same shape as `input`.
@@ -768,7 +734,7 @@ output[3, 2:, :, ...] = input[3, 2:, :, ...]
- - -
-### `tf.reverse(tensor, dims, name=None)` <a class="md-anchor" id="reverse"></a>
+### `tf.reverse(tensor, dims, name=None)` {#reverse}
Reverses specific dimensions of a tensor.
@@ -817,7 +783,7 @@ reverse(t, dims) ==> [[[[8, 9, 10, 11],
[12, 13, 14, 15]]]]
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`tensor`</b>: A `Tensor`. Must be one of the following types: `uint8`, `int8`, `int32`, `bool`, `float32`, `float64`.
@@ -825,14 +791,14 @@ reverse(t, dims) ==> [[[[8, 9, 10, 11],
* <b>`dims`</b>: A `Tensor` of type `bool`. 1-D. The dimensions to reverse.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `tensor`. The same shape as `tensor`.
- - -
-### `tf.transpose(a, perm=None, name='transpose')` <a class="md-anchor" id="transpose"></a>
+### `tf.transpose(a, perm=None, name='transpose')` {#transpose}
Transposes `a`. Permutes the dimensions according to `perm`.
@@ -870,21 +836,21 @@ tf.transpose(b, perm=[0, 2, 1]) ==> [[[1 4]
[9 12]]]
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`a`</b>: A `Tensor`.
* <b>`perm`</b>: A permutation of the dimensions of `a`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A transposed `Tensor`.
- - -
-### `tf.gather(params, indices, name=None)` <a class="md-anchor" id="gather"></a>
+### `tf.gather(params, indices, name=None)` {#gather}
Gather slices from `params` according to `indices`.
@@ -907,21 +873,21 @@ this operation will permute `params` accordingly.
<img style="width:100%" src="../images/Gather.png" alt>
</div>
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`params`</b>: A `Tensor`.
* <b>`indices`</b>: A `Tensor`. Must be one of the following types: `int32`, `int64`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `params`.
- - -
-### `tf.dynamic_partition(data, partitions, num_partitions, name=None)` <a class="md-anchor" id="dynamic_partition"></a>
+### `tf.dynamic_partition(data, partitions, num_partitions, name=None)` {#dynamic_partition}
Partitions `data` into `num_partitions` tensors using indices from `partitions`.
@@ -957,7 +923,7 @@ For example:
<img style="width:100%" src="../images/DynamicPartition.png" alt>
</div>
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`data`</b>: A `Tensor`.
@@ -967,14 +933,14 @@ For example:
The number of partitions to output.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A list of `num_partitions` `Tensor` objects of the same type as data.
- - -
-### `tf.dynamic_stitch(indices, data, name=None)` <a class="md-anchor" id="dynamic_stitch"></a>
+### `tf.dynamic_stitch(indices, data, name=None)` {#dynamic_stitch}
Interleave the values from the `data` tensors into a single tensor.
@@ -1016,14 +982,14 @@ For example:
<img style="width:100%" src="../images/DynamicStitch.png" alt>
</div>
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`indices`</b>: A list of at least 2 `Tensor` objects of type `int32`.
* <b>`data`</b>: A list with the same number of `Tensor` objects as `indices` of `Tensor` objects of the same type.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `data`.
diff --git a/tensorflow/g3doc/api_docs/python/client.md b/tensorflow/g3doc/api_docs/python/client.md
index 7f781f7106..ce074e6bcd 100644
--- a/tensorflow/g3doc/api_docs/python/client.md
+++ b/tensorflow/g3doc/api_docs/python/client.md
@@ -1,45 +1,18 @@
<!-- This file is machine generated: DO NOT EDIT! -->
-# Running Graphs <a class="md-anchor" id="AUTOGENERATED-running-graphs"></a>
-<!-- TOC-BEGIN This section is generated by neural network: DO NOT EDIT! -->
-## Contents
-### [Running Graphs](#AUTOGENERATED-running-graphs)
-* [Session management](#AUTOGENERATED-session-management)
- * [`class tf.Session`](#Session)
- * [`class tf.InteractiveSession`](#InteractiveSession)
- * [`tf.get_default_session()`](#get_default_session)
-* [Error classes](#AUTOGENERATED-error-classes)
- * [`class tf.OpError`](#OpError)
- * [`class tf.errors.CancelledError`](#CancelledError)
- * [`class tf.errors.UnknownError`](#UnknownError)
- * [`class tf.errors.InvalidArgumentError`](#InvalidArgumentError)
- * [`class tf.errors.DeadlineExceededError`](#DeadlineExceededError)
- * [`class tf.errors.NotFoundError`](#NotFoundError)
- * [`class tf.errors.AlreadyExistsError`](#AlreadyExistsError)
- * [`class tf.errors.PermissionDeniedError`](#PermissionDeniedError)
- * [`class tf.errors.UnauthenticatedError`](#UnauthenticatedError)
- * [`class tf.errors.ResourceExhaustedError`](#ResourceExhaustedError)
- * [`class tf.errors.FailedPreconditionError`](#FailedPreconditionError)
- * [`class tf.errors.AbortedError`](#AbortedError)
- * [`class tf.errors.OutOfRangeError`](#OutOfRangeError)
- * [`class tf.errors.UnimplementedError`](#UnimplementedError)
- * [`class tf.errors.InternalError`](#InternalError)
- * [`class tf.errors.UnavailableError`](#UnavailableError)
- * [`class tf.errors.DataLossError`](#DataLossError)
-
-
-<!-- TOC-END This section was generated by neural network, THANKS FOR READING! -->
+# Running Graphs
+[TOC]
This library contains classes for launching graphs and executing operations.
The [basic usage](../../get_started/index.md#basic-usage) guide has
examples of how a graph is launched in a [`tf.Session`](#Session).
-## Session management <a class="md-anchor" id="AUTOGENERATED-session-management"></a>
+## Session management
- - -
-### `class tf.Session` <a class="md-anchor" id="Session"></a>
+### `class tf.Session` {#Session}
A class for running TensorFlow operations.
@@ -95,7 +68,7 @@ sess = tf.Session(config=tf.ConfigProto(allow_soft_placement=True,
- - -
-#### `tf.Session.__init__(target='', graph=None, config=None)` <a class="md-anchor" id="Session.__init__"></a>
+#### `tf.Session.__init__(target='', graph=None, config=None)` {#Session.__init__}
Creates a new TensorFlow session.
@@ -107,7 +80,7 @@ but each graph can be used in multiple sessions. In this case, it
is often clearer to pass the graph to be launched explicitly to
the session constructor.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`target`</b>: (Optional.) The execution engine to connect to.
@@ -120,7 +93,7 @@ the session constructor.
- - -
-#### `tf.Session.run(fetches, feed_dict=None)` <a class="md-anchor" id="Session.run"></a>
+#### `tf.Session.run(fetches, feed_dict=None)` {#Session.run}
Runs the operations and evaluates the tensors in `fetches`.
@@ -160,7 +133,7 @@ one of the following types:
the value should be a
[`SparseTensorValue`](../../api_docs/python/sparse_ops.md#SparseTensorValue).
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`fetches`</b>: A single graph element, or a list of graph elements
@@ -168,12 +141,12 @@ one of the following types:
* <b>`feed_dict`</b>: A dictionary that maps graph elements to values
(described above).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
Either a single value if `fetches` is a single graph element, or
a list of values if `fetches` is a list (described above).
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`RuntimeError`</b>: If this `Session` is in an invalid state (e.g. has been
@@ -185,13 +158,13 @@ one of the following types:
- - -
-#### `tf.Session.close()` <a class="md-anchor" id="Session.close"></a>
+#### `tf.Session.close()` {#Session.close}
Closes this session.
Calling this method frees all resources associated with the session.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`RuntimeError`</b>: If an error occurs while closing the session.
@@ -200,14 +173,14 @@ Calling this method frees all resources associated with the session.
- - -
-#### `tf.Session.graph` <a class="md-anchor" id="Session.graph"></a>
+#### `tf.Session.graph` {#Session.graph}
The graph that was launched in this session.
- - -
-#### `tf.Session.as_default()` <a class="md-anchor" id="Session.as_default"></a>
+#### `tf.Session.as_default()` {#Session.as_default}
Returns a context manager that makes this object the default session.
@@ -254,7 +227,7 @@ create a new thread, and wish to use the default session in that
thread, you must explicitly add a `with sess.as_default():` in that
thread's function.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A context manager using this session as the default session.
@@ -262,7 +235,7 @@ thread's function.
- - -
-### `class tf.InteractiveSession` <a class="md-anchor" id="InteractiveSession"></a>
+### `class tf.InteractiveSession` {#InteractiveSession}
A TensorFlow `Session` for use in interactive contexts, such as a shell.
@@ -303,7 +276,7 @@ with tf.Session():
- - -
-#### `tf.InteractiveSession.__init__(target='', graph=None)` <a class="md-anchor" id="InteractiveSession.__init__"></a>
+#### `tf.InteractiveSession.__init__(target='', graph=None)` {#InteractiveSession.__init__}
Creates a new interactive TensorFlow session.
@@ -315,7 +288,7 @@ but each graph can be used in multiple sessions. In this case, it
is often clearer to pass the graph to be launched explicitly to
the session constructor.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`target`</b>: (Optional.) The execution engine to connect to.
@@ -326,7 +299,7 @@ the session constructor.
- - -
-#### `tf.InteractiveSession.close()` <a class="md-anchor" id="InteractiveSession.close"></a>
+#### `tf.InteractiveSession.close()` {#InteractiveSession.close}
Closes an `InteractiveSession`.
@@ -335,7 +308,7 @@ Closes an `InteractiveSession`.
- - -
-### `tf.get_default_session()` <a class="md-anchor" id="get_default_session"></a>
+### `tf.get_default_session()` {#get_default_session}
Returns the default session for the current thread.
@@ -347,17 +320,17 @@ create a new thread, and wish to use the default session in that
thread, you must explicitly add a `with sess.as_default():` in that
thread's function.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
The default `Session` being used in the current thread.
-## Error classes <a class="md-anchor" id="AUTOGENERATED-error-classes"></a>
+## Error classes
- - -
-### `class tf.OpError` <a class="md-anchor" id="OpError"></a>
+### `class tf.OpError` {#OpError}
A generic error that is raised when TensorFlow execution fails.
@@ -366,7 +339,7 @@ of `OpError` from the `tf.errors` module.
- - -
-#### `tf.OpError.op` <a class="md-anchor" id="OpError.op"></a>
+#### `tf.OpError.op` {#OpError.op}
The operation that failed, if known.
@@ -377,25 +350,25 @@ will return `None`, and you should instead use the
[`OpError.node_def`](#OpError.node_def) to discover information about the
op.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
The `Operation` that failed, or None.
- - -
-#### `tf.OpError.node_def` <a class="md-anchor" id="OpError.node_def"></a>
+#### `tf.OpError.node_def` {#OpError.node_def}
The `NodeDef` proto representing the op that failed.
-#### Other Methods <a class="md-anchor" id="AUTOGENERATED-other-methods"></a>
+#### Other Methods
- - -
-#### `tf.OpError.__init__(node_def, op, message, error_code)` <a class="md-anchor" id="OpError.__init__"></a>
+#### `tf.OpError.__init__(node_def, op, message, error_code)` {#OpError.__init__}
Creates a new OpError indicating that a particular op failed.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`node_def`</b>: The graph_pb2.NodeDef proto representing the op that failed.
@@ -406,20 +379,20 @@ Creates a new OpError indicating that a particular op failed.
- - -
-#### `tf.OpError.error_code` <a class="md-anchor" id="OpError.error_code"></a>
+#### `tf.OpError.error_code` {#OpError.error_code}
The integer error code that describes the error.
- - -
-#### `tf.OpError.message` <a class="md-anchor" id="OpError.message"></a>
+#### `tf.OpError.message` {#OpError.message}
The error message that describes the error.
- - -
-### `class tf.errors.CancelledError` <a class="md-anchor" id="CancelledError"></a>
+### `class tf.errors.CancelledError` {#CancelledError}
Raised when an operation or step is cancelled.
@@ -433,7 +406,7 @@ A step that is running such a long-running operation will fail by raising
- - -
-#### `tf.errors.CancelledError.__init__(node_def, op, message)` <a class="md-anchor" id="CancelledError.__init__"></a>
+#### `tf.errors.CancelledError.__init__(node_def, op, message)` {#CancelledError.__init__}
Creates a `CancelledError`.
@@ -441,7 +414,7 @@ Creates a `CancelledError`.
- - -
-### `class tf.errors.UnknownError` <a class="md-anchor" id="UnknownError"></a>
+### `class tf.errors.UnknownError` {#UnknownError}
Unknown error.
@@ -453,7 +426,7 @@ error.
- - -
-#### `tf.errors.UnknownError.__init__(node_def, op, message, error_code=2)` <a class="md-anchor" id="UnknownError.__init__"></a>
+#### `tf.errors.UnknownError.__init__(node_def, op, message, error_code=2)` {#UnknownError.__init__}
Creates an `UnknownError`.
@@ -461,7 +434,7 @@ Creates an `UnknownError`.
- - -
-### `class tf.errors.InvalidArgumentError` <a class="md-anchor" id="InvalidArgumentError"></a>
+### `class tf.errors.InvalidArgumentError` {#InvalidArgumentError}
Raised when an operation receives an invalid argument.
@@ -475,7 +448,7 @@ tensor.
- - -
-#### `tf.errors.InvalidArgumentError.__init__(node_def, op, message)` <a class="md-anchor" id="InvalidArgumentError.__init__"></a>
+#### `tf.errors.InvalidArgumentError.__init__(node_def, op, message)` {#InvalidArgumentError.__init__}
Creates an `InvalidArgumentError`.
@@ -483,7 +456,7 @@ Creates an `InvalidArgumentError`.
- - -
-### `class tf.errors.DeadlineExceededError` <a class="md-anchor" id="DeadlineExceededError"></a>
+### `class tf.errors.DeadlineExceededError` {#DeadlineExceededError}
Raised when a deadline expires before an operation could complete.
@@ -491,7 +464,7 @@ This exception is not currently used.
- - -
-#### `tf.errors.DeadlineExceededError.__init__(node_def, op, message)` <a class="md-anchor" id="DeadlineExceededError.__init__"></a>
+#### `tf.errors.DeadlineExceededError.__init__(node_def, op, message)` {#DeadlineExceededError.__init__}
Creates a `DeadlineExceededError`.
@@ -499,7 +472,7 @@ Creates a `DeadlineExceededError`.
- - -
-### `class tf.errors.NotFoundError` <a class="md-anchor" id="NotFoundError"></a>
+### `class tf.errors.NotFoundError` {#NotFoundError}
Raised when a requested entity (e.g., a file or directory) was not found.
@@ -510,7 +483,7 @@ does not exist.
- - -
-#### `tf.errors.NotFoundError.__init__(node_def, op, message)` <a class="md-anchor" id="NotFoundError.__init__"></a>
+#### `tf.errors.NotFoundError.__init__(node_def, op, message)` {#NotFoundError.__init__}
Creates a `NotFoundError`.
@@ -518,7 +491,7 @@ Creates a `NotFoundError`.
- - -
-### `class tf.errors.AlreadyExistsError` <a class="md-anchor" id="AlreadyExistsError"></a>
+### `class tf.errors.AlreadyExistsError` {#AlreadyExistsError}
Raised when an entity that we attempted to create already exists.
@@ -529,7 +502,7 @@ existing file was passed.
- - -
-#### `tf.errors.AlreadyExistsError.__init__(node_def, op, message)` <a class="md-anchor" id="AlreadyExistsError.__init__"></a>
+#### `tf.errors.AlreadyExistsError.__init__(node_def, op, message)` {#AlreadyExistsError.__init__}
Creates an `AlreadyExistsError`.
@@ -537,7 +510,7 @@ Creates an `AlreadyExistsError`.
- - -
-### `class tf.errors.PermissionDeniedError` <a class="md-anchor" id="PermissionDeniedError"></a>
+### `class tf.errors.PermissionDeniedError` {#PermissionDeniedError}
Raised when the caller does not have permission to run an operation.
@@ -548,7 +521,7 @@ file for which the user does not have the read file permission.
- - -
-#### `tf.errors.PermissionDeniedError.__init__(node_def, op, message)` <a class="md-anchor" id="PermissionDeniedError.__init__"></a>
+#### `tf.errors.PermissionDeniedError.__init__(node_def, op, message)` {#PermissionDeniedError.__init__}
Creates a `PermissionDeniedError`.
@@ -556,7 +529,7 @@ Creates a `PermissionDeniedError`.
- - -
-### `class tf.errors.UnauthenticatedError` <a class="md-anchor" id="UnauthenticatedError"></a>
+### `class tf.errors.UnauthenticatedError` {#UnauthenticatedError}
The request does not have valid authentication credentials.
@@ -564,7 +537,7 @@ This exception is not currently used.
- - -
-#### `tf.errors.UnauthenticatedError.__init__(node_def, op, message)` <a class="md-anchor" id="UnauthenticatedError.__init__"></a>
+#### `tf.errors.UnauthenticatedError.__init__(node_def, op, message)` {#UnauthenticatedError.__init__}
Creates an `UnauthenticatedError`.
@@ -572,7 +545,7 @@ Creates an `UnauthenticatedError`.
- - -
-### `class tf.errors.ResourceExhaustedError` <a class="md-anchor" id="ResourceExhaustedError"></a>
+### `class tf.errors.ResourceExhaustedError` {#ResourceExhaustedError}
Some resource has been exhausted.
@@ -581,7 +554,7 @@ exhausted, or perhaps the entire file system is out of space.
- - -
-#### `tf.errors.ResourceExhaustedError.__init__(node_def, op, message)` <a class="md-anchor" id="ResourceExhaustedError.__init__"></a>
+#### `tf.errors.ResourceExhaustedError.__init__(node_def, op, message)` {#ResourceExhaustedError.__init__}
Creates a `ResourceExhaustedError`.
@@ -589,7 +562,7 @@ Creates a `ResourceExhaustedError`.
- - -
-### `class tf.errors.FailedPreconditionError` <a class="md-anchor" id="FailedPreconditionError"></a>
+### `class tf.errors.FailedPreconditionError` {#FailedPreconditionError}
Operation was rejected because the system is not in a state to execute it.
@@ -599,7 +572,7 @@ before it has been initialized.
- - -
-#### `tf.errors.FailedPreconditionError.__init__(node_def, op, message)` <a class="md-anchor" id="FailedPreconditionError.__init__"></a>
+#### `tf.errors.FailedPreconditionError.__init__(node_def, op, message)` {#FailedPreconditionError.__init__}
Creates a `FailedPreconditionError`.
@@ -607,7 +580,7 @@ Creates a `FailedPreconditionError`.
- - -
-### `class tf.errors.AbortedError` <a class="md-anchor" id="AbortedError"></a>
+### `class tf.errors.AbortedError` {#AbortedError}
The operation was aborted, typically due to a concurrent action.
@@ -619,7 +592,7 @@ previously ran.
- - -
-#### `tf.errors.AbortedError.__init__(node_def, op, message)` <a class="md-anchor" id="AbortedError.__init__"></a>
+#### `tf.errors.AbortedError.__init__(node_def, op, message)` {#AbortedError.__init__}
Creates an `AbortedError`.
@@ -627,7 +600,7 @@ Creates an `AbortedError`.
- - -
-### `class tf.errors.OutOfRangeError` <a class="md-anchor" id="OutOfRangeError"></a>
+### `class tf.errors.OutOfRangeError` {#OutOfRangeError}
Raised when an operation executed past the valid range.
@@ -639,7 +612,7 @@ operation executes.
- - -
-#### `tf.errors.OutOfRangeError.__init__(node_def, op, message)` <a class="md-anchor" id="OutOfRangeError.__init__"></a>
+#### `tf.errors.OutOfRangeError.__init__(node_def, op, message)` {#OutOfRangeError.__init__}
Creates an `OutOfRangeError`.
@@ -647,7 +620,7 @@ Creates an `OutOfRangeError`.
- - -
-### `class tf.errors.UnimplementedError` <a class="md-anchor" id="UnimplementedError"></a>
+### `class tf.errors.UnimplementedError` {#UnimplementedError}
Raised when an operation has not been implemented.
@@ -659,7 +632,7 @@ because this is not yet supported.
- - -
-#### `tf.errors.UnimplementedError.__init__(node_def, op, message)` <a class="md-anchor" id="UnimplementedError.__init__"></a>
+#### `tf.errors.UnimplementedError.__init__(node_def, op, message)` {#UnimplementedError.__init__}
Creates an `UnimplementedError`.
@@ -667,7 +640,7 @@ Creates an `UnimplementedError`.
- - -
-### `class tf.errors.InternalError` <a class="md-anchor" id="InternalError"></a>
+### `class tf.errors.InternalError` {#InternalError}
Raised when the system experiences an internal error.
@@ -676,7 +649,7 @@ has been broken. Catching this exception is not recommended.
- - -
-#### `tf.errors.InternalError.__init__(node_def, op, message)` <a class="md-anchor" id="InternalError.__init__"></a>
+#### `tf.errors.InternalError.__init__(node_def, op, message)` {#InternalError.__init__}
Creates an `InternalError`.
@@ -684,7 +657,7 @@ Creates an `InternalError`.
- - -
-### `class tf.errors.UnavailableError` <a class="md-anchor" id="UnavailableError"></a>
+### `class tf.errors.UnavailableError` {#UnavailableError}
Raised when the runtime is currently unavailable.
@@ -692,7 +665,7 @@ This exception is not currently used.
- - -
-#### `tf.errors.UnavailableError.__init__(node_def, op, message)` <a class="md-anchor" id="UnavailableError.__init__"></a>
+#### `tf.errors.UnavailableError.__init__(node_def, op, message)` {#UnavailableError.__init__}
Creates an `UnavailableError`.
@@ -700,7 +673,7 @@ Creates an `UnavailableError`.
- - -
-### `class tf.errors.DataLossError` <a class="md-anchor" id="DataLossError"></a>
+### `class tf.errors.DataLossError` {#DataLossError}
Raised when unrecoverable data loss or corruption is encountered.
@@ -710,7 +683,7 @@ operation, if the file is truncated while it is being read.
- - -
-#### `tf.errors.DataLossError.__init__(node_def, op, message)` <a class="md-anchor" id="DataLossError.__init__"></a>
+#### `tf.errors.DataLossError.__init__(node_def, op, message)` {#DataLossError.__init__}
Creates a `DataLossError`.
diff --git a/tensorflow/g3doc/api_docs/python/constant_op.md b/tensorflow/g3doc/api_docs/python/constant_op.md
index 0e3abf6676..13aa64aef7 100644
--- a/tensorflow/g3doc/api_docs/python/constant_op.md
+++ b/tensorflow/g3doc/api_docs/python/constant_op.md
@@ -1,41 +1,19 @@
<!-- This file is machine generated: DO NOT EDIT! -->
-# Constants, Sequences, and Random Values <a class="md-anchor" id="AUTOGENERATED-constants--sequences--and-random-values"></a>
+# Constants, Sequences, and Random Values
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
-### [Constants, Sequences, and Random Values](#AUTOGENERATED-constants--sequences--and-random-values)
-* [Constant Value Tensors](#AUTOGENERATED-constant-value-tensors)
- * [`tf.zeros(shape, dtype=tf.float32, name=None)`](#zeros)
- * [`tf.zeros_like(tensor, dtype=None, name=None)`](#zeros_like)
- * [`tf.ones(shape, dtype=tf.float32, name=None)`](#ones)
- * [`tf.ones_like(tensor, dtype=None, name=None)`](#ones_like)
- * [`tf.fill(dims, value, name=None)`](#fill)
- * [`tf.constant(value, dtype=None, shape=None, name='Const')`](#constant)
-* [Sequences](#AUTOGENERATED-sequences)
- * [`tf.linspace(start, stop, num, name=None)`](#linspace)
- * [`tf.range(start, limit=None, delta=1, name='range')`](#range)
-* [Random Tensors](#AUTOGENERATED-random-tensors)
- * [Examples:](#AUTOGENERATED-examples-)
- * [`tf.random_normal(shape, mean=0.0, stddev=1.0, dtype=tf.float32, seed=None, name=None)`](#random_normal)
- * [`tf.truncated_normal(shape, mean=0.0, stddev=1.0, dtype=tf.float32, seed=None, name=None)`](#truncated_normal)
- * [`tf.random_uniform(shape, minval=0.0, maxval=1.0, dtype=tf.float32, seed=None, name=None)`](#random_uniform)
- * [`tf.random_shuffle(value, seed=None, name=None)`](#random_shuffle)
- * [`tf.set_random_seed(seed)`](#set_random_seed)
-
-
-<!-- TOC-END This section was generated by neural network, THANKS FOR READING! -->
-
-## Constant Value Tensors <a class="md-anchor" id="AUTOGENERATED-constant-value-tensors"></a>
+[TOC]
+
+## Constant Value Tensors
TensorFlow provides several operations that you can use to generate constants.
- - -
-### `tf.zeros(shape, dtype=tf.float32, name=None)` <a class="md-anchor" id="zeros"></a>
+### `tf.zeros(shape, dtype=tf.float32, name=None)` {#zeros}
Creates a tensor with all elements set to zero.
@@ -48,21 +26,21 @@ For example:
tf.zeros([3, 4], int32) ==> [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`shape`</b>: Either a list of integers, or a 1-D `Tensor` of type `int32`.
* <b>`dtype`</b>: The type of an element in the resulting `Tensor`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` with all elements set to zero.
- - -
-### `tf.zeros_like(tensor, dtype=None, name=None)` <a class="md-anchor" id="zeros_like"></a>
+### `tf.zeros_like(tensor, dtype=None, name=None)` {#zeros_like}
Creates a tensor with all elements set to zero.
@@ -77,7 +55,7 @@ For example:
tf.zeros_like(tensor) ==> [[0, 0, 0], [0, 0, 0]]
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`tensor`</b>: A `Tensor`.
@@ -86,7 +64,7 @@ tf.zeros_like(tensor) ==> [[0, 0, 0], [0, 0, 0]]
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` with all elements set to zero.
@@ -94,7 +72,7 @@ tf.zeros_like(tensor) ==> [[0, 0, 0], [0, 0, 0]]
- - -
-### `tf.ones(shape, dtype=tf.float32, name=None)` <a class="md-anchor" id="ones"></a>
+### `tf.ones(shape, dtype=tf.float32, name=None)` {#ones}
Creates a tensor with all elements set to 1.
@@ -107,21 +85,21 @@ For example:
tf.ones([2, 3], int32) ==> [[1, 1, 1], [1, 1, 1]]
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`shape`</b>: Either a list of integers, or a 1-D `Tensor` of type `int32`.
* <b>`dtype`</b>: The type of an element in the resulting `Tensor`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` with all elements set to 1.
- - -
-### `tf.ones_like(tensor, dtype=None, name=None)` <a class="md-anchor" id="ones_like"></a>
+### `tf.ones_like(tensor, dtype=None, name=None)` {#ones_like}
Creates a tensor with all elements set to 1.
@@ -136,7 +114,7 @@ For example:
tf.ones_like(tensor) ==> [[1, 1, 1], [1, 1, 1]]
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`tensor`</b>: A `Tensor`.
@@ -145,7 +123,7 @@ tf.ones_like(tensor) ==> [[1, 1, 1], [1, 1, 1]]
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` with all elements set to 1.
@@ -153,7 +131,7 @@ tf.ones_like(tensor) ==> [[1, 1, 1], [1, 1, 1]]
- - -
-### `tf.fill(dims, value, name=None)` <a class="md-anchor" id="fill"></a>
+### `tf.fill(dims, value, name=None)` {#fill}
Creates a tensor filled with a scalar value.
@@ -168,7 +146,7 @@ fill(dims, 9) ==> [[9, 9, 9]
[9, 9, 9]]
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`dims`</b>: A `Tensor` of type `int32`.
@@ -176,7 +154,7 @@ fill(dims, 9) ==> [[9, 9, 9]
* <b>`value`</b>: A `Tensor`. 0-D (scalar). Value to fill the returned tensor.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `value`.
@@ -184,7 +162,7 @@ fill(dims, 9) ==> [[9, 9, 9]
- - -
-### `tf.constant(value, dtype=None, shape=None, name='Const')` <a class="md-anchor" id="constant"></a>
+### `tf.constant(value, dtype=None, shape=None, name='Const')` {#constant}
Creates a constant tensor.
@@ -217,7 +195,7 @@ Creates a constant tensor.
[-1. -1. -1.]]
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`value`</b>: A constant value (or list) of output type `dtype`.
@@ -231,17 +209,17 @@ Creates a constant tensor.
* <b>`name`</b>: Optional name for the tensor.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A Constant Tensor.
-## Sequences <a class="md-anchor" id="AUTOGENERATED-sequences"></a>
+## Sequences
- - -
-### `tf.linspace(start, stop, num, name=None)` <a class="md-anchor" id="linspace"></a>
+### `tf.linspace(start, stop, num, name=None)` {#linspace}
Generates values in an interval.
@@ -255,7 +233,7 @@ For example:
tf.linspace(10.0, 12.0, 3, name="linspace") => [ 10.0 11.0 12.0]
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`start`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`.
@@ -265,7 +243,7 @@ tf.linspace(10.0, 12.0, 3, name="linspace") => [ 10.0 11.0 12.0]
* <b>`num`</b>: A `Tensor` of type `int32`. Number of values to generate.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `start`. 1-D. The generated values.
@@ -273,7 +251,7 @@ tf.linspace(10.0, 12.0, 3, name="linspace") => [ 10.0 11.0 12.0]
- - -
-### `tf.range(start, limit=None, delta=1, name='range')` <a class="md-anchor" id="range"></a>
+### `tf.range(start, limit=None, delta=1, name='range')` {#range}
Creates a sequence of integers.
@@ -295,7 +273,7 @@ tf.range(start, limit, delta) ==> [3, 6, 9, 12, 15]
tf.range(limit) ==> [0, 1, 2, 3, 4]
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`start`</b>: A 0-D (scalar) of type `int32`. First entry in sequence.
@@ -306,13 +284,13 @@ tf.range(limit) ==> [0, 1, 2, 3, 4]
Number that increments `start`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
An 1-D `int32` `Tensor`.
-## Random Tensors <a class="md-anchor" id="AUTOGENERATED-random-tensors"></a>
+## Random Tensors
TensorFlow has several ops that create random tensors with different
distributions. The random ops are stateful, and create new random values each
@@ -328,7 +306,7 @@ See [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for details on the interaction between operation-level and graph-level random
seeds.
-### Examples: <a class="md-anchor" id="AUTOGENERATED-examples-"></a>
+### Examples:
```python
# Create a tensor of shape [2, 3] consisting of random normal values, with mean
@@ -368,11 +346,11 @@ print sess.run(var)
- - -
-### `tf.random_normal(shape, mean=0.0, stddev=1.0, dtype=tf.float32, seed=None, name=None)` <a class="md-anchor" id="random_normal"></a>
+### `tf.random_normal(shape, mean=0.0, stddev=1.0, dtype=tf.float32, seed=None, name=None)` {#random_normal}
Outputs random values from a normal distribution.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`shape`</b>: A 1-D integer Tensor or Python array. The shape of the output tensor.
@@ -387,14 +365,14 @@ Outputs random values from a normal distribution.
for behavior.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A tensor of the specified shape filled with random normal values.
- - -
-### `tf.truncated_normal(shape, mean=0.0, stddev=1.0, dtype=tf.float32, seed=None, name=None)` <a class="md-anchor" id="truncated_normal"></a>
+### `tf.truncated_normal(shape, mean=0.0, stddev=1.0, dtype=tf.float32, seed=None, name=None)` {#truncated_normal}
Outputs random values from a truncated normal distribution.
@@ -402,7 +380,7 @@ The generated values follow a normal distribution with specified mean and
standard deviation, except that values whose magnitude is more than 2 standard
deviations from the mean are dropped and re-picked.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`shape`</b>: A 1-D integer Tensor or Python array. The shape of the output tensor.
@@ -417,14 +395,14 @@ deviations from the mean are dropped and re-picked.
for behavior.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A tensor of the specified shape filled with random truncated normal values.
- - -
-### `tf.random_uniform(shape, minval=0.0, maxval=1.0, dtype=tf.float32, seed=None, name=None)` <a class="md-anchor" id="random_uniform"></a>
+### `tf.random_uniform(shape, minval=0.0, maxval=1.0, dtype=tf.float32, seed=None, name=None)` {#random_uniform}
Outputs random values from a uniform distribution.
@@ -432,7 +410,7 @@ The generated values follow a uniform distribution in the range
`[minval, maxval)`. The lower bound `minval` is included in the range, while
the upper bound `maxval` is excluded.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`shape`</b>: A 1-D integer Tensor or Python array. The shape of the output tensor.
@@ -447,14 +425,14 @@ the upper bound `maxval` is excluded.
for behavior.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A tensor of the specified shape filled with random uniform values.
- - -
-### `tf.random_shuffle(value, seed=None, name=None)` <a class="md-anchor" id="random_shuffle"></a>
+### `tf.random_shuffle(value, seed=None, name=None)` {#random_shuffle}
Randomly shuffles a tensor along its first dimension.
@@ -468,7 +446,7 @@ to one and only one `output[i]`. For example, a mapping that might occur for a
[5, 6]] [3, 4]]
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`value`</b>: A Tensor to be shuffled.
@@ -478,7 +456,7 @@ to one and only one `output[i]`. For example, a mapping that might occur for a
for behavior.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A tensor of same shape and type as `value`, shuffled along its first
dimension.
@@ -486,7 +464,7 @@ to one and only one `output[i]`. For example, a mapping that might occur for a
- - -
-### `tf.set_random_seed(seed)` <a class="md-anchor" id="set_random_seed"></a>
+### `tf.set_random_seed(seed)` {#set_random_seed}
Sets the graph-level random seed.
@@ -579,7 +557,7 @@ with tf.Session() as sess2:
print sess2.run(b) # generates 'B2'
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`seed`</b>: integer.
diff --git a/tensorflow/g3doc/api_docs/python/control_flow_ops.md b/tensorflow/g3doc/api_docs/python/control_flow_ops.md
index 98f703f95c..a86e65cd33 100644
--- a/tensorflow/g3doc/api_docs/python/control_flow_ops.md
+++ b/tensorflow/g3doc/api_docs/python/control_flow_ops.md
@@ -1,73 +1,37 @@
<!-- This file is machine generated: DO NOT EDIT! -->
-# Control Flow <a class="md-anchor" id="AUTOGENERATED-control-flow"></a>
+# Control Flow
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
-### [Control Flow](#AUTOGENERATED-control-flow)
-* [Control Flow Operations](#AUTOGENERATED-control-flow-operations)
- * [`tf.identity(input, name=None)`](#identity)
- * [`tf.tuple(tensors, name=None, control_inputs=None)`](#tuple)
- * [`tf.group(*inputs, **kwargs)`](#group)
- * [`tf.no_op(name=None)`](#no_op)
- * [`tf.count_up_to(ref, limit, name=None)`](#count_up_to)
-* [Logical Operators](#AUTOGENERATED-logical-operators)
- * [`tf.logical_and(x, y, name=None)`](#logical_and)
- * [`tf.logical_not(x, name=None)`](#logical_not)
- * [`tf.logical_or(x, y, name=None)`](#logical_or)
- * [`tf.logical_xor(x, y, name='LogicalXor')`](#logical_xor)
-* [Comparison Operators](#AUTOGENERATED-comparison-operators)
- * [`tf.equal(x, y, name=None)`](#equal)
- * [`tf.not_equal(x, y, name=None)`](#not_equal)
- * [`tf.less(x, y, name=None)`](#less)
- * [`tf.less_equal(x, y, name=None)`](#less_equal)
- * [`tf.greater(x, y, name=None)`](#greater)
- * [`tf.greater_equal(x, y, name=None)`](#greater_equal)
- * [`tf.select(condition, t, e, name=None)`](#select)
- * [`tf.where(input, name=None)`](#where)
-* [Debugging Operations](#AUTOGENERATED-debugging-operations)
- * [`tf.is_finite(x, name=None)`](#is_finite)
- * [`tf.is_inf(x, name=None)`](#is_inf)
- * [`tf.is_nan(x, name=None)`](#is_nan)
- * [`tf.verify_tensor_all_finite(t, msg, name=None)`](#verify_tensor_all_finite)
- * [`tf.check_numerics(tensor, message, name=None)`](#check_numerics)
- * [`tf.add_check_numerics_ops()`](#add_check_numerics_ops)
- * [`tf.Assert(condition, data, summarize=None, name=None)`](#Assert)
- * [`tf.Print(input_, data, message=None, first_n=None, summarize=None, name=None)`](#Print)
-* [Other Functions and Classes](#AUTOGENERATED-other-functions-and-classes)
- * [`class tf.xrange`](#xrange)
-
-
-<!-- TOC-END This section was generated by neural network, THANKS FOR READING! -->
-
-## Control Flow Operations <a class="md-anchor" id="AUTOGENERATED-control-flow-operations"></a>
+[TOC]
+
+## Control Flow Operations
TensorFlow provides several operations and classes that you can use to control
the execution of operations and add conditional dependencies to your graph.
- - -
-### `tf.identity(input, name=None)` <a class="md-anchor" id="identity"></a>
+### `tf.identity(input, name=None)` {#identity}
Return a tensor with the same shape and contents as the input tensor or value.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`input`</b>: A `Tensor`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `input`.
- - -
-### `tf.tuple(tensors, name=None, control_inputs=None)` <a class="md-anchor" id="tuple"></a>
+### `tf.tuple(tensors, name=None, control_inputs=None)` {#tuple}
Group tensors together.
@@ -85,18 +49,18 @@ are done.
See also `group` and `with_dependencies`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`tensors`</b>: A list of `Tensor`s or `IndexedSlices`, some entries can be `None`.
* <b>`name`</b>: (optional) A name to use as a `name_scope` for the operation.
* <b>`control_inputs`</b>: List of additional ops to finish before returning.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
Same as `tensors`.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`ValueError`</b>: If `tensors` does not contain any `Tensor` or `IndexedSlices`.
@@ -104,7 +68,7 @@ See also `group` and `with_dependencies`.
- - -
-### `tf.group(*inputs, **kwargs)` <a class="md-anchor" id="group"></a>
+### `tf.group(*inputs, **kwargs)` {#group}
Create an op that groups multiple operations.
@@ -113,18 +77,18 @@ output.
See also `tuple` and `with_dependencies`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`*inputs`</b>: One or more tensors to group.
* <b>`**kwargs`</b>: Optional parameters to pass when constructing the NodeDef.
* <b>`name`</b>: A name for this operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
An Operation that executes all its inputs.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`ValueError`</b>: If an unknown keyword argument is provided, or if there are
@@ -133,30 +97,30 @@ See also `tuple` and `with_dependencies`.
- - -
-### `tf.no_op(name=None)` <a class="md-anchor" id="no_op"></a>
+### `tf.no_op(name=None)` {#no_op}
Does nothing. Only useful as a placeholder for control edges.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
The created Operation.
- - -
-### `tf.count_up_to(ref, limit, name=None)` <a class="md-anchor" id="count_up_to"></a>
+### `tf.count_up_to(ref, limit, name=None)` {#count_up_to}
Increments 'ref' until it reaches 'limit'.
This operation outputs "ref" after the update is done. This makes it
easier to chain operations that need to use the updated value.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`ref`</b>: A mutable `Tensor`. Must be one of the following types: `int32`, `int64`.
@@ -166,7 +130,7 @@ easier to chain operations that need to use the updated value.
'OutOfRange' error.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `ref`.
A copy of the input before increment. If nothing else modifies the
@@ -174,188 +138,188 @@ easier to chain operations that need to use the updated value.
-## Logical Operators <a class="md-anchor" id="AUTOGENERATED-logical-operators"></a>
+## Logical Operators
TensorFlow provides several operations that you can use to add logical operators
to your graph.
- - -
-### `tf.logical_and(x, y, name=None)` <a class="md-anchor" id="logical_and"></a>
+### `tf.logical_and(x, y, name=None)` {#logical_and}
Returns the truth value of x AND y element-wise.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor` of type `bool`.
* <b>`y`</b>: A `Tensor` of type `bool`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` of type `bool`.
- - -
-### `tf.logical_not(x, name=None)` <a class="md-anchor" id="logical_not"></a>
+### `tf.logical_not(x, name=None)` {#logical_not}
Returns the truth value of NOT x element-wise.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor` of type `bool`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` of type `bool`.
- - -
-### `tf.logical_or(x, y, name=None)` <a class="md-anchor" id="logical_or"></a>
+### `tf.logical_or(x, y, name=None)` {#logical_or}
Returns the truth value of x OR y element-wise.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor` of type `bool`.
* <b>`y`</b>: A `Tensor` of type `bool`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` of type `bool`.
- - -
-### `tf.logical_xor(x, y, name='LogicalXor')` <a class="md-anchor" id="logical_xor"></a>
+### `tf.logical_xor(x, y, name='LogicalXor')` {#logical_xor}
x ^ y = (x | y) & ~(x & y).
-## Comparison Operators <a class="md-anchor" id="AUTOGENERATED-comparison-operators"></a>
+## Comparison Operators
TensorFlow provides several operations that you can use to add comparison
operators to your graph.
- - -
-### `tf.equal(x, y, name=None)` <a class="md-anchor" id="equal"></a>
+### `tf.equal(x, y, name=None)` {#equal}
Returns the truth value of (x == y) element-wise.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `int64`, `complex64`, `quint8`, `qint8`, `qint32`.
* <b>`y`</b>: A `Tensor`. Must have the same type as `x`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` of type `bool`.
- - -
-### `tf.not_equal(x, y, name=None)` <a class="md-anchor" id="not_equal"></a>
+### `tf.not_equal(x, y, name=None)` {#not_equal}
Returns the truth value of (x != y) element-wise.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `int64`, `complex64`, `quint8`, `qint8`, `qint32`.
* <b>`y`</b>: A `Tensor`. Must have the same type as `x`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` of type `bool`.
- - -
-### `tf.less(x, y, name=None)` <a class="md-anchor" id="less"></a>
+### `tf.less(x, y, name=None)` {#less}
Returns the truth value of (x < y) element-wise.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `int64`.
* <b>`y`</b>: A `Tensor`. Must have the same type as `x`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` of type `bool`.
- - -
-### `tf.less_equal(x, y, name=None)` <a class="md-anchor" id="less_equal"></a>
+### `tf.less_equal(x, y, name=None)` {#less_equal}
Returns the truth value of (x <= y) element-wise.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `int64`.
* <b>`y`</b>: A `Tensor`. Must have the same type as `x`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` of type `bool`.
- - -
-### `tf.greater(x, y, name=None)` <a class="md-anchor" id="greater"></a>
+### `tf.greater(x, y, name=None)` {#greater}
Returns the truth value of (x > y) element-wise.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `int64`.
* <b>`y`</b>: A `Tensor`. Must have the same type as `x`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` of type `bool`.
- - -
-### `tf.greater_equal(x, y, name=None)` <a class="md-anchor" id="greater_equal"></a>
+### `tf.greater_equal(x, y, name=None)` {#greater_equal}
Returns the truth value of (x >= y) element-wise.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `int64`.
* <b>`y`</b>: A `Tensor`. Must have the same type as `x`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` of type `bool`.
- - -
-### `tf.select(condition, t, e, name=None)` <a class="md-anchor" id="select"></a>
+### `tf.select(condition, t, e, name=None)` {#select}
Selects elements from `t` or `e`, depending on `condition`.
@@ -378,7 +342,7 @@ select(condition, t, e) ==> [[1, 2],
[1, 2]]
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`condition`</b>: A `Tensor` of type `bool`.
@@ -386,14 +350,14 @@ select(condition, t, e) ==> [[1, 2],
* <b>`e`</b>: A `Tensor` with the same type and shape as `t`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` with the same type and shape as `t` and `e`.
- - -
-### `tf.where(input, name=None)` <a class="md-anchor" id="where"></a>
+### `tf.where(input, name=None)` {#where}
Returns locations of true values in a boolean tensor.
@@ -429,116 +393,116 @@ where(input) ==> [[0, 0, 0],
[2, 1, 1]]
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`input`</b>: A `Tensor` of type `bool`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` of type `int64`.
-## Debugging Operations <a class="md-anchor" id="AUTOGENERATED-debugging-operations"></a>
+## Debugging Operations
TensorFlow provides several operations that you can use to validate values and
debug your graph.
- - -
-### `tf.is_finite(x, name=None)` <a class="md-anchor" id="is_finite"></a>
+### `tf.is_finite(x, name=None)` {#is_finite}
Returns which elements of x are finite.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` of type `bool`.
- - -
-### `tf.is_inf(x, name=None)` <a class="md-anchor" id="is_inf"></a>
+### `tf.is_inf(x, name=None)` {#is_inf}
Returns which elements of x are Inf.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` of type `bool`.
- - -
-### `tf.is_nan(x, name=None)` <a class="md-anchor" id="is_nan"></a>
+### `tf.is_nan(x, name=None)` {#is_nan}
Returns which elements of x are NaN.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` of type `bool`.
- - -
-### `tf.verify_tensor_all_finite(t, msg, name=None)` <a class="md-anchor" id="verify_tensor_all_finite"></a>
+### `tf.verify_tensor_all_finite(t, msg, name=None)` {#verify_tensor_all_finite}
Assert that the tensor does not contain any NaN's or Inf's.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`t`</b>: Tensor to check.
* <b>`msg`</b>: Message to log on failure.
* <b>`name`</b>: A name for this operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
Same tensor as `t`.
- - -
-### `tf.check_numerics(tensor, message, name=None)` <a class="md-anchor" id="check_numerics"></a>
+### `tf.check_numerics(tensor, message, name=None)` {#check_numerics}
Checks a tensor for NaN and Inf values.
When run, reports an `InvalidArgument` error if `tensor` has any values
that are not a number (NaN) or infinity (Inf). Otherwise, passes `tensor` as-is.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`tensor`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`.
* <b>`message`</b>: A `string`. Prefix of the error message.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `tensor`.
- - -
-### `tf.add_check_numerics_ops()` <a class="md-anchor" id="add_check_numerics_ops"></a>
+### `tf.add_check_numerics_ops()` {#add_check_numerics_ops}
Connect a check_numerics to every floating point tensor.
@@ -547,21 +511,21 @@ tensor in the graph. For all ops in the graph, the `check_numerics` op for
all of its (`float` or `double`) inputs is guaranteed to run before the
`check_numerics` op on any of its outputs.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `group` op depending on all `check_numerics` ops added.
- - -
-### `tf.Assert(condition, data, summarize=None, name=None)` <a class="md-anchor" id="Assert"></a>
+### `tf.Assert(condition, data, summarize=None, name=None)` {#Assert}
Asserts that the given condition is true.
If `condition` evaluates to false, print the list of tensors in `data`.
`summarize` determines how many entries of the tensors to print.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`condition`</b>: The condition to evaluate.
@@ -572,14 +536,14 @@ If `condition` evaluates to false, print the list of tensors in `data`.
- - -
-### `tf.Print(input_, data, message=None, first_n=None, summarize=None, name=None)` <a class="md-anchor" id="Print"></a>
+### `tf.Print(input_, data, message=None, first_n=None, summarize=None, name=None)` {#Print}
Prints a list of tensors.
This is an identity op with the side effect of printing `data` when
evaluating.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`input_`</b>: A tensor passed through this op.
@@ -590,16 +554,16 @@ evaluating.
* <b>`summarize`</b>: Only print this many entries of each tensor.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
Same tensor as `input_`.
-## Other Functions and Classes <a class="md-anchor" id="AUTOGENERATED-other-functions-and-classes"></a>
+## Other Functions and Classes
- - -
-### `class tf.xrange` <a class="md-anchor" id="xrange"></a>
+### `class tf.xrange` {#xrange}
xrange(stop) -> xrange object
xrange(start, stop[, step]) -> xrange object
diff --git a/tensorflow/g3doc/api_docs/python/framework.md b/tensorflow/g3doc/api_docs/python/framework.md
index eab4ec0152..42b02852c7 100644
--- a/tensorflow/g3doc/api_docs/python/framework.md
+++ b/tensorflow/g3doc/api_docs/python/framework.md
@@ -1,46 +1,15 @@
<!-- This file is machine generated: DO NOT EDIT! -->
-# Building Graphs <a class="md-anchor" id="AUTOGENERATED-building-graphs"></a>
-<!-- TOC-BEGIN This section is generated by neural network: DO NOT EDIT! -->
-## Contents
-### [Building Graphs](#AUTOGENERATED-building-graphs)
-* [Core graph data structures](#AUTOGENERATED-core-graph-data-structures)
- * [`class tf.Graph`](#Graph)
- * [`class tf.Operation`](#Operation)
- * [`class tf.Tensor`](#Tensor)
-* [Tensor types](#AUTOGENERATED-tensor-types)
- * [`class tf.DType`](#DType)
- * [`tf.as_dtype(type_value)`](#as_dtype)
-* [Utility functions](#AUTOGENERATED-utility-functions)
- * [`tf.device(dev)`](#device)
- * [`tf.name_scope(name)`](#name_scope)
- * [`tf.control_dependencies(control_inputs)`](#control_dependencies)
- * [`tf.convert_to_tensor(value, dtype=None, name=None)`](#convert_to_tensor)
- * [`tf.get_default_graph()`](#get_default_graph)
- * [`tf.import_graph_def(graph_def, input_map=None, return_elements=None, name=None, op_dict=None)`](#import_graph_def)
-* [Graph collections](#AUTOGENERATED-graph-collections)
- * [`tf.add_to_collection(name, value)`](#add_to_collection)
- * [`tf.get_collection(key, scope=None)`](#get_collection)
- * [`class tf.GraphKeys`](#GraphKeys)
-* [Defining new operations](#AUTOGENERATED-defining-new-operations)
- * [`class tf.RegisterGradient`](#RegisterGradient)
- * [`tf.NoGradient(op_type)`](#NoGradient)
- * [`class tf.RegisterShape`](#RegisterShape)
- * [`class tf.TensorShape`](#TensorShape)
- * [`class tf.Dimension`](#Dimension)
- * [`tf.op_scope(values, name, default_name)`](#op_scope)
- * [`tf.get_seed(op_seed)`](#get_seed)
-
-
-<!-- TOC-END This section was generated by neural network, THANKS FOR READING! -->
+# Building Graphs
+[TOC]
Classes and functions for building TensorFlow graphs.
-## Core graph data structures <a class="md-anchor" id="AUTOGENERATED-core-graph-data-structures"></a>
+## Core graph data structures
- - -
-### `class tf.Graph` <a class="md-anchor" id="Graph"></a>
+### `class tf.Graph` {#Graph}
A TensorFlow computation, represented as a dataflow graph.
@@ -80,14 +49,14 @@ are not thread-safe.
- - -
-#### `tf.Graph.__init__()` <a class="md-anchor" id="Graph.__init__"></a>
+#### `tf.Graph.__init__()` {#Graph.__init__}
Creates a new, empty Graph.
- - -
-#### `tf.Graph.as_default()` <a class="md-anchor" id="Graph.as_default"></a>
+#### `tf.Graph.as_default()` {#Graph.as_default}
Returns a context manager that makes this `Graph` the default graph.
@@ -118,14 +87,14 @@ with tf.Graph().as_default() as g:
assert c.graph is g
```
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A context manager for using this graph as the default graph.
- - -
-#### `tf.Graph.as_graph_def(from_version=None)` <a class="md-anchor" id="Graph.as_graph_def"></a>
+#### `tf.Graph.as_graph_def(from_version=None)` {#Graph.as_graph_def}
Returns a serialized `GraphDef` representation of this graph.
@@ -135,19 +104,19 @@ The serialized `GraphDef` can be imported into another `Graph`
This method is thread-safe.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`from_version`</b>: Optional. If this is set, returns a `GraphDef`
containing only the nodes that were added to this graph since
its `version` property had the given value.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A [`GraphDef`](https://tensorflow.googlesource.com/tensorflow/+/master/tensorflow/core/framework/graph.proto)
protocol buffer.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`ValueError`</b>: If the graph_def would be too large.
@@ -155,7 +124,7 @@ This method is thread-safe.
- - -
-#### `tf.Graph.finalize()` <a class="md-anchor" id="Graph.finalize"></a>
+#### `tf.Graph.finalize()` {#Graph.finalize}
Finalizes this graph, making it read-only.
@@ -167,14 +136,14 @@ when using a [`QueueRunner`](../../api_docs/python/train.md#QueueRunner).
- - -
-#### `tf.Graph.finalized` <a class="md-anchor" id="Graph.finalized"></a>
+#### `tf.Graph.finalized` {#Graph.finalized}
True if this graph has been finalized.
- - -
-#### `tf.Graph.control_dependencies(control_inputs)` <a class="md-anchor" id="Graph.control_dependencies"></a>
+#### `tf.Graph.control_dependencies(control_inputs)` {#Graph.control_dependencies}
Returns a context manager that specifies control dependencies.
@@ -222,19 +191,19 @@ def my_func(pred, tensor):
return tf.matmul(tensor, tensor)
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`control_inputs`</b>: A list of `Operation` or `Tensor` objects, which
must be executed or computed before running the operations
defined in the context.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A context manager that specifies control dependencies for all
operations constructed within the context.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`TypeError`</b>: If `control_inputs` is not a list of `Operation` or
@@ -243,7 +212,7 @@ def my_func(pred, tensor):
- - -
-#### `tf.Graph.device(device_name_or_function)` <a class="md-anchor" id="Graph.device"></a>
+#### `tf.Graph.device(device_name_or_function)` {#Graph.device}
Returns a context manager that specifies the default device to use.
@@ -281,13 +250,13 @@ with g.device(matmul_on_gpu):
# on CPU 0.
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`device_name_or_function`</b>: The device name or function to use in
the context.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A context manager that specifies the default device to use for newly
created ops.
@@ -295,7 +264,7 @@ with g.device(matmul_on_gpu):
- - -
-#### `tf.Graph.name_scope(name)` <a class="md-anchor" id="Graph.name_scope"></a>
+#### `tf.Graph.name_scope(name)` {#Graph.name_scope}
Returns a context manager that creates hierarchical names for operations.
@@ -365,12 +334,12 @@ with g.name_scope('my_layer') as scope:
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`name`</b>: A name for the scope.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A context manager that installs `name` as a new name scope.
@@ -386,11 +355,11 @@ may define additional collections by specifying a new name.
- - -
-#### `tf.Graph.add_to_collection(name, value)` <a class="md-anchor" id="Graph.add_to_collection"></a>
+#### `tf.Graph.add_to_collection(name, value)` {#Graph.add_to_collection}
Stores `value` in the collection with the given `name`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`name`</b>: The key for the collection. For example, the `GraphKeys` class
@@ -400,11 +369,11 @@ Stores `value` in the collection with the given `name`.
- - -
-#### `tf.Graph.get_collection(name, scope=None)` <a class="md-anchor" id="Graph.get_collection"></a>
+#### `tf.Graph.get_collection(name, scope=None)` {#Graph.get_collection}
Returns a list of values in the collection with the given `name`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`key`</b>: The key for the collection. For example, the `GraphKeys` class
@@ -412,7 +381,7 @@ Returns a list of values in the collection with the given `name`.
* <b>`scope`</b>: (Optional.) If supplied, the resulting list is filtered to include
only items whose name begins with this string.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
The list of values in the collection with the given `name`, or
an empty list if no value has been added to that collection. The
@@ -423,7 +392,7 @@ Returns a list of values in the collection with the given `name`.
- - -
-#### `tf.Graph.as_graph_element(obj, allow_tensor=True, allow_operation=True)` <a class="md-anchor" id="Graph.as_graph_element"></a>
+#### `tf.Graph.as_graph_element(obj, allow_tensor=True, allow_operation=True)` {#Graph.as_graph_element}
Returns the object referred to by `obj`, as an `Operation` or `Tensor`.
@@ -436,7 +405,7 @@ Session API.
This method may be called concurrently from multiple threads.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`obj`</b>: A `Tensor`, an `Operation`, or the name of a tensor or operation.
@@ -445,11 +414,11 @@ This method may be called concurrently from multiple threads.
* <b>`allow_tensor`</b>: If true, `obj` may refer to a `Tensor`.
* <b>`allow_operation`</b>: If true, `obj` may refer to an `Operation`.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
The `Tensor` or `Operation` in the Graph corresponding to `obj`.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`TypeError`</b>: If `obj` is not a type we support attempting to convert
@@ -461,22 +430,22 @@ This method may be called concurrently from multiple threads.
- - -
-#### `tf.Graph.get_operation_by_name(name)` <a class="md-anchor" id="Graph.get_operation_by_name"></a>
+#### `tf.Graph.get_operation_by_name(name)` {#Graph.get_operation_by_name}
Returns the `Operation` with the given `name`.
This method may be called concurrently from multiple threads.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`name`</b>: The name of the `Operation` to return.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
The `Operation` with the given `name`.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`TypeError`</b>: If `name` is not a string.
@@ -485,22 +454,22 @@ This method may be called concurrently from multiple threads.
- - -
-#### `tf.Graph.get_tensor_by_name(name)` <a class="md-anchor" id="Graph.get_tensor_by_name"></a>
+#### `tf.Graph.get_tensor_by_name(name)` {#Graph.get_tensor_by_name}
Returns the `Tensor` with the given `name`.
This method may be called concurrently from multiple threads.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`name`</b>: The name of the `Tensor` to return.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
The `Tensor` with the given `name`.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`TypeError`</b>: If `name` is not a string.
@@ -509,7 +478,7 @@ This method may be called concurrently from multiple threads.
- - -
-#### `tf.Graph.get_operations()` <a class="md-anchor" id="Graph.get_operations"></a>
+#### `tf.Graph.get_operations()` {#Graph.get_operations}
Return the list of operations in the graph.
@@ -519,7 +488,7 @@ list of operations known to the graph.
This method may be called concurrently from multiple threads.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A list of Operations.
@@ -527,24 +496,24 @@ This method may be called concurrently from multiple threads.
- - -
-#### `tf.Graph.get_default_device()` <a class="md-anchor" id="Graph.get_default_device"></a>
+#### `tf.Graph.get_default_device()` {#Graph.get_default_device}
Returns the default device.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A string.
- - -
-#### `tf.Graph.seed` <a class="md-anchor" id="Graph.seed"></a>
+#### `tf.Graph.seed` {#Graph.seed}
- - -
-#### `tf.Graph.unique_name(name)` <a class="md-anchor" id="Graph.unique_name"></a>
+#### `tf.Graph.unique_name(name)` {#Graph.unique_name}
Return a unique Operation name for "name".
@@ -557,12 +526,12 @@ to help identify Operations when debugging a Graph. Operation names
are displayed in error messages reported by the TensorFlow runtime,
and in various visualization tools such as TensorBoard.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`name`</b>: The name for an `Operation`.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A string to be passed to `create_op()` that will be used
to name the operation being created.
@@ -570,14 +539,14 @@ and in various visualization tools such as TensorBoard.
- - -
-#### `tf.Graph.version` <a class="md-anchor" id="Graph.version"></a>
+#### `tf.Graph.version` {#Graph.version}
Returns a version number that increases as ops are added to the graph.
- - -
-#### `tf.Graph.create_op(op_type, inputs, dtypes, input_types=None, name=None, attrs=None, op_def=None, compute_shapes=True)` <a class="md-anchor" id="Graph.create_op"></a>
+#### `tf.Graph.create_op(op_type, inputs, dtypes, input_types=None, name=None, attrs=None, op_def=None, compute_shapes=True)` {#Graph.create_op}
Creates an `Operation` in this graph.
@@ -586,7 +555,7 @@ programs will not call this method directly, and instead use the
Python op constructors, such as `tf.constant()`, which add ops to
the default graph.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`op_type`</b>: The `Operation` type to create. This corresponds to the
@@ -607,19 +576,19 @@ the default graph.
* <b>`compute_shapes`</b>: (Optional.) If True, shape inference will be performed
to compute the shapes of the outputs.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`TypeError`</b>: if any of the inputs is not a `Tensor`.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
An `Operation` object.
- - -
-#### `tf.Graph.gradient_override_map(op_type_map)` <a class="md-anchor" id="Graph.gradient_override_map"></a>
+#### `tf.Graph.gradient_override_map(op_type_map)` {#Graph.gradient_override_map}
EXPERIMENTAL: A context manager for overriding gradient functions.
@@ -641,18 +610,18 @@ with tf.Graph().as_default() as g:
# gradient of s_2.
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`op_type_map`</b>: A dictionary mapping op type strings to alternative op
type strings.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A context manager that sets the alternative op type to be used for one
or more ops created in that context.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`TypeError`</b>: If `op_type_map` is not a dictionary mapping strings to
@@ -662,7 +631,7 @@ with tf.Graph().as_default() as g:
- - -
-### `class tf.Operation` <a class="md-anchor" id="Operation"></a>
+### `class tf.Operation` {#Operation}
Represents a graph node that performs computation on tensors.
@@ -684,25 +653,25 @@ be executed by passing it to
- - -
-#### `tf.Operation.name` <a class="md-anchor" id="Operation.name"></a>
+#### `tf.Operation.name` {#Operation.name}
The full name of this operation.
- - -
-#### `tf.Operation.type` <a class="md-anchor" id="Operation.type"></a>
+#### `tf.Operation.type` {#Operation.type}
The type of the op (e.g. `"MatMul"`).
- - -
-#### `tf.Operation.inputs` <a class="md-anchor" id="Operation.inputs"></a>
+#### `tf.Operation.inputs` {#Operation.inputs}
The list of `Tensor` objects representing the data inputs of this op.
- - -
-#### `tf.Operation.control_inputs` <a class="md-anchor" id="Operation.control_inputs"></a>
+#### `tf.Operation.control_inputs` {#Operation.control_inputs}
The `Operation` objects on which this op has a control dependency.
@@ -712,37 +681,37 @@ mechanism can be used to run ops sequentially for performance
reasons, or to ensure that the side effects of an op are observed
in the correct order.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A list of `Operation` objects.
- - -
-#### `tf.Operation.outputs` <a class="md-anchor" id="Operation.outputs"></a>
+#### `tf.Operation.outputs` {#Operation.outputs}
The list of `Tensor` objects representing the outputs of this op.
- - -
-#### `tf.Operation.device` <a class="md-anchor" id="Operation.device"></a>
+#### `tf.Operation.device` {#Operation.device}
The name of the device to which this op has been assigned, if any.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
The string name of the device to which this op has been
assigned, or None if it has not been assigned to a device.
- - -
-#### `tf.Operation.graph` <a class="md-anchor" id="Operation.graph"></a>
+#### `tf.Operation.graph` {#Operation.graph}
The `Graph` that contains this operation.
- - -
-#### `tf.Operation.run(feed_dict=None, session=None)` <a class="md-anchor" id="Operation.run"></a>
+#### `tf.Operation.run(feed_dict=None, session=None)` {#Operation.run}
Runs this operation in a `Session`.
@@ -753,7 +722,7 @@ produce the inputs needed for this operation.
launched in a session, and either a default session must be
available, or `session` must be specified explicitly.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`feed_dict`</b>: A dictionary that maps `Tensor` objects to feed values.
@@ -766,20 +735,20 @@ available, or `session` must be specified explicitly.
- - -
-#### `tf.Operation.get_attr(name)` <a class="md-anchor" id="Operation.get_attr"></a>
+#### `tf.Operation.get_attr(name)` {#Operation.get_attr}
Returns the value of the attr of this op with the given `name`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`name`</b>: The name of the attr to fetch.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
The value of the attr, as a Python object.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`ValueError`</b>: If this op does not have an attr with the given `name`.
@@ -787,15 +756,15 @@ Returns the value of the attr of this op with the given `name`.
- - -
-#### `tf.Operation.traceback` <a class="md-anchor" id="Operation.traceback"></a>
+#### `tf.Operation.traceback` {#Operation.traceback}
Returns the call stack from when this operation was constructed.
-#### Other Methods <a class="md-anchor" id="AUTOGENERATED-other-methods"></a>
+#### Other Methods
- - -
-#### `tf.Operation.__init__(node_def, g, inputs=None, output_types=None, control_inputs=None, input_types=None, original_op=None, op_def=None)` <a class="md-anchor" id="Operation.__init__"></a>
+#### `tf.Operation.__init__(node_def, g, inputs=None, output_types=None, control_inputs=None, input_types=None, original_op=None, op_def=None)` {#Operation.__init__}
Creates an `Operation`.
@@ -805,7 +774,7 @@ regular expression:
[A-Za-z0-9.][A-Za-z0-9_.\-/]*
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`node_def`</b>: graph_pb2.NodeDef. NodeDef for the Operation.
@@ -829,7 +798,7 @@ regular expression:
* <b>`op_def`</b>: Optional. The op_def_pb2.OpDef proto that describes the
op type that this Operation represents.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`TypeError`</b>: if control inputs are not Operations or Tensors,
@@ -842,11 +811,11 @@ regular expression:
- - -
-#### `tf.Operation.node_def` <a class="md-anchor" id="Operation.node_def"></a>
+#### `tf.Operation.node_def` {#Operation.node_def}
Returns a serialized `NodeDef` representation of this operation.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A
[`NodeDef`](https://tensorflow.googlesource.com/tensorflow/+/master/tensorflow/core/framework/graph.proto)
@@ -854,11 +823,11 @@ Returns a serialized `NodeDef` representation of this operation.
- - -
-#### `tf.Operation.op_def` <a class="md-anchor" id="Operation.op_def"></a>
+#### `tf.Operation.op_def` {#Operation.op_def}
Returns the `OpDef` proto that represents the type of this op.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
An
[`OpDef`](https://tensorflow.googlesource.com/tensorflow/+/master/tensorflow/core/framework/op_def.proto)
@@ -866,7 +835,7 @@ Returns the `OpDef` proto that represents the type of this op.
- - -
-#### `tf.Operation.values()` <a class="md-anchor" id="Operation.values"></a>
+#### `tf.Operation.values()` {#Operation.values}
DEPRECATED: Use outputs.
@@ -874,7 +843,7 @@ DEPRECATED: Use outputs.
- - -
-### `class tf.Tensor` <a class="md-anchor" id="Tensor"></a>
+### `class tf.Tensor` {#Tensor}
Represents a value produced by an `Operation`.
@@ -915,41 +884,41 @@ result = sess.run(e)
- - -
-#### `tf.Tensor.dtype` <a class="md-anchor" id="Tensor.dtype"></a>
+#### `tf.Tensor.dtype` {#Tensor.dtype}
The `DType` of elements in this tensor.
- - -
-#### `tf.Tensor.name` <a class="md-anchor" id="Tensor.name"></a>
+#### `tf.Tensor.name` {#Tensor.name}
The string name of this tensor.
- - -
-#### `tf.Tensor.value_index` <a class="md-anchor" id="Tensor.value_index"></a>
+#### `tf.Tensor.value_index` {#Tensor.value_index}
The index of this tensor in the outputs of its `Operation`.
- - -
-#### `tf.Tensor.graph` <a class="md-anchor" id="Tensor.graph"></a>
+#### `tf.Tensor.graph` {#Tensor.graph}
The `Graph` that contains this tensor.
- - -
-#### `tf.Tensor.op` <a class="md-anchor" id="Tensor.op"></a>
+#### `tf.Tensor.op` {#Tensor.op}
The `Operation` that produces this tensor as an output.
- - -
-#### `tf.Tensor.consumers()` <a class="md-anchor" id="Tensor.consumers"></a>
+#### `tf.Tensor.consumers()` {#Tensor.consumers}
Returns a list of `Operation`s that consume this tensor.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A list of `Operation`s.
@@ -957,7 +926,7 @@ Returns a list of `Operation`s that consume this tensor.
- - -
-#### `tf.Tensor.eval(feed_dict=None, session=None)` <a class="md-anchor" id="Tensor.eval"></a>
+#### `tf.Tensor.eval(feed_dict=None, session=None)` {#Tensor.eval}
Evaluates this tensor in a `Session`.
@@ -969,7 +938,7 @@ tensor.
launched in a session, and either a default session must be
available, or `session` must be specified explicitly.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`feed_dict`</b>: A dictionary that maps `Tensor` objects to feed values.
@@ -978,7 +947,7 @@ available, or `session` must be specified explicitly.
* <b>`session`</b>: (Optional.) The `Session` to be used to evaluate this tensor. If
none, the default session will be used.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A numpy array corresponding to the value of this tensor.
@@ -986,7 +955,7 @@ available, or `session` must be specified explicitly.
- - -
-#### `tf.Tensor.get_shape()` <a class="md-anchor" id="Tensor.get_shape"></a>
+#### `tf.Tensor.get_shape()` {#Tensor.get_shape}
Returns the `TensorShape` that represents the shape of this tensor.
@@ -1026,14 +995,14 @@ the caller has additional information about the values of these
dimensions, `Tensor.set_shape()` can be used to augment the
inferred shape.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `TensorShape` representing the shape of this tensor.
- - -
-#### `tf.Tensor.set_shape(shape)` <a class="md-anchor" id="Tensor.set_shape"></a>
+#### `tf.Tensor.set_shape(shape)` {#Tensor.set_shape}
Updates the shape of this tensor.
@@ -1058,12 +1027,12 @@ print image.get_shape()
==> TensorShape([Dimension(28), Dimension(28), Dimension(3)])
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`shape`</b>: A `TensorShape` representing the shape of this tensor.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`ValueError`</b>: If `shape` is not compatible with the current shape of
@@ -1071,14 +1040,14 @@ print image.get_shape()
-#### Other Methods <a class="md-anchor" id="AUTOGENERATED-other-methods"></a>
+#### Other Methods
- - -
-#### `tf.Tensor.__init__(op, value_index, dtype)` <a class="md-anchor" id="Tensor.__init__"></a>
+#### `tf.Tensor.__init__(op, value_index, dtype)` {#Tensor.__init__}
Creates a new `Tensor`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`op`</b>: An `Operation`. `Operation` that computes this tensor.
@@ -1086,7 +1055,7 @@ Creates a new `Tensor`.
this tensor.
* <b>`dtype`</b>: A `types.DType`. Type of data stored in this tensor.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`TypeError`</b>: If the op is not an `Operation`.
@@ -1094,17 +1063,17 @@ Creates a new `Tensor`.
- - -
-#### `tf.Tensor.device` <a class="md-anchor" id="Tensor.device"></a>
+#### `tf.Tensor.device` {#Tensor.device}
The name of the device on which this tensor will be produced, or None.
-## Tensor types <a class="md-anchor" id="AUTOGENERATED-tensor-types"></a>
+## Tensor types
- - -
-### `class tf.DType` <a class="md-anchor" id="DType"></a>
+### `class tf.DType` {#DType}
Represents the type of the elements in a `Tensor`.
@@ -1136,7 +1105,7 @@ names to a `DType` object.
- - -
-#### `tf.DType.is_compatible_with(other)` <a class="md-anchor" id="DType.is_compatible_with"></a>
+#### `tf.DType.is_compatible_with(other)` {#DType.is_compatible_with}
Returns True if the `other` DType will be converted to this DType.
@@ -1149,12 +1118,12 @@ DType(T).as_ref.is_compatible_with(DType(T)) == False
DType(T).as_ref.is_compatible_with(DType(T).as_ref) == True
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`other`</b>: A `DType` (or object that may be converted to a `DType`).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
True if a Tensor of the `other` `DType` will be implicitly converted to
this `DType`.
@@ -1162,58 +1131,58 @@ DType(T).as_ref.is_compatible_with(DType(T).as_ref) == True
- - -
-#### `tf.DType.name` <a class="md-anchor" id="DType.name"></a>
+#### `tf.DType.name` {#DType.name}
Returns the string name for this `DType`.
- - -
-#### `tf.DType.base_dtype` <a class="md-anchor" id="DType.base_dtype"></a>
+#### `tf.DType.base_dtype` {#DType.base_dtype}
Returns a non-reference `DType` based on this `DType`.
- - -
-#### `tf.DType.is_ref_dtype` <a class="md-anchor" id="DType.is_ref_dtype"></a>
+#### `tf.DType.is_ref_dtype` {#DType.is_ref_dtype}
Returns `True` if this `DType` represents a reference type.
- - -
-#### `tf.DType.as_ref` <a class="md-anchor" id="DType.as_ref"></a>
+#### `tf.DType.as_ref` {#DType.as_ref}
Returns a reference `DType` based on this `DType`.
- - -
-#### `tf.DType.is_integer` <a class="md-anchor" id="DType.is_integer"></a>
+#### `tf.DType.is_integer` {#DType.is_integer}
Returns whether this is a (non-quantized) integer type.
- - -
-#### `tf.DType.is_quantized` <a class="md-anchor" id="DType.is_quantized"></a>
+#### `tf.DType.is_quantized` {#DType.is_quantized}
Returns whether this is a quantized data type.
- - -
-#### `tf.DType.as_numpy_dtype` <a class="md-anchor" id="DType.as_numpy_dtype"></a>
+#### `tf.DType.as_numpy_dtype` {#DType.as_numpy_dtype}
Returns a `numpy.dtype` based on this `DType`.
- - -
-#### `tf.DType.as_datatype_enum` <a class="md-anchor" id="DType.as_datatype_enum"></a>
+#### `tf.DType.as_datatype_enum` {#DType.as_datatype_enum}
Returns a `types_pb2.DataType` enum value based on this `DType`.
-#### Other Methods <a class="md-anchor" id="AUTOGENERATED-other-methods"></a>
+#### Other Methods
- - -
-#### `tf.DType.__init__(type_enum)` <a class="md-anchor" id="DType.__init__"></a>
+#### `tf.DType.__init__(type_enum)` {#DType.__init__}
Creates a new `DataType`.
@@ -1221,12 +1190,12 @@ NOTE(mrry): In normal circumstances, you should not need to
construct a DataType object directly. Instead, use the
types.as_dtype() function.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`type_enum`</b>: A `types_pb2.DataType` enum value.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`TypeError`</b>: If `type_enum` is not a value `types_pb2.DataType`.
@@ -1234,28 +1203,28 @@ types.as_dtype() function.
- - -
-#### `tf.DType.is_floating` <a class="md-anchor" id="DType.is_floating"></a>
+#### `tf.DType.is_floating` {#DType.is_floating}
Returns whether this is a (real) floating point type.
- - -
-#### `tf.DType.max` <a class="md-anchor" id="DType.max"></a>
+#### `tf.DType.max` {#DType.max}
Returns the maximum representable value in this data type.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`TypeError`</b>: if this is a non-numeric, unordered, or quantized type.
- - -
-#### `tf.DType.min` <a class="md-anchor" id="DType.min"></a>
+#### `tf.DType.min` {#DType.min}
Returns the minimum representable value in this data type.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`TypeError`</b>: if this is a non-numeric, unordered, or quantized type.
@@ -1263,11 +1232,11 @@ Returns the minimum representable value in this data type.
- - -
-### `tf.as_dtype(type_value)` <a class="md-anchor" id="as_dtype"></a>
+### `tf.as_dtype(type_value)` {#as_dtype}
Converts the given `type_value` to a `DType`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`type_value`</b>: A value that can be converted to a `tf.DType`
@@ -1275,22 +1244,22 @@ Converts the given `type_value` to a `DType`.
[`DataType` enum](https://tensorflow.googlesource.com/tensorflow/+/master/tensorflow/core/framework/types.proto),
a string type name, or a `numpy.dtype`.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `DType` corresponding to `type_value`.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`TypeError`</b>: If `type_value` cannot be converted to a `DType`.
-## Utility functions <a class="md-anchor" id="AUTOGENERATED-utility-functions"></a>
+## Utility functions
- - -
-### `tf.device(dev)` <a class="md-anchor" id="device"></a>
+### `tf.device(dev)` {#device}
Wrapper for `Graph.device()` using the default graph.
@@ -1298,13 +1267,13 @@ See
[`Graph.name_scope()`](../../api_docs/python/framework.md#Graph.name_scope)
for more details.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`device_name_or_function`</b>: The device name or function to use in
the context.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A context manager that specifies the default device to use for newly
created ops.
@@ -1312,7 +1281,7 @@ for more details.
- - -
-### `tf.name_scope(name)` <a class="md-anchor" id="name_scope"></a>
+### `tf.name_scope(name)` {#name_scope}
Wrapper for `Graph.name_scope()` using the default graph.
@@ -1320,12 +1289,12 @@ See
[`Graph.name_scope()`](../../api_docs/python/framework.md#Graph.name_scope)
for more details.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`name`</b>: A name for the scope.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A context manager that installs `name` as a new name scope in the
default graph.
@@ -1333,21 +1302,21 @@ for more details.
- - -
-### `tf.control_dependencies(control_inputs)` <a class="md-anchor" id="control_dependencies"></a>
+### `tf.control_dependencies(control_inputs)` {#control_dependencies}
Wrapper for `Graph.control_dependencies()` using the default graph.
See [`Graph.control_dependencies()`](../../api_docs/python/framework.md#Graph.control_dependencies)
for more details.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`control_inputs`</b>: A list of `Operation` or `Tensor` objects, which
must be executed or computed before running the operations
defined in the context.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A context manager that specifies control dependencies for all
operations constructed within the context.
@@ -1355,7 +1324,7 @@ for more details.
- - -
-### `tf.convert_to_tensor(value, dtype=None, name=None)` <a class="md-anchor" id="convert_to_tensor"></a>
+### `tf.convert_to_tensor(value, dtype=None, name=None)` {#convert_to_tensor}
Converts the given `value` to a `Tensor`.
@@ -1383,7 +1352,7 @@ constructors apply this function to each of their Tensor-valued
inputs, which allows those ops to accept numpy arrays, Python lists,
and scalars in addition to `Tensor` objects.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`value`</b>: An object whose type has a registered `Tensor` conversion function.
@@ -1391,11 +1360,11 @@ and scalars in addition to `Tensor` objects.
type is inferred from the type of `value`.
* <b>`name`</b>: Optional name to use if a new `Tensor` is created.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` based on `value`.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`TypeError`</b>: If no conversion function is registered for `value`.
@@ -1404,7 +1373,7 @@ and scalars in addition to `Tensor` objects.
- - -
-### `tf.get_default_graph()` <a class="md-anchor" id="get_default_graph"></a>
+### `tf.get_default_graph()` {#get_default_graph}
Returns the default graph for the current thread.
@@ -1417,14 +1386,14 @@ create a new thread, and wish to use the default graph in that
thread, you must explicitly add a `with g.as_default():` in that
thread's function.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
The default `Graph` being used in the current thread.
- - -
-### `tf.import_graph_def(graph_def, input_map=None, return_elements=None, name=None, op_dict=None)` <a class="md-anchor" id="import_graph_def"></a>
+### `tf.import_graph_def(graph_def, input_map=None, return_elements=None, name=None, op_dict=None)` {#import_graph_def}
Imports the TensorFlow graph in `graph_def` into the Python `Graph`.
@@ -1435,7 +1404,7 @@ protocol buffer, and extract individual objects in the `GraphDef` as
[`Graph.as_graph_def()`](#Graph.as_graph_def) for a way to create a
`GraphDef` proto.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`graph_def`</b>: A `GraphDef` proto containing operations to be imported into
@@ -1452,12 +1421,12 @@ protocol buffer, and extract individual objects in the `GraphDef` as
Must contain an `OpDef` proto for each op type named in `graph_def`.
If omitted, uses the `OpDef` protos registered in the global registry.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A list of `Operation` and/or `Tensor` objects from the imported graph,
corresponding to the names in `return_elements'.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`TypeError`</b>: If `graph_def` is not a `GraphDef` proto,
@@ -1469,18 +1438,18 @@ protocol buffer, and extract individual objects in the `GraphDef` as
-## Graph collections <a class="md-anchor" id="AUTOGENERATED-graph-collections"></a>
+## Graph collections
- - -
-### `tf.add_to_collection(name, value)` <a class="md-anchor" id="add_to_collection"></a>
+### `tf.add_to_collection(name, value)` {#add_to_collection}
Wrapper for `Graph.add_to_collection()` using the default graph.
See [`Graph.add_to_collection()`](../../api_docs/python/framework.md#Graph.add_to_collection)
for more details.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`name`</b>: The key for the collection. For example, the `GraphKeys` class
@@ -1490,14 +1459,14 @@ for more details.
- - -
-### `tf.get_collection(key, scope=None)` <a class="md-anchor" id="get_collection"></a>
+### `tf.get_collection(key, scope=None)` {#get_collection}
Wrapper for `Graph.get_collection()` using the default graph.
See [`Graph.get_collection()`](../../api_docs/python/framework.md#Graph.get_collection)
for more details.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`key`</b>: The key for the collection. For example, the `GraphKeys` class
@@ -1505,7 +1474,7 @@ for more details.
* <b>`scope`</b>: (Optional.) If supplied, the resulting list is filtered to include
only items whose name begins with this string.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
The list of values in the collection with the given `name`, or
an empty list if no value has been added to that collection. The
@@ -1515,7 +1484,7 @@ for more details.
- - -
-### `class tf.GraphKeys` <a class="md-anchor" id="GraphKeys"></a>
+### `class tf.GraphKeys` {#GraphKeys}
Standard names to use for graph collections.
@@ -1546,11 +1515,11 @@ The following standard keys are defined:
for more details.
-## Defining new operations <a class="md-anchor" id="AUTOGENERATED-defining-new-operations"></a>
+## Defining new operations
- - -
-### `class tf.RegisterGradient` <a class="md-anchor" id="RegisterGradient"></a>
+### `class tf.RegisterGradient` {#RegisterGradient}
A decorator for registering the gradient function for an op type.
@@ -1577,11 +1546,11 @@ that defines the operation.
- - -
-#### `tf.RegisterGradient.__init__(op_type)` <a class="md-anchor" id="RegisterGradient.__init__"></a>
+#### `tf.RegisterGradient.__init__(op_type)` {#RegisterGradient.__init__}
Creates a new decorator with `op_type` as the Operation type.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`op_type`</b>: The string type of an operation. This corresponds to the
@@ -1591,7 +1560,7 @@ Creates a new decorator with `op_type` as the Operation type.
- - -
-### `tf.NoGradient(op_type)` <a class="md-anchor" id="NoGradient"></a>
+### `tf.NoGradient(op_type)` {#NoGradient}
Specifies that ops of type `op_type` do not have a defined gradient.
@@ -1603,13 +1572,13 @@ example:
tf.NoGradient("Size")
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`op_type`</b>: The string type of an operation. This corresponds to the
`OpDef.name` field for the proto that defines the operation.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`TypeError`</b>: If `op_type` is not a string.
@@ -1617,7 +1586,7 @@ tf.NoGradient("Size")
- - -
-### `class tf.RegisterShape` <a class="md-anchor" id="RegisterShape"></a>
+### `class tf.RegisterShape` {#RegisterShape}
A decorator for registering the shape function for an op type.
@@ -1641,7 +1610,7 @@ operation. This corresponds to the `OpDef.name` field for the proto
that defines the operation.
- - -
-#### `tf.RegisterShape.__init__(op_type)` <a class="md-anchor" id="RegisterShape.__init__"></a>
+#### `tf.RegisterShape.__init__(op_type)` {#RegisterShape.__init__}
Saves the "op_type" as the Operation type.
@@ -1649,7 +1618,7 @@ Saves the "op_type" as the Operation type.
- - -
-### `class tf.TensorShape` <a class="md-anchor" id="TensorShape"></a>
+### `class tf.TensorShape` {#TensorShape}
Represents the shape of a `Tensor`.
@@ -1672,24 +1641,24 @@ explicitly using [`Tensor.set_shape()`](../../api_docs/python/framework.md#Tenso
- - -
-#### `tf.TensorShape.merge_with(other)` <a class="md-anchor" id="TensorShape.merge_with"></a>
+#### `tf.TensorShape.merge_with(other)` {#TensorShape.merge_with}
Returns a `TensorShape` combining the information in `self` and `other`.
The dimensions in `self` and `other` are merged elementwise,
according to the rules defined for `Dimension.merge_with()`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`other`</b>: Another `TensorShape`.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `TensorShape` containing the combined information of `self` and
`other`.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`ValueError`</b>: If `self` and `other` are not compatible.
@@ -1697,7 +1666,7 @@ according to the rules defined for `Dimension.merge_with()`.
- - -
-#### `tf.TensorShape.concatenate(other)` <a class="md-anchor" id="TensorShape.concatenate"></a>
+#### `tf.TensorShape.concatenate(other)` {#TensorShape.concatenate}
Returns the concatenation of the dimension in `self` and `other`.
@@ -1706,12 +1675,12 @@ concatenation will discard information about the other shape. In
future, we might support concatenation that preserves this
information for use with slicing.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`other`</b>: Another `TensorShape`.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `TensorShape` whose dimensions are the concatenation of the
dimensions in `self` and `other`.
@@ -1720,26 +1689,26 @@ information for use with slicing.
- - -
-#### `tf.TensorShape.ndims` <a class="md-anchor" id="TensorShape.ndims"></a>
+#### `tf.TensorShape.ndims` {#TensorShape.ndims}
Returns the rank of this shape, or None if it is unspecified.
- - -
-#### `tf.TensorShape.dims` <a class="md-anchor" id="TensorShape.dims"></a>
+#### `tf.TensorShape.dims` {#TensorShape.dims}
Returns a list of Dimensions, or None if the shape is unspecified.
- - -
-#### `tf.TensorShape.as_list()` <a class="md-anchor" id="TensorShape.as_list"></a>
+#### `tf.TensorShape.as_list()` {#TensorShape.as_list}
Returns a list of integers or None for each dimension.
- - -
-#### `tf.TensorShape.is_compatible_with(other)` <a class="md-anchor" id="TensorShape.is_compatible_with"></a>
+#### `tf.TensorShape.is_compatible_with(other)` {#TensorShape.is_compatible_with}
Returns True iff `self` is compatible with `other`.
@@ -1771,19 +1740,19 @@ TensorShape(None), and TensorShape(None) is compatible with
TensorShape([4, 4]), but TensorShape([32, 784]) is not compatible with
TensorShape([4, 4]).
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`other`</b>: Another TensorShape.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
True iff `self` is compatible with `other`.
- - -
-#### `tf.TensorShape.is_fully_defined()` <a class="md-anchor" id="TensorShape.is_fully_defined"></a>
+#### `tf.TensorShape.is_fully_defined()` {#TensorShape.is_fully_defined}
Returns True iff `self` is fully defined in every dimension.
@@ -1791,23 +1760,23 @@ Returns True iff `self` is fully defined in every dimension.
- - -
-#### `tf.TensorShape.with_rank(rank)` <a class="md-anchor" id="TensorShape.with_rank"></a>
+#### `tf.TensorShape.with_rank(rank)` {#TensorShape.with_rank}
Returns a shape based on `self` with the given rank.
This method promotes a completely unknown shape to one with a
known rank.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`rank`</b>: An integer.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A shape that is at least as specific as `self` with the given rank.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`ValueError`</b>: If `self` does not represent a shape with the given `rank`.
@@ -1815,21 +1784,21 @@ known rank.
- - -
-#### `tf.TensorShape.with_rank_at_least(rank)` <a class="md-anchor" id="TensorShape.with_rank_at_least"></a>
+#### `tf.TensorShape.with_rank_at_least(rank)` {#TensorShape.with_rank_at_least}
Returns a shape based on `self` with at least the given rank.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`rank`</b>: An integer.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A shape that is at least as specific as `self` with at least the given
rank.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`ValueError`</b>: If `self` does not represent a shape with at least the given
@@ -1838,21 +1807,21 @@ Returns a shape based on `self` with at least the given rank.
- - -
-#### `tf.TensorShape.with_rank_at_most(rank)` <a class="md-anchor" id="TensorShape.with_rank_at_most"></a>
+#### `tf.TensorShape.with_rank_at_most(rank)` {#TensorShape.with_rank_at_most}
Returns a shape based on `self` with at most the given rank.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`rank`</b>: An integer.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A shape that is at least as specific as `self` with at most the given
rank.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`ValueError`</b>: If `self` does not represent a shape with at most the given
@@ -1862,16 +1831,16 @@ Returns a shape based on `self` with at most the given rank.
- - -
-#### `tf.TensorShape.assert_has_rank(rank)` <a class="md-anchor" id="TensorShape.assert_has_rank"></a>
+#### `tf.TensorShape.assert_has_rank(rank)` {#TensorShape.assert_has_rank}
Raises an exception if `self` is not compatible with the given `rank`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`rank`</b>: An integer.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`ValueError`</b>: If `self` does not represent a shape with the given `rank`.
@@ -1879,16 +1848,16 @@ Raises an exception if `self` is not compatible with the given `rank`.
- - -
-#### `tf.TensorShape.assert_same_rank(other)` <a class="md-anchor" id="TensorShape.assert_same_rank"></a>
+#### `tf.TensorShape.assert_same_rank(other)` {#TensorShape.assert_same_rank}
Raises an exception if `self` and `other` do not have compatible ranks.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`other`</b>: Another `TensorShape`.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`ValueError`</b>: If `self` and `other` do not represent shapes with the
@@ -1897,19 +1866,19 @@ Raises an exception if `self` and `other` do not have compatible ranks.
- - -
-#### `tf.TensorShape.assert_is_compatible_with(other)` <a class="md-anchor" id="TensorShape.assert_is_compatible_with"></a>
+#### `tf.TensorShape.assert_is_compatible_with(other)` {#TensorShape.assert_is_compatible_with}
Raises exception if `self` and `other` do not represent the same shape.
This method can be used to assert that there exists a shape that both
`self` and `other` represent.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`other`</b>: Another TensorShape.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`ValueError`</b>: If `self` and `other` do not represent the same shape.
@@ -1917,25 +1886,25 @@ This method can be used to assert that there exists a shape that both
- - -
-#### `tf.TensorShape.assert_is_fully_defined()` <a class="md-anchor" id="TensorShape.assert_is_fully_defined"></a>
+#### `tf.TensorShape.assert_is_fully_defined()` {#TensorShape.assert_is_fully_defined}
Raises an exception if `self` is not fully defined in every dimension.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`ValueError`</b>: If `self` does not have a known value for every dimension.
-#### Other Methods <a class="md-anchor" id="AUTOGENERATED-other-methods"></a>
+#### Other Methods
- - -
-#### `tf.TensorShape.__init__(dims)` <a class="md-anchor" id="TensorShape.__init__"></a>
+#### `tf.TensorShape.__init__(dims)` {#TensorShape.__init__}
Creates a new TensorShape with the given dimensions.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`dims`</b>: A list of Dimensions, or None if the shape is unspecified.
@@ -1944,14 +1913,14 @@ Creates a new TensorShape with the given dimensions.
- - -
-#### `tf.TensorShape.as_dimension_list()` <a class="md-anchor" id="TensorShape.as_dimension_list"></a>
+#### `tf.TensorShape.as_dimension_list()` {#TensorShape.as_dimension_list}
DEPRECATED: use as_list().
- - -
-#### `tf.TensorShape.num_elements()` <a class="md-anchor" id="TensorShape.num_elements"></a>
+#### `tf.TensorShape.num_elements()` {#TensorShape.num_elements}
Returns the total number of elements, or none for incomplete shapes.
@@ -1959,28 +1928,28 @@ Returns the total number of elements, or none for incomplete shapes.
- - -
-### `class tf.Dimension` <a class="md-anchor" id="Dimension"></a>
+### `class tf.Dimension` {#Dimension}
Represents the value of one dimension in a TensorShape.
- - -
-#### `tf.Dimension.__init__(value)` <a class="md-anchor" id="Dimension.__init__"></a>
+#### `tf.Dimension.__init__(value)` {#Dimension.__init__}
Creates a new Dimension with the given value.
- - -
-#### `tf.Dimension.assert_is_compatible_with(other)` <a class="md-anchor" id="Dimension.assert_is_compatible_with"></a>
+#### `tf.Dimension.assert_is_compatible_with(other)` {#Dimension.assert_is_compatible_with}
Raises an exception if `other` is not compatible with this Dimension.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`other`</b>: Another Dimension.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`ValueError`</b>: If `self` and `other` are not compatible (see
@@ -1989,26 +1958,26 @@ Raises an exception if `other` is not compatible with this Dimension.
- - -
-#### `tf.Dimension.is_compatible_with(other)` <a class="md-anchor" id="Dimension.is_compatible_with"></a>
+#### `tf.Dimension.is_compatible_with(other)` {#Dimension.is_compatible_with}
Returns true if `other` is compatible with this Dimension.
Two known Dimensions are compatible if they have the same value.
An unknown Dimension is compatible with all other Dimensions.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`other`</b>: Another Dimension.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
True if this Dimension and `other` are compatible.
- - -
-#### `tf.Dimension.merge_with(other)` <a class="md-anchor" id="Dimension.merge_with"></a>
+#### `tf.Dimension.merge_with(other)` {#Dimension.merge_with}
Returns a Dimension that combines the information in `self` and `other`.
@@ -2020,17 +1989,17 @@ Dimensions are combined as follows:
Dimension(None).merge_with(Dimension(None)) == Dimension(None)
Dimension(n) .merge_with(Dimension(m)) raises ValueError for n != m
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`other`</b>: Another Dimension.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A Dimension containing the combined information of `self` and
`other`.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`ValueError`</b>: If `self` and `other` are not compatible (see
@@ -2039,14 +2008,14 @@ Dimensions are combined as follows:
- - -
-#### `tf.Dimension.value` <a class="md-anchor" id="Dimension.value"></a>
+#### `tf.Dimension.value` {#Dimension.value}
The value of this dimension, or None if it is unknown.
- - -
-### `tf.op_scope(values, name, default_name)` <a class="md-anchor" id="op_scope"></a>
+### `tf.op_scope(values, name, default_name)` {#op_scope}
Returns a context manager for use when defining a Python op.
@@ -2066,21 +2035,21 @@ def my_op(a, b, c, name=None):
return foo_op(..., name=scope)
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`values`</b>: The list of `Tensor` arguments that are passed to the op function.
* <b>`name`</b>: The name argument that is passed to the op function.
* <b>`default_name`</b>: The default name to use if the `name` argument is `None`.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A context manager for use in defining a Python op.
- - -
-### `tf.get_seed(op_seed)` <a class="md-anchor" id="get_seed"></a>
+### `tf.get_seed(op_seed)` {#get_seed}
Returns the local seeds an operation should use given an op-specific seed.
@@ -2092,12 +2061,12 @@ graph, or for only specific operations.
For details on how the graph-level seed interacts with op seeds, see
[`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed).
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`op_seed`</b>: integer.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A tuple of two integers that should be used for the local seed of this
operation.
diff --git a/tensorflow/g3doc/api_docs/python/image.md b/tensorflow/g3doc/api_docs/python/image.md
index 021dbdbbef..a2f3112032 100644
--- a/tensorflow/g3doc/api_docs/python/image.md
+++ b/tensorflow/g3doc/api_docs/python/image.md
@@ -1,47 +1,13 @@
<!-- This file is machine generated: DO NOT EDIT! -->
-# Images <a class="md-anchor" id="AUTOGENERATED-images"></a>
+# Images
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
-### [Images](#AUTOGENERATED-images)
-* [Encoding and Decoding](#AUTOGENERATED-encoding-and-decoding)
- * [`tf.image.decode_jpeg(contents, channels=None, ratio=None, fancy_upscaling=None, try_recover_truncated=None, acceptable_fraction=None, name=None)`](#decode_jpeg)
- * [`tf.image.encode_jpeg(image, format=None, quality=None, progressive=None, optimize_size=None, chroma_downsampling=None, density_unit=None, x_density=None, y_density=None, xmp_metadata=None, name=None)`](#encode_jpeg)
- * [`tf.image.decode_png(contents, channels=None, name=None)`](#decode_png)
- * [`tf.image.encode_png(image, compression=None, name=None)`](#encode_png)
-* [Resizing](#AUTOGENERATED-resizing)
- * [`tf.image.resize_images(images, new_height, new_width, method=0)`](#resize_images)
- * [`tf.image.resize_area(images, size, name=None)`](#resize_area)
- * [`tf.image.resize_bicubic(images, size, name=None)`](#resize_bicubic)
- * [`tf.image.resize_bilinear(images, size, name=None)`](#resize_bilinear)
- * [`tf.image.resize_nearest_neighbor(images, size, name=None)`](#resize_nearest_neighbor)
-* [Cropping](#AUTOGENERATED-cropping)
- * [`tf.image.resize_image_with_crop_or_pad(image, target_height, target_width)`](#resize_image_with_crop_or_pad)
- * [`tf.image.pad_to_bounding_box(image, offset_height, offset_width, target_height, target_width)`](#pad_to_bounding_box)
- * [`tf.image.crop_to_bounding_box(image, offset_height, offset_width, target_height, target_width)`](#crop_to_bounding_box)
- * [`tf.image.random_crop(image, size, seed=None, name=None)`](#random_crop)
- * [`tf.image.extract_glimpse(input, size, offsets, centered=None, normalized=None, uniform_noise=None, name=None)`](#extract_glimpse)
-* [Flipping and Transposing](#AUTOGENERATED-flipping-and-transposing)
- * [`tf.image.flip_up_down(image)`](#flip_up_down)
- * [`tf.image.random_flip_up_down(image, seed=None)`](#random_flip_up_down)
- * [`tf.image.flip_left_right(image)`](#flip_left_right)
- * [`tf.image.random_flip_left_right(image, seed=None)`](#random_flip_left_right)
- * [`tf.image.transpose_image(image)`](#transpose_image)
-* [Image Adjustments](#AUTOGENERATED-image-adjustments)
- * [`tf.image.adjust_brightness(image, delta, min_value=None, max_value=None)`](#adjust_brightness)
- * [`tf.image.random_brightness(image, max_delta, seed=None)`](#random_brightness)
- * [`tf.image.adjust_contrast(images, contrast_factor, min_value=None, max_value=None)`](#adjust_contrast)
- * [`tf.image.random_contrast(image, lower, upper, seed=None)`](#random_contrast)
- * [`tf.image.per_image_whitening(image)`](#per_image_whitening)
-
-
-<!-- TOC-END This section was generated by neural network, THANKS FOR READING! -->
-
-## Encoding and Decoding <a class="md-anchor" id="AUTOGENERATED-encoding-and-decoding"></a>
+[TOC]
+
+## Encoding and Decoding
TensorFlow provides Ops to decode and encode JPEG and PNG formats. Encoded
images are represented by scalar string Tensors, decoded images by 3-D uint8
@@ -56,7 +22,7 @@ presently only support RGB, HSV, and GrayScale.
- - -
-### `tf.image.decode_jpeg(contents, channels=None, ratio=None, fancy_upscaling=None, try_recover_truncated=None, acceptable_fraction=None, name=None)` <a class="md-anchor" id="decode_jpeg"></a>
+### `tf.image.decode_jpeg(contents, channels=None, ratio=None, fancy_upscaling=None, try_recover_truncated=None, acceptable_fraction=None, name=None)` {#decode_jpeg}
Decode a JPEG-encoded image to a uint8 tensor.
@@ -76,7 +42,7 @@ The attr `ratio` allows downscaling the image by an integer factor during
decoding. Allowed values are: 1, 2, 4, and 8. This is much faster than
downscaling the image later.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`contents`</b>: A `Tensor` of type `string`. 0-D. The JPEG-encoded image.
@@ -93,14 +59,14 @@ downscaling the image later.
input is accepted.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` of type `uint8`. 3-D with shape `[height, width, channels]`..
- - -
-### `tf.image.encode_jpeg(image, format=None, quality=None, progressive=None, optimize_size=None, chroma_downsampling=None, density_unit=None, x_density=None, y_density=None, xmp_metadata=None, name=None)` <a class="md-anchor" id="encode_jpeg"></a>
+### `tf.image.encode_jpeg(image, format=None, quality=None, progressive=None, optimize_size=None, chroma_downsampling=None, density_unit=None, x_density=None, y_density=None, xmp_metadata=None, name=None)` {#encode_jpeg}
JPEG-encode an image.
@@ -121,7 +87,7 @@ in function of the number of channels in `image`:
* 1: Output a grayscale image.
* 3: Output an RGB image.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`image`</b>: A `Tensor` of type `uint8`.
@@ -147,7 +113,7 @@ in function of the number of channels in `image`:
If not empty, embed this XMP metadata in the image header.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` of type `string`. 0-D. JPEG-encoded image.
@@ -155,7 +121,7 @@ in function of the number of channels in `image`:
- - -
-### `tf.image.decode_png(contents, channels=None, name=None)` <a class="md-anchor" id="decode_png"></a>
+### `tf.image.decode_png(contents, channels=None, name=None)` {#decode_png}
Decode a PNG-encoded image to a uint8 tensor.
@@ -172,7 +138,7 @@ Accepted values are:
If needed, the PNG-encoded image is transformed to match the requested number
of color channels.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`contents`</b>: A `Tensor` of type `string`. 0-D. The PNG-encoded image.
@@ -180,14 +146,14 @@ of color channels.
Number of color channels for the decoded image.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` of type `uint8`. 3-D with shape `[height, width, channels]`.
- - -
-### `tf.image.encode_png(image, compression=None, name=None)` <a class="md-anchor" id="encode_png"></a>
+### `tf.image.encode_png(image, compression=None, name=None)` {#encode_png}
PNG-encode an image.
@@ -202,7 +168,7 @@ The ZLIB compression level, `compression`, can be -1 for the PNG-encoder
default or a value from 0 to 9. 9 is the highest compression level, generating
the smallest output, but is slower.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`image`</b>: A `Tensor` of type `uint8`.
@@ -210,13 +176,13 @@ the smallest output, but is slower.
* <b>`compression`</b>: An optional `int`. Defaults to `-1`. Compression level.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` of type `string`. 0-D. PNG-encoded image.
-## Resizing <a class="md-anchor" id="AUTOGENERATED-resizing"></a>
+## Resizing
The resizing Ops accept input images as tensors of several types. They always
output resized images as float32 tensors.
@@ -244,7 +210,7 @@ images from the Queue.</i>
- - -
-### `tf.image.resize_images(images, new_height, new_width, method=0)` <a class="md-anchor" id="resize_images"></a>
+### `tf.image.resize_images(images, new_height, new_width, method=0)` {#resize_images}
Resize `images` to `new_width`, `new_height` using the specified `method`.
@@ -262,7 +228,7 @@ the same as `new_width`, `new_height`. To avoid distortions see
(https://en.wikipedia.org/wiki/Bicubic_interpolation)
* <b>ResizeMethod.AREA</b>: Area interpolation.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`images`</b>: 4-D Tensor of shape `[batch, height, width, channels]` or
@@ -271,14 +237,14 @@ the same as `new_width`, `new_height`. To avoid distortions see
* <b>`new_width`</b>: integer.
* <b>`method`</b>: ResizeMethod. Defaults to `ResizeMethod.BILINEAR`.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`ValueError`</b>: if the shape of `images` is incompatible with the
shape arguments to this function
* <b>`ValueError`</b>: if an unsupported resize method is specified.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
If `images` was 4-D, a 4-D float Tensor of shape
`[batch, new_height, new_width, channels]`.
@@ -289,13 +255,13 @@ the same as `new_width`, `new_height`. To avoid distortions see
- - -
-### `tf.image.resize_area(images, size, name=None)` <a class="md-anchor" id="resize_area"></a>
+### `tf.image.resize_area(images, size, name=None)` {#resize_area}
Resize `images` to `size` using area interpolation.
Input images can be of different types but output images are always float.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`images`</b>: A `Tensor`. Must be one of the following types: `uint8`, `int8`, `int32`, `float32`, `float64`.
@@ -304,7 +270,7 @@ Input images can be of different types but output images are always float.
new size for the images.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` of type `float32`. 4-D with shape
`[batch, new_height, new_width, channels]`.
@@ -312,13 +278,13 @@ Input images can be of different types but output images are always float.
- - -
-### `tf.image.resize_bicubic(images, size, name=None)` <a class="md-anchor" id="resize_bicubic"></a>
+### `tf.image.resize_bicubic(images, size, name=None)` {#resize_bicubic}
Resize `images` to `size` using bicubic interpolation.
Input images can be of different types but output images are always float.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`images`</b>: A `Tensor`. Must be one of the following types: `uint8`, `int8`, `int32`, `float32`, `float64`.
@@ -327,7 +293,7 @@ Input images can be of different types but output images are always float.
new size for the images.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` of type `float32`. 4-D with shape
`[batch, new_height, new_width, channels]`.
@@ -335,13 +301,13 @@ Input images can be of different types but output images are always float.
- - -
-### `tf.image.resize_bilinear(images, size, name=None)` <a class="md-anchor" id="resize_bilinear"></a>
+### `tf.image.resize_bilinear(images, size, name=None)` {#resize_bilinear}
Resize `images` to `size` using bilinear interpolation.
Input images can be of different types but output images are always float.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`images`</b>: A `Tensor`. Must be one of the following types: `uint8`, `int8`, `int32`, `float32`, `float64`.
@@ -350,7 +316,7 @@ Input images can be of different types but output images are always float.
new size for the images.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` of type `float32`. 4-D with shape
`[batch, new_height, new_width, channels]`.
@@ -358,13 +324,13 @@ Input images can be of different types but output images are always float.
- - -
-### `tf.image.resize_nearest_neighbor(images, size, name=None)` <a class="md-anchor" id="resize_nearest_neighbor"></a>
+### `tf.image.resize_nearest_neighbor(images, size, name=None)` {#resize_nearest_neighbor}
Resize `images` to `size` using nearest neighbor interpolation.
Input images can be of different types but output images are always float.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`images`</b>: A `Tensor`. Must be one of the following types: `uint8`, `int8`, `int32`, `float32`, `float64`.
@@ -373,7 +339,7 @@ Input images can be of different types but output images are always float.
new size for the images.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `images`. 4-D with shape
`[batch, new_height, new_width, channels]`.
@@ -381,11 +347,11 @@ Input images can be of different types but output images are always float.
-## Cropping <a class="md-anchor" id="AUTOGENERATED-cropping"></a>
+## Cropping
- - -
-### `tf.image.resize_image_with_crop_or_pad(image, target_height, target_width)` <a class="md-anchor" id="resize_image_with_crop_or_pad"></a>
+### `tf.image.resize_image_with_crop_or_pad(image, target_height, target_width)` {#resize_image_with_crop_or_pad}
Crops and/or pads an image to a target width and height.
@@ -398,19 +364,19 @@ If `width` or `height` is smaller than the specified `target_width` or
`target_height` respectively, this op centrally pads with 0 along that
dimension.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`image`</b>: 3-D tensor of shape [height, width, channels]
* <b>`target_height`</b>: Target height.
* <b>`target_width`</b>: Target width.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`ValueError`</b>: if `target_height` or `target_width` are zero or negative.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
Cropped and/or padded image of shape
`[target_height, target_width, channels]`
@@ -419,7 +385,7 @@ dimension.
- - -
-### `tf.image.pad_to_bounding_box(image, offset_height, offset_width, target_height, target_width)` <a class="md-anchor" id="pad_to_bounding_box"></a>
+### `tf.image.pad_to_bounding_box(image, offset_height, offset_width, target_height, target_width)` {#pad_to_bounding_box}
Pad `image` with zeros to the specified `height` and `width`.
@@ -430,7 +396,7 @@ with zeros until it has dimensions `target_height`, `target_width`.
This op does nothing if `offset_*` is zero and the image already has size
`target_height` by `target_width`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`image`</b>: 3-D tensor with shape `[height, width, channels]`
@@ -439,11 +405,11 @@ This op does nothing if `offset_*` is zero and the image already has size
* <b>`target_height`</b>: Height of output image.
* <b>`target_width`</b>: Width of output image.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
3-D tensor of shape `[target_height, target_width, channels]`
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`ValueError`</b>: If the shape of `image` is incompatible with the `offset_*` or
@@ -452,7 +418,7 @@ This op does nothing if `offset_*` is zero and the image already has size
- - -
-### `tf.image.crop_to_bounding_box(image, offset_height, offset_width, target_height, target_width)` <a class="md-anchor" id="crop_to_bounding_box"></a>
+### `tf.image.crop_to_bounding_box(image, offset_height, offset_width, target_height, target_width)` {#crop_to_bounding_box}
Crops an image to a specified bounding box.
@@ -461,7 +427,7 @@ returned image is at `offset_height, offset_width` in `image`, and its
lower-right corner is at
`offset_height + target_height, offset_width + target_width'.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`image`</b>: 3-D tensor with shape `[height, width, channels]`
@@ -472,11 +438,11 @@ lower-right corner is at
* <b>`target_height`</b>: Height of the result.
* <b>`target_width`</b>: Width of the result.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
3-D tensor of image with shape `[target_height, target_width, channels]`
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`ValueError`</b>: If the shape of `image` is incompatible with the `offset_*` or
@@ -485,14 +451,14 @@ lower-right corner is at
- - -
-### `tf.image.random_crop(image, size, seed=None, name=None)` <a class="md-anchor" id="random_crop"></a>
+### `tf.image.random_crop(image, size, seed=None, name=None)` {#random_crop}
Randomly crops `image` to size `[target_height, target_width]`.
The offset of the output within `image` is uniformly random. `image` always
fully contains the result.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`image`</b>: 3-D tensor of shape `[height, width, channels]`
@@ -502,14 +468,14 @@ fully contains the result.
for behavior.
* <b>`name`</b>: A name for this operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A cropped 3-D tensor of shape `[target_height, target_width, channels]`.
- - -
-### `tf.image.extract_glimpse(input, size, offsets, centered=None, normalized=None, uniform_noise=None, name=None)` <a class="md-anchor" id="extract_glimpse"></a>
+### `tf.image.extract_glimpse(input, size, offsets, centered=None, normalized=None, uniform_noise=None, name=None)` {#extract_glimpse}
Extracts a glimpse from the input tensor.
@@ -530,7 +496,7 @@ The argument `normalized` and `centered` controls how the windows are built:
lower right corner is located at (1.0, 1.0) and the center is at (0, 0).
* If the coordinates are not normalized they are interpreted as numbers of pixels.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`input`</b>: A `Tensor` of type `float32`.
@@ -553,7 +519,7 @@ The argument `normalized` and `centered` controls how the windows are built:
uniform distribution or a gaussian distribution.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` of type `float32`.
A tensor representing the glimpses `[batch_size, glimpse_height,
@@ -561,11 +527,11 @@ The argument `normalized` and `centered` controls how the windows are built:
-## Flipping and Transposing <a class="md-anchor" id="AUTOGENERATED-flipping-and-transposing"></a>
+## Flipping and Transposing
- - -
-### `tf.image.flip_up_down(image)` <a class="md-anchor" id="flip_up_down"></a>
+### `tf.image.flip_up_down(image)` {#flip_up_down}
Flip an image horizontally (upside down).
@@ -574,16 +540,16 @@ Outputs the contents of `image` flipped along the first dimension, which is
See also `reverse()`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`image`</b>: A 3-D tensor of shape `[height, width, channels].`
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A 3-D tensor of the same type and shape as `image`.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`ValueError`</b>: if the shape of `image` not supported.
@@ -591,14 +557,14 @@ See also `reverse()`.
- - -
-### `tf.image.random_flip_up_down(image, seed=None)` <a class="md-anchor" id="random_flip_up_down"></a>
+### `tf.image.random_flip_up_down(image, seed=None)` {#random_flip_up_down}
Randomly flips an image vertically (upside down).
With a 1 in 2 chance, outputs the contents of `image` flipped along the first
dimension, which is `height`. Otherwise output the image as-is.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`image`</b>: A 3-D tensor of shape `[height, width, channels].`
@@ -606,11 +572,11 @@ dimension, which is `height`. Otherwise output the image as-is.
[`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A 3-D tensor of the same type and shape as `image`.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`ValueError`</b>: if the shape of `image` not supported.
@@ -619,7 +585,7 @@ dimension, which is `height`. Otherwise output the image as-is.
- - -
-### `tf.image.flip_left_right(image)` <a class="md-anchor" id="flip_left_right"></a>
+### `tf.image.flip_left_right(image)` {#flip_left_right}
Flip an image horizontally (left to right).
@@ -628,16 +594,16 @@ Outputs the contents of `image` flipped along the second dimension, which is
See also `reverse()`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`image`</b>: A 3-D tensor of shape `[height, width, channels].`
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A 3-D tensor of the same type and shape as `image`.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`ValueError`</b>: if the shape of `image` not supported.
@@ -645,14 +611,14 @@ See also `reverse()`.
- - -
-### `tf.image.random_flip_left_right(image, seed=None)` <a class="md-anchor" id="random_flip_left_right"></a>
+### `tf.image.random_flip_left_right(image, seed=None)` {#random_flip_left_right}
Randomly flip an image horizontally (left to right).
With a 1 in 2 chance, outputs the contents of `image` flipped along the
second dimension, which is `width`. Otherwise output the image as-is.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`image`</b>: A 3-D tensor of shape `[height, width, channels].`
@@ -660,11 +626,11 @@ second dimension, which is `width`. Otherwise output the image as-is.
[`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A 3-D tensor of the same type and shape as `image`.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`ValueError`</b>: if the shape of `image` not supported.
@@ -673,29 +639,29 @@ second dimension, which is `width`. Otherwise output the image as-is.
- - -
-### `tf.image.transpose_image(image)` <a class="md-anchor" id="transpose_image"></a>
+### `tf.image.transpose_image(image)` {#transpose_image}
Transpose an image by swapping the first and second dimension.
See also `transpose()`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`image`</b>: 3-D tensor of shape `[height, width, channels]`
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A 3-D tensor of shape `[width, height, channels]`
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`ValueError`</b>: if the shape of `image` not supported.
-## Image Adjustments <a class="md-anchor" id="AUTOGENERATED-image-adjustments"></a>
+## Image Adjustments
TensorFlow provides functions to adjust images in various ways: brightness,
contrast, hue, and saturation. Each adjustment can be done with predefined
@@ -704,7 +670,7 @@ adjustments are often useful to expand a training set and reduce overfitting.
- - -
-### `tf.image.adjust_brightness(image, delta, min_value=None, max_value=None)` <a class="md-anchor" id="adjust_brightness"></a>
+### `tf.image.adjust_brightness(image, delta, min_value=None, max_value=None)` {#adjust_brightness}
Adjust the brightness of RGB or Grayscale images.
@@ -716,7 +682,7 @@ clamped to `[min_value, max_value]`. Finally, the result is cast back to
If `min_value` or `max_value` are not given, they are set to the minimum and
maximum allowed values for `image.dtype` respectively.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`image`</b>: A tensor.
@@ -724,14 +690,14 @@ maximum allowed values for `image.dtype` respectively.
* <b>`min_value`</b>: Minimum value for output.
* <b>`max_value`</b>: Maximum value for output.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A tensor of the same shape and type as `image`.
- - -
-### `tf.image.random_brightness(image, max_delta, seed=None)` <a class="md-anchor" id="random_brightness"></a>
+### `tf.image.random_brightness(image, max_delta, seed=None)` {#random_brightness}
Adjust the brightness of images by a random factor.
@@ -742,7 +708,7 @@ Note that `delta` is picked as a float. Because for integer type images,
the brightness adjusted result is rounded before casting, integer images may
have modifications in the range `[-max_delta,max_delta]`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`image`</b>: 3-D tensor of shape `[height, width, channels]`.
@@ -751,11 +717,11 @@ have modifications in the range `[-max_delta,max_delta]`.
[`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
3-D tensor of images of shape `[height, width, channels]`
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`ValueError`</b>: if max_delta is negative.
@@ -764,7 +730,7 @@ have modifications in the range `[-max_delta,max_delta]`.
- - -
-### `tf.image.adjust_contrast(images, contrast_factor, min_value=None, max_value=None)` <a class="md-anchor" id="adjust_contrast"></a>
+### `tf.image.adjust_contrast(images, contrast_factor, min_value=None, max_value=None)` {#adjust_contrast}
Adjust contrast of RGB or grayscale images.
@@ -785,7 +751,7 @@ minimum and maximum values for the data type of `images` respectively.
The contrast-adjusted image is always computed as `float`, and it is
cast back to its original type after clipping.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`images`</b>: Images to adjust. At least 3-D.
@@ -793,11 +759,11 @@ cast back to its original type after clipping.
* <b>`min_value`</b>: Minimum value for clipping the adjusted pixels.
* <b>`max_value`</b>: Maximum value for clipping the adjusted pixels.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
The constrast-adjusted image or images.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`ValueError`</b>: if the arguments are invalid.
@@ -805,14 +771,14 @@ cast back to its original type after clipping.
- - -
-### `tf.image.random_contrast(image, lower, upper, seed=None)` <a class="md-anchor" id="random_contrast"></a>
+### `tf.image.random_contrast(image, lower, upper, seed=None)` {#random_contrast}
Adjust the contrase of an image by a random factor.
Equivalent to `adjust_constrast()` but uses a `contrast_factor` randomly
picked in the interval `[lower, upper]`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`image`</b>: 3-D tensor of shape `[height, width, channels]`.
@@ -822,11 +788,11 @@ picked in the interval `[lower, upper]`.
[`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
3-D tensor of shape `[height, width, channels]`.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`ValueError`</b>: if `upper <= lower` or if `lower < 0`.
@@ -835,7 +801,7 @@ picked in the interval `[lower, upper]`.
- - -
-### `tf.image.per_image_whitening(image)` <a class="md-anchor" id="per_image_whitening"></a>
+### `tf.image.per_image_whitening(image)` {#per_image_whitening}
Linearly scales `image` to have zero mean and unit norm.
@@ -850,16 +816,16 @@ Note that this implementation is limited:
* It only whitens based on the statistics of an individual image.
* It does not take into account the covariance structure.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`image`</b>: 3-D tensor of shape `[height, width, channels]`.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
The whitened image with same shape as `image`.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`ValueError`</b>: if the shape of 'image' is incompatible with this function.
diff --git a/tensorflow/g3doc/api_docs/python/index.md b/tensorflow/g3doc/api_docs/python/index.md
index f104011ee6..081a44047d 100644
--- a/tensorflow/g3doc/api_docs/python/index.md
+++ b/tensorflow/g3doc/api_docs/python/index.md
@@ -1,6 +1,6 @@
<!-- This file is machine generated: DO NOT EDIT! -->
-# TensorFlow Python reference documentation <a class="md-anchor" id="AUTOGENERATED-tensorflow-python-reference-documentation"></a>
+# TensorFlow Python reference documentation
* **[Building Graphs](../../api_docs/python/framework.md)**:
* [`add_to_collection`](../../api_docs/python/framework.md#add_to_collection)
diff --git a/tensorflow/g3doc/api_docs/python/io_ops.md b/tensorflow/g3doc/api_docs/python/io_ops.md
index b10cc79bc8..ca1c3c6788 100644
--- a/tensorflow/g3doc/api_docs/python/io_ops.md
+++ b/tensorflow/g3doc/api_docs/python/io_ops.md
@@ -1,52 +1,13 @@
<!-- This file is machine generated: DO NOT EDIT! -->
-# Inputs and Readers <a class="md-anchor" id="AUTOGENERATED-inputs-and-readers"></a>
+# Inputs and Readers
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
-### [Inputs and Readers](#AUTOGENERATED-inputs-and-readers)
-* [Placeholders](#AUTOGENERATED-placeholders)
- * [`tf.placeholder(dtype, shape=None, name=None)`](#placeholder)
-* [Readers](#AUTOGENERATED-readers)
- * [`class tf.ReaderBase`](#ReaderBase)
- * [`class tf.TextLineReader`](#TextLineReader)
- * [`class tf.WholeFileReader`](#WholeFileReader)
- * [`class tf.IdentityReader`](#IdentityReader)
- * [`class tf.TFRecordReader`](#TFRecordReader)
- * [`class tf.FixedLengthRecordReader`](#FixedLengthRecordReader)
-* [Converting](#AUTOGENERATED-converting)
- * [`tf.decode_csv(records, record_defaults, field_delim=None, name=None)`](#decode_csv)
- * [`tf.decode_raw(bytes, out_type, little_endian=None, name=None)`](#decode_raw)
- * [Example protocol buffer](#AUTOGENERATED-example-protocol-buffer)
- * [`tf.parse_example(serialized, names=None, sparse_keys=None, sparse_types=None, dense_keys=None, dense_types=None, dense_defaults=None, dense_shapes=None, name='ParseExample')`](#parse_example)
- * [`tf.parse_single_example(serialized, names=None, sparse_keys=None, sparse_types=None, dense_keys=None, dense_types=None, dense_defaults=None, dense_shapes=None, name='ParseSingleExample')`](#parse_single_example)
-* [Queues](#AUTOGENERATED-queues)
- * [`class tf.QueueBase`](#QueueBase)
- * [`class tf.FIFOQueue`](#FIFOQueue)
- * [`class tf.RandomShuffleQueue`](#RandomShuffleQueue)
-* [Dealing with the filesystem](#AUTOGENERATED-dealing-with-the-filesystem)
- * [`tf.matching_files(pattern, name=None)`](#matching_files)
- * [`tf.read_file(filename, name=None)`](#read_file)
-* [Input pipeline](#AUTOGENERATED-input-pipeline)
- * [Beginning of an input pipeline](#AUTOGENERATED-beginning-of-an-input-pipeline)
- * [`tf.train.match_filenames_once(pattern, name=None)`](#match_filenames_once)
- * [`tf.train.limit_epochs(tensor, num_epochs=None, name=None)`](#limit_epochs)
- * [`tf.train.range_input_producer(limit, num_epochs=None, shuffle=True, seed=None, capacity=32, name=None)`](#range_input_producer)
- * [`tf.train.slice_input_producer(tensor_list, num_epochs=None, shuffle=True, seed=None, capacity=32, name=None)`](#slice_input_producer)
- * [`tf.train.string_input_producer(string_tensor, num_epochs=None, shuffle=True, seed=None, capacity=32, name=None)`](#string_input_producer)
- * [Batching at the end of an input pipeline](#AUTOGENERATED-batching-at-the-end-of-an-input-pipeline)
- * [`tf.train.batch(tensor_list, batch_size, num_threads=1, capacity=32, enqueue_many=False, shapes=None, name=None)`](#batch)
- * [`tf.train.batch_join(tensor_list_list, batch_size, capacity=32, enqueue_many=False, shapes=None, name=None)`](#batch_join)
- * [`tf.train.shuffle_batch(tensor_list, batch_size, capacity, min_after_dequeue, num_threads=1, seed=None, enqueue_many=False, shapes=None, name=None)`](#shuffle_batch)
- * [`tf.train.shuffle_batch_join(tensor_list_list, batch_size, capacity, min_after_dequeue, seed=None, enqueue_many=False, shapes=None, name=None)`](#shuffle_batch_join)
-
-
-<!-- TOC-END This section was generated by neural network, THANKS FOR READING! -->
-
-## Placeholders <a class="md-anchor" id="AUTOGENERATED-placeholders"></a>
+[TOC]
+
+## Placeholders
TensorFlow provides a placeholder operation that must be fed with data
on execution. For more info, see the section on [Feeding
@@ -54,7 +15,7 @@ data](../../how_tos/reading_data/index.md#feeding).
- - -
-### `tf.placeholder(dtype, shape=None, name=None)` <a class="md-anchor" id="placeholder"></a>
+### `tf.placeholder(dtype, shape=None, name=None)` {#placeholder}
Inserts a placeholder for a tensor that will be always fed.
@@ -75,7 +36,7 @@ with tf.Session() as sess:
print sess.run(y, feed_dict={x: rand_array}) # Will succeed.
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`dtype`</b>: The type of elements in the tensor to be fed.
@@ -83,14 +44,14 @@ with tf.Session() as sess:
specified, you can feed a tensor of any shape.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` that may be used as a handle for feeding a value, but not
evaluated directly.
-## Readers <a class="md-anchor" id="AUTOGENERATED-readers"></a>
+## Readers
TensorFlow provides a set of Reader classes for reading data formats.
For more information on inputs and readers, see [Reading
@@ -98,7 +59,7 @@ data](../../how_tos/reading_data/index.md).
- - -
-### `class tf.ReaderBase` <a class="md-anchor" id="ReaderBase"></a>
+### `class tf.ReaderBase` {#ReaderBase}
Base class for different Reader types, that produce a record every step.
@@ -114,11 +75,11 @@ it is asked to produce a record (via Read()) but it has finished the
last work unit.
- - -
-#### `tf.ReaderBase.__init__(reader_ref, supports_serialize=False)` <a class="md-anchor" id="ReaderBase.__init__"></a>
+#### `tf.ReaderBase.__init__(reader_ref, supports_serialize=False)` {#ReaderBase.__init__}
Creates a new ReaderBase.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`reader_ref`</b>: The operation that implements the reader.
@@ -128,42 +89,42 @@ Creates a new ReaderBase.
- - -
-#### `tf.ReaderBase.num_records_produced(name=None)` <a class="md-anchor" id="ReaderBase.num_records_produced"></a>
+#### `tf.ReaderBase.num_records_produced(name=None)` {#ReaderBase.num_records_produced}
Returns the number of records this reader has produced.
This is the same as the number of Read executions that have
succeeded.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
An int64 Tensor.
- - -
-#### `tf.ReaderBase.num_work_units_completed(name=None)` <a class="md-anchor" id="ReaderBase.num_work_units_completed"></a>
+#### `tf.ReaderBase.num_work_units_completed(name=None)` {#ReaderBase.num_work_units_completed}
Returns the number of work units this reader has finished processing.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
An int64 Tensor.
- - -
-#### `tf.ReaderBase.read(queue, name=None)` <a class="md-anchor" id="ReaderBase.read"></a>
+#### `tf.ReaderBase.read(queue, name=None)` {#ReaderBase.read}
Returns the next record (key, value pair) produced by a reader.
@@ -171,14 +132,14 @@ Will dequeue a work unit from queue if necessary (e.g. when the
Reader needs to start reading from a new file since it has
finished with the previous file).
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`queue`</b>: A Queue or a mutable string Tensor representing a handle
to a Queue, with string work items.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A tuple of Tensors (key, value).
@@ -188,76 +149,76 @@ finished with the previous file).
- - -
-#### `tf.ReaderBase.reader_ref` <a class="md-anchor" id="ReaderBase.reader_ref"></a>
+#### `tf.ReaderBase.reader_ref` {#ReaderBase.reader_ref}
Op that implements the reader.
- - -
-#### `tf.ReaderBase.reset(name=None)` <a class="md-anchor" id="ReaderBase.reset"></a>
+#### `tf.ReaderBase.reset(name=None)` {#ReaderBase.reset}
Restore a reader to its initial clean state.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
The created Operation.
- - -
-#### `tf.ReaderBase.restore_state(state, name=None)` <a class="md-anchor" id="ReaderBase.restore_state"></a>
+#### `tf.ReaderBase.restore_state(state, name=None)` {#ReaderBase.restore_state}
Restore a reader to a previously saved state.
Not all Readers support being restored, so this can produce an
Unimplemented error.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`state`</b>: A string Tensor.
Result of a SerializeState of a Reader with matching type.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
The created Operation.
- - -
-#### `tf.ReaderBase.serialize_state(name=None)` <a class="md-anchor" id="ReaderBase.serialize_state"></a>
+#### `tf.ReaderBase.serialize_state(name=None)` {#ReaderBase.serialize_state}
Produce a string tensor that encodes the state of a reader.
Not all Readers support being serialized, so this can produce an
Unimplemented error.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A string Tensor.
- - -
-#### `tf.ReaderBase.supports_serialize` <a class="md-anchor" id="ReaderBase.supports_serialize"></a>
+#### `tf.ReaderBase.supports_serialize` {#ReaderBase.supports_serialize}
Whether the Reader implementation can serialize its state.
- - -
-### `class tf.TextLineReader` <a class="md-anchor" id="TextLineReader"></a>
+### `class tf.TextLineReader` {#TextLineReader}
A Reader that outputs the lines of a file delimited by newlines.
@@ -265,11 +226,11 @@ Newlines are stripped from the output.
See ReaderBase for supported methods.
- - -
-#### `tf.TextLineReader.__init__(skip_header_lines=None, name=None)` <a class="md-anchor" id="TextLineReader.__init__"></a>
+#### `tf.TextLineReader.__init__(skip_header_lines=None, name=None)` {#TextLineReader.__init__}
Create a TextLineReader.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`skip_header_lines`</b>: An optional int. Defaults to 0. Number of lines
@@ -279,42 +240,42 @@ Create a TextLineReader.
- - -
-#### `tf.TextLineReader.num_records_produced(name=None)` <a class="md-anchor" id="TextLineReader.num_records_produced"></a>
+#### `tf.TextLineReader.num_records_produced(name=None)` {#TextLineReader.num_records_produced}
Returns the number of records this reader has produced.
This is the same as the number of Read executions that have
succeeded.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
An int64 Tensor.
- - -
-#### `tf.TextLineReader.num_work_units_completed(name=None)` <a class="md-anchor" id="TextLineReader.num_work_units_completed"></a>
+#### `tf.TextLineReader.num_work_units_completed(name=None)` {#TextLineReader.num_work_units_completed}
Returns the number of work units this reader has finished processing.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
An int64 Tensor.
- - -
-#### `tf.TextLineReader.read(queue, name=None)` <a class="md-anchor" id="TextLineReader.read"></a>
+#### `tf.TextLineReader.read(queue, name=None)` {#TextLineReader.read}
Returns the next record (key, value pair) produced by a reader.
@@ -322,14 +283,14 @@ Will dequeue a work unit from queue if necessary (e.g. when the
Reader needs to start reading from a new file since it has
finished with the previous file).
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`queue`</b>: A Queue or a mutable string Tensor representing a handle
to a Queue, with string work items.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A tuple of Tensors (key, value).
@@ -339,76 +300,76 @@ finished with the previous file).
- - -
-#### `tf.TextLineReader.reader_ref` <a class="md-anchor" id="TextLineReader.reader_ref"></a>
+#### `tf.TextLineReader.reader_ref` {#TextLineReader.reader_ref}
Op that implements the reader.
- - -
-#### `tf.TextLineReader.reset(name=None)` <a class="md-anchor" id="TextLineReader.reset"></a>
+#### `tf.TextLineReader.reset(name=None)` {#TextLineReader.reset}
Restore a reader to its initial clean state.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
The created Operation.
- - -
-#### `tf.TextLineReader.restore_state(state, name=None)` <a class="md-anchor" id="TextLineReader.restore_state"></a>
+#### `tf.TextLineReader.restore_state(state, name=None)` {#TextLineReader.restore_state}
Restore a reader to a previously saved state.
Not all Readers support being restored, so this can produce an
Unimplemented error.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`state`</b>: A string Tensor.
Result of a SerializeState of a Reader with matching type.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
The created Operation.
- - -
-#### `tf.TextLineReader.serialize_state(name=None)` <a class="md-anchor" id="TextLineReader.serialize_state"></a>
+#### `tf.TextLineReader.serialize_state(name=None)` {#TextLineReader.serialize_state}
Produce a string tensor that encodes the state of a reader.
Not all Readers support being serialized, so this can produce an
Unimplemented error.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A string Tensor.
- - -
-#### `tf.TextLineReader.supports_serialize` <a class="md-anchor" id="TextLineReader.supports_serialize"></a>
+#### `tf.TextLineReader.supports_serialize` {#TextLineReader.supports_serialize}
Whether the Reader implementation can serialize its state.
- - -
-### `class tf.WholeFileReader` <a class="md-anchor" id="WholeFileReader"></a>
+### `class tf.WholeFileReader` {#WholeFileReader}
A Reader that outputs the entire contents of a file as a value.
@@ -418,11 +379,11 @@ be a filename (key) and the contents of that file (value).
See ReaderBase for supported methods.
- - -
-#### `tf.WholeFileReader.__init__(name=None)` <a class="md-anchor" id="WholeFileReader.__init__"></a>
+#### `tf.WholeFileReader.__init__(name=None)` {#WholeFileReader.__init__}
Create a WholeFileReader.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`name`</b>: A name for the operation (optional).
@@ -430,42 +391,42 @@ Create a WholeFileReader.
- - -
-#### `tf.WholeFileReader.num_records_produced(name=None)` <a class="md-anchor" id="WholeFileReader.num_records_produced"></a>
+#### `tf.WholeFileReader.num_records_produced(name=None)` {#WholeFileReader.num_records_produced}
Returns the number of records this reader has produced.
This is the same as the number of Read executions that have
succeeded.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
An int64 Tensor.
- - -
-#### `tf.WholeFileReader.num_work_units_completed(name=None)` <a class="md-anchor" id="WholeFileReader.num_work_units_completed"></a>
+#### `tf.WholeFileReader.num_work_units_completed(name=None)` {#WholeFileReader.num_work_units_completed}
Returns the number of work units this reader has finished processing.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
An int64 Tensor.
- - -
-#### `tf.WholeFileReader.read(queue, name=None)` <a class="md-anchor" id="WholeFileReader.read"></a>
+#### `tf.WholeFileReader.read(queue, name=None)` {#WholeFileReader.read}
Returns the next record (key, value pair) produced by a reader.
@@ -473,14 +434,14 @@ Will dequeue a work unit from queue if necessary (e.g. when the
Reader needs to start reading from a new file since it has
finished with the previous file).
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`queue`</b>: A Queue or a mutable string Tensor representing a handle
to a Queue, with string work items.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A tuple of Tensors (key, value).
@@ -490,76 +451,76 @@ finished with the previous file).
- - -
-#### `tf.WholeFileReader.reader_ref` <a class="md-anchor" id="WholeFileReader.reader_ref"></a>
+#### `tf.WholeFileReader.reader_ref` {#WholeFileReader.reader_ref}
Op that implements the reader.
- - -
-#### `tf.WholeFileReader.reset(name=None)` <a class="md-anchor" id="WholeFileReader.reset"></a>
+#### `tf.WholeFileReader.reset(name=None)` {#WholeFileReader.reset}
Restore a reader to its initial clean state.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
The created Operation.
- - -
-#### `tf.WholeFileReader.restore_state(state, name=None)` <a class="md-anchor" id="WholeFileReader.restore_state"></a>
+#### `tf.WholeFileReader.restore_state(state, name=None)` {#WholeFileReader.restore_state}
Restore a reader to a previously saved state.
Not all Readers support being restored, so this can produce an
Unimplemented error.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`state`</b>: A string Tensor.
Result of a SerializeState of a Reader with matching type.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
The created Operation.
- - -
-#### `tf.WholeFileReader.serialize_state(name=None)` <a class="md-anchor" id="WholeFileReader.serialize_state"></a>
+#### `tf.WholeFileReader.serialize_state(name=None)` {#WholeFileReader.serialize_state}
Produce a string tensor that encodes the state of a reader.
Not all Readers support being serialized, so this can produce an
Unimplemented error.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A string Tensor.
- - -
-#### `tf.WholeFileReader.supports_serialize` <a class="md-anchor" id="WholeFileReader.supports_serialize"></a>
+#### `tf.WholeFileReader.supports_serialize` {#WholeFileReader.supports_serialize}
Whether the Reader implementation can serialize its state.
- - -
-### `class tf.IdentityReader` <a class="md-anchor" id="IdentityReader"></a>
+### `class tf.IdentityReader` {#IdentityReader}
A Reader that outputs the queued work as both the key and value.
@@ -569,11 +530,11 @@ work string and output (work, work).
See ReaderBase for supported methods.
- - -
-#### `tf.IdentityReader.__init__(name=None)` <a class="md-anchor" id="IdentityReader.__init__"></a>
+#### `tf.IdentityReader.__init__(name=None)` {#IdentityReader.__init__}
Create a IdentityReader.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`name`</b>: A name for the operation (optional).
@@ -581,42 +542,42 @@ Create a IdentityReader.
- - -
-#### `tf.IdentityReader.num_records_produced(name=None)` <a class="md-anchor" id="IdentityReader.num_records_produced"></a>
+#### `tf.IdentityReader.num_records_produced(name=None)` {#IdentityReader.num_records_produced}
Returns the number of records this reader has produced.
This is the same as the number of Read executions that have
succeeded.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
An int64 Tensor.
- - -
-#### `tf.IdentityReader.num_work_units_completed(name=None)` <a class="md-anchor" id="IdentityReader.num_work_units_completed"></a>
+#### `tf.IdentityReader.num_work_units_completed(name=None)` {#IdentityReader.num_work_units_completed}
Returns the number of work units this reader has finished processing.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
An int64 Tensor.
- - -
-#### `tf.IdentityReader.read(queue, name=None)` <a class="md-anchor" id="IdentityReader.read"></a>
+#### `tf.IdentityReader.read(queue, name=None)` {#IdentityReader.read}
Returns the next record (key, value pair) produced by a reader.
@@ -624,14 +585,14 @@ Will dequeue a work unit from queue if necessary (e.g. when the
Reader needs to start reading from a new file since it has
finished with the previous file).
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`queue`</b>: A Queue or a mutable string Tensor representing a handle
to a Queue, with string work items.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A tuple of Tensors (key, value).
@@ -641,87 +602,87 @@ finished with the previous file).
- - -
-#### `tf.IdentityReader.reader_ref` <a class="md-anchor" id="IdentityReader.reader_ref"></a>
+#### `tf.IdentityReader.reader_ref` {#IdentityReader.reader_ref}
Op that implements the reader.
- - -
-#### `tf.IdentityReader.reset(name=None)` <a class="md-anchor" id="IdentityReader.reset"></a>
+#### `tf.IdentityReader.reset(name=None)` {#IdentityReader.reset}
Restore a reader to its initial clean state.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
The created Operation.
- - -
-#### `tf.IdentityReader.restore_state(state, name=None)` <a class="md-anchor" id="IdentityReader.restore_state"></a>
+#### `tf.IdentityReader.restore_state(state, name=None)` {#IdentityReader.restore_state}
Restore a reader to a previously saved state.
Not all Readers support being restored, so this can produce an
Unimplemented error.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`state`</b>: A string Tensor.
Result of a SerializeState of a Reader with matching type.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
The created Operation.
- - -
-#### `tf.IdentityReader.serialize_state(name=None)` <a class="md-anchor" id="IdentityReader.serialize_state"></a>
+#### `tf.IdentityReader.serialize_state(name=None)` {#IdentityReader.serialize_state}
Produce a string tensor that encodes the state of a reader.
Not all Readers support being serialized, so this can produce an
Unimplemented error.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A string Tensor.
- - -
-#### `tf.IdentityReader.supports_serialize` <a class="md-anchor" id="IdentityReader.supports_serialize"></a>
+#### `tf.IdentityReader.supports_serialize` {#IdentityReader.supports_serialize}
Whether the Reader implementation can serialize its state.
- - -
-### `class tf.TFRecordReader` <a class="md-anchor" id="TFRecordReader"></a>
+### `class tf.TFRecordReader` {#TFRecordReader}
A Reader that outputs the records from a TFRecords file.
See ReaderBase for supported methods.
- - -
-#### `tf.TFRecordReader.__init__(name=None)` <a class="md-anchor" id="TFRecordReader.__init__"></a>
+#### `tf.TFRecordReader.__init__(name=None)` {#TFRecordReader.__init__}
Create a TFRecordReader.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`name`</b>: A name for the operation (optional).
@@ -729,42 +690,42 @@ Create a TFRecordReader.
- - -
-#### `tf.TFRecordReader.num_records_produced(name=None)` <a class="md-anchor" id="TFRecordReader.num_records_produced"></a>
+#### `tf.TFRecordReader.num_records_produced(name=None)` {#TFRecordReader.num_records_produced}
Returns the number of records this reader has produced.
This is the same as the number of Read executions that have
succeeded.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
An int64 Tensor.
- - -
-#### `tf.TFRecordReader.num_work_units_completed(name=None)` <a class="md-anchor" id="TFRecordReader.num_work_units_completed"></a>
+#### `tf.TFRecordReader.num_work_units_completed(name=None)` {#TFRecordReader.num_work_units_completed}
Returns the number of work units this reader has finished processing.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
An int64 Tensor.
- - -
-#### `tf.TFRecordReader.read(queue, name=None)` <a class="md-anchor" id="TFRecordReader.read"></a>
+#### `tf.TFRecordReader.read(queue, name=None)` {#TFRecordReader.read}
Returns the next record (key, value pair) produced by a reader.
@@ -772,14 +733,14 @@ Will dequeue a work unit from queue if necessary (e.g. when the
Reader needs to start reading from a new file since it has
finished with the previous file).
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`queue`</b>: A Queue or a mutable string Tensor representing a handle
to a Queue, with string work items.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A tuple of Tensors (key, value).
@@ -789,87 +750,87 @@ finished with the previous file).
- - -
-#### `tf.TFRecordReader.reader_ref` <a class="md-anchor" id="TFRecordReader.reader_ref"></a>
+#### `tf.TFRecordReader.reader_ref` {#TFRecordReader.reader_ref}
Op that implements the reader.
- - -
-#### `tf.TFRecordReader.reset(name=None)` <a class="md-anchor" id="TFRecordReader.reset"></a>
+#### `tf.TFRecordReader.reset(name=None)` {#TFRecordReader.reset}
Restore a reader to its initial clean state.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
The created Operation.
- - -
-#### `tf.TFRecordReader.restore_state(state, name=None)` <a class="md-anchor" id="TFRecordReader.restore_state"></a>
+#### `tf.TFRecordReader.restore_state(state, name=None)` {#TFRecordReader.restore_state}
Restore a reader to a previously saved state.
Not all Readers support being restored, so this can produce an
Unimplemented error.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`state`</b>: A string Tensor.
Result of a SerializeState of a Reader with matching type.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
The created Operation.
- - -
-#### `tf.TFRecordReader.serialize_state(name=None)` <a class="md-anchor" id="TFRecordReader.serialize_state"></a>
+#### `tf.TFRecordReader.serialize_state(name=None)` {#TFRecordReader.serialize_state}
Produce a string tensor that encodes the state of a reader.
Not all Readers support being serialized, so this can produce an
Unimplemented error.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A string Tensor.
- - -
-#### `tf.TFRecordReader.supports_serialize` <a class="md-anchor" id="TFRecordReader.supports_serialize"></a>
+#### `tf.TFRecordReader.supports_serialize` {#TFRecordReader.supports_serialize}
Whether the Reader implementation can serialize its state.
- - -
-### `class tf.FixedLengthRecordReader` <a class="md-anchor" id="FixedLengthRecordReader"></a>
+### `class tf.FixedLengthRecordReader` {#FixedLengthRecordReader}
A Reader that outputs fixed-length records from a file.
See ReaderBase for supported methods.
- - -
-#### `tf.FixedLengthRecordReader.__init__(record_bytes, header_bytes=None, footer_bytes=None, name=None)` <a class="md-anchor" id="FixedLengthRecordReader.__init__"></a>
+#### `tf.FixedLengthRecordReader.__init__(record_bytes, header_bytes=None, footer_bytes=None, name=None)` {#FixedLengthRecordReader.__init__}
Create a FixedLengthRecordReader.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`record_bytes`</b>: An int.
@@ -880,42 +841,42 @@ Create a FixedLengthRecordReader.
- - -
-#### `tf.FixedLengthRecordReader.num_records_produced(name=None)` <a class="md-anchor" id="FixedLengthRecordReader.num_records_produced"></a>
+#### `tf.FixedLengthRecordReader.num_records_produced(name=None)` {#FixedLengthRecordReader.num_records_produced}
Returns the number of records this reader has produced.
This is the same as the number of Read executions that have
succeeded.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
An int64 Tensor.
- - -
-#### `tf.FixedLengthRecordReader.num_work_units_completed(name=None)` <a class="md-anchor" id="FixedLengthRecordReader.num_work_units_completed"></a>
+#### `tf.FixedLengthRecordReader.num_work_units_completed(name=None)` {#FixedLengthRecordReader.num_work_units_completed}
Returns the number of work units this reader has finished processing.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
An int64 Tensor.
- - -
-#### `tf.FixedLengthRecordReader.read(queue, name=None)` <a class="md-anchor" id="FixedLengthRecordReader.read"></a>
+#### `tf.FixedLengthRecordReader.read(queue, name=None)` {#FixedLengthRecordReader.read}
Returns the next record (key, value pair) produced by a reader.
@@ -923,14 +884,14 @@ Will dequeue a work unit from queue if necessary (e.g. when the
Reader needs to start reading from a new file since it has
finished with the previous file).
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`queue`</b>: A Queue or a mutable string Tensor representing a handle
to a Queue, with string work items.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A tuple of Tensors (key, value).
@@ -940,82 +901,82 @@ finished with the previous file).
- - -
-#### `tf.FixedLengthRecordReader.reader_ref` <a class="md-anchor" id="FixedLengthRecordReader.reader_ref"></a>
+#### `tf.FixedLengthRecordReader.reader_ref` {#FixedLengthRecordReader.reader_ref}
Op that implements the reader.
- - -
-#### `tf.FixedLengthRecordReader.reset(name=None)` <a class="md-anchor" id="FixedLengthRecordReader.reset"></a>
+#### `tf.FixedLengthRecordReader.reset(name=None)` {#FixedLengthRecordReader.reset}
Restore a reader to its initial clean state.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
The created Operation.
- - -
-#### `tf.FixedLengthRecordReader.restore_state(state, name=None)` <a class="md-anchor" id="FixedLengthRecordReader.restore_state"></a>
+#### `tf.FixedLengthRecordReader.restore_state(state, name=None)` {#FixedLengthRecordReader.restore_state}
Restore a reader to a previously saved state.
Not all Readers support being restored, so this can produce an
Unimplemented error.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`state`</b>: A string Tensor.
Result of a SerializeState of a Reader with matching type.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
The created Operation.
- - -
-#### `tf.FixedLengthRecordReader.serialize_state(name=None)` <a class="md-anchor" id="FixedLengthRecordReader.serialize_state"></a>
+#### `tf.FixedLengthRecordReader.serialize_state(name=None)` {#FixedLengthRecordReader.serialize_state}
Produce a string tensor that encodes the state of a reader.
Not all Readers support being serialized, so this can produce an
Unimplemented error.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A string Tensor.
- - -
-#### `tf.FixedLengthRecordReader.supports_serialize` <a class="md-anchor" id="FixedLengthRecordReader.supports_serialize"></a>
+#### `tf.FixedLengthRecordReader.supports_serialize` {#FixedLengthRecordReader.supports_serialize}
Whether the Reader implementation can serialize its state.
-## Converting <a class="md-anchor" id="AUTOGENERATED-converting"></a>
+## Converting
TensorFlow provides several operations that you can use to convert various data
formats into tensors.
- - -
-### `tf.decode_csv(records, record_defaults, field_delim=None, name=None)` <a class="md-anchor" id="decode_csv"></a>
+### `tf.decode_csv(records, record_defaults, field_delim=None, name=None)` {#decode_csv}
Convert CSV records to tensors. Each column maps to one tensor.
@@ -1023,7 +984,7 @@ RFC 4180 format is expected for the CSV records.
(https://tools.ietf.org/html/rfc4180)
Note that we allow leading and trailing spaces with int or float field.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`records`</b>: A `Tensor` of type `string`.
@@ -1036,7 +997,7 @@ Note that we allow leading and trailing spaces with int or float field.
delimiter to separate fields in a record.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A list of `Tensor` objects. Has the same type as `record_defaults`.
Each tensor will have the same shape as records.
@@ -1044,11 +1005,11 @@ Note that we allow leading and trailing spaces with int or float field.
- - -
-### `tf.decode_raw(bytes, out_type, little_endian=None, name=None)` <a class="md-anchor" id="decode_raw"></a>
+### `tf.decode_raw(bytes, out_type, little_endian=None, name=None)` {#decode_raw}
Reinterpret the bytes of a string as a vector of numbers.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`bytes`</b>: A `Tensor` of type `string`.
@@ -1059,7 +1020,7 @@ Reinterpret the bytes of a string as a vector of numbers.
Ignored for out_types that are stored in a single byte like uint8.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` of type `out_type`.
A Tensor with one more dimension than the input bytes. The
@@ -1070,7 +1031,7 @@ Reinterpret the bytes of a string as a vector of numbers.
- - -
-### Example protocol buffer <a class="md-anchor" id="AUTOGENERATED-example-protocol-buffer"></a>
+### Example protocol buffer
TensorFlow's [recommended format for training
examples](../../how_tos/reading_data/index.md#standard-tensorflow-format)
@@ -1081,7 +1042,7 @@ here](https://tensorflow.googlesource.com/tensorflow/+/master/tensorflow/core/ex
- - -
-### `tf.parse_example(serialized, names=None, sparse_keys=None, sparse_types=None, dense_keys=None, dense_types=None, dense_defaults=None, dense_shapes=None, name='ParseExample')` <a class="md-anchor" id="parse_example"></a>
+### `tf.parse_example(serialized, names=None, sparse_keys=None, sparse_types=None, dense_keys=None, dense_types=None, dense_defaults=None, dense_shapes=None, name='ParseExample')` {#parse_example}
Parses `Example` protos.
@@ -1220,7 +1181,7 @@ And the expected output is:
}
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`serialized`</b>: A vector (1-D Tensor) of strings, a batch of binary
@@ -1243,11 +1204,11 @@ And the expected output is:
The shape of the data for each dense feature referenced by `dense_keys`.
* <b>`name`</b>: A name for this operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `dict` mapping keys to `Tensor`s and `SparseTensor`s.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`ValueError`</b>: If sparse and dense key sets intersect, or input lengths do not
@@ -1256,7 +1217,7 @@ And the expected output is:
- - -
-### `tf.parse_single_example(serialized, names=None, sparse_keys=None, sparse_types=None, dense_keys=None, dense_types=None, dense_defaults=None, dense_shapes=None, name='ParseSingleExample')` <a class="md-anchor" id="parse_single_example"></a>
+### `tf.parse_single_example(serialized, names=None, sparse_keys=None, sparse_types=None, dense_keys=None, dense_types=None, dense_defaults=None, dense_shapes=None, name='ParseSingleExample')` {#parse_single_example}
Parses a single `Example` proto.
@@ -1273,7 +1234,7 @@ single element vector).
See also `parse_example`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`serialized`</b>: A scalar string Tensor, a single serialized Example.
@@ -1288,18 +1249,18 @@ See also `parse_example`.
* <b>`dense_shapes`</b>: See parse_example documentation for more details.
* <b>`name`</b>: A name for this operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A dictionary mapping keys to Tensors and SparseTensors.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`ValueError`</b>: if "scalar" or "names" have known shapes, and are not scalars.
-## Queues <a class="md-anchor" id="AUTOGENERATED-queues"></a>
+## Queues
TensorFlow provides several implementations of 'Queues', which are
structures within the TensorFlow computation graph to stage pipelines
@@ -1309,7 +1270,7 @@ Queues](../../how_tos/threading_and_queues/index.md).
- - -
-### `class tf.QueueBase` <a class="md-anchor" id="QueueBase"></a>
+### `class tf.QueueBase` {#QueueBase}
Base class for queue implementations.
@@ -1330,27 +1291,27 @@ them.
- - -
-#### `tf.QueueBase.enqueue(vals, name=None)` <a class="md-anchor" id="QueueBase.enqueue"></a>
+#### `tf.QueueBase.enqueue(vals, name=None)` {#QueueBase.enqueue}
Enqueues one element to this queue.
If the queue is full when this operation executes, it will block
until the element has been enqueued.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`vals`</b>: The tuple of `Tensor` objects to be enqueued.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
The operation that enqueues a new tuple of tensors to the queue.
- - -
-#### `tf.QueueBase.enqueue_many(vals, name=None)` <a class="md-anchor" id="QueueBase.enqueue_many"></a>
+#### `tf.QueueBase.enqueue_many(vals, name=None)` {#QueueBase.enqueue_many}
Enqueues zero or elements to this queue.
@@ -1361,14 +1322,14 @@ same size in the 0th dimension.
If the queue is full when this operation executes, it will block
until all of the elements have been enqueued.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`vals`</b>: The tensor or tuple of tensors from which the queue elements
are taken.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
The operation that enqueues a batch of tuples of tensors to the queue.
@@ -1376,26 +1337,26 @@ until all of the elements have been enqueued.
- - -
-#### `tf.QueueBase.dequeue(name=None)` <a class="md-anchor" id="QueueBase.dequeue"></a>
+#### `tf.QueueBase.dequeue(name=None)` {#QueueBase.dequeue}
Dequeues one element from this queue.
If the queue is empty when this operation executes, it will block
until there is an element to dequeue.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
The tuple of tensors that was dequeued.
- - -
-#### `tf.QueueBase.dequeue_many(n, name=None)` <a class="md-anchor" id="QueueBase.dequeue_many"></a>
+#### `tf.QueueBase.dequeue_many(n, name=None)` {#QueueBase.dequeue_many}
Dequeues and concatenates `n` elements from this queue.
@@ -1406,13 +1367,13 @@ components in the dequeued tuple will have size `n` in the 0th dimension.
If the queue contains fewer than `n` elements when this operation
executes, it will block until `n` elements have been dequeued.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`n`</b>: A scalar `Tensor` containing the number of elements to dequeue.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
The tuple of concatenated tensors that was dequeued.
@@ -1420,16 +1381,16 @@ executes, it will block until `n` elements have been dequeued.
- - -
-#### `tf.QueueBase.size(name=None)` <a class="md-anchor" id="QueueBase.size"></a>
+#### `tf.QueueBase.size(name=None)` {#QueueBase.size}
Compute the number of elements in this queue.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A scalar tensor containing the number of elements in this queue.
@@ -1437,7 +1398,7 @@ Compute the number of elements in this queue.
- - -
-#### `tf.QueueBase.close(cancel_pending_enqueues=False, name=None)` <a class="md-anchor" id="QueueBase.close"></a>
+#### `tf.QueueBase.close(cancel_pending_enqueues=False, name=None)` {#QueueBase.close}
Closes this queue.
@@ -1451,27 +1412,27 @@ that would block will fail immediately.
If `cancel_pending_enqueues` is `True`, all pending requests will also
be cancelled.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`cancel_pending_enqueues`</b>: (Optional.) A boolean, defaulting to
`False` (described above).
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
The operation that closes the queue.
-#### Other Methods <a class="md-anchor" id="AUTOGENERATED-other-methods"></a>
+#### Other Methods
- - -
-#### `tf.QueueBase.__init__(dtypes, shapes, queue_ref)` <a class="md-anchor" id="QueueBase.__init__"></a>
+#### `tf.QueueBase.__init__(dtypes, shapes, queue_ref)` {#QueueBase.__init__}
Constructs a queue object from a queue reference.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`dtypes`</b>: A list of types. The length of dtypes must equal the number
@@ -1485,26 +1446,26 @@ Constructs a queue object from a queue reference.
- - -
-#### `tf.QueueBase.dtypes` <a class="md-anchor" id="QueueBase.dtypes"></a>
+#### `tf.QueueBase.dtypes` {#QueueBase.dtypes}
The list of dtypes for each component of a queue element.
- - -
-#### `tf.QueueBase.name` <a class="md-anchor" id="QueueBase.name"></a>
+#### `tf.QueueBase.name` {#QueueBase.name}
The name of the underlying queue.
- - -
-#### `tf.QueueBase.queue_ref` <a class="md-anchor" id="QueueBase.queue_ref"></a>
+#### `tf.QueueBase.queue_ref` {#QueueBase.queue_ref}
The underlying queue reference.
- - -
-### `class tf.FIFOQueue` <a class="md-anchor" id="FIFOQueue"></a>
+### `class tf.FIFOQueue` {#FIFOQueue}
A queue implementation that dequeues elements in first-in-first out order.
@@ -1513,7 +1474,7 @@ this class.
- - -
-#### `tf.FIFOQueue.__init__(capacity, dtypes, shapes=None, shared_name=None, name='fifo_queue')` <a class="md-anchor" id="FIFOQueue.__init__"></a>
+#### `tf.FIFOQueue.__init__(capacity, dtypes, shapes=None, shared_name=None, name='fifo_queue')` {#FIFOQueue.__init__}
Creates a queue that dequeues elements in a first-in first-out order.
@@ -1530,7 +1491,7 @@ element must have the respective fixed shape. If it is
unspecified, different queue elements may have different shapes,
but the use of `dequeue_many` is disallowed.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`capacity`</b>: An integer. The upper bound on the number of elements
@@ -1547,7 +1508,7 @@ but the use of `dequeue_many` is disallowed.
- - -
-### `class tf.RandomShuffleQueue` <a class="md-anchor" id="RandomShuffleQueue"></a>
+### `class tf.RandomShuffleQueue` {#RandomShuffleQueue}
A queue implementation that dequeues elements in a random order.
@@ -1556,7 +1517,7 @@ this class.
- - -
-#### `tf.RandomShuffleQueue.__init__(capacity, min_after_dequeue, dtypes, shapes=None, seed=None, shared_name=None, name='random_shuffle_queue')` <a class="md-anchor" id="RandomShuffleQueue.__init__"></a>
+#### `tf.RandomShuffleQueue.__init__(capacity, min_after_dequeue, dtypes, shapes=None, seed=None, shared_name=None, name='random_shuffle_queue')` {#RandomShuffleQueue.__init__}
Create a queue that dequeues elements in a random order.
@@ -1582,7 +1543,7 @@ by blocking those operations until sufficient elements have been
enqueued. The `min_after_dequeue` argument is ignored after the
queue has been closed.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`capacity`</b>: An integer. The upper bound on the number of elements
@@ -1602,81 +1563,81 @@ queue has been closed.
-## Dealing with the filesystem <a class="md-anchor" id="AUTOGENERATED-dealing-with-the-filesystem"></a>
+## Dealing with the filesystem
- - -
-### `tf.matching_files(pattern, name=None)` <a class="md-anchor" id="matching_files"></a>
+### `tf.matching_files(pattern, name=None)` {#matching_files}
Returns the set of files matching a pattern.
Note that this routine only supports wildcard characters in the
basename portion of the pattern, not in the directory portion.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`pattern`</b>: A `Tensor` of type `string`. A (scalar) shell wildcard pattern.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` of type `string`. A vector of matching filenames.
- - -
-### `tf.read_file(filename, name=None)` <a class="md-anchor" id="read_file"></a>
+### `tf.read_file(filename, name=None)` {#read_file}
Reads and outputs the entire contents of the input filename.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`filename`</b>: A `Tensor` of type `string`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` of type `string`.
-## Input pipeline <a class="md-anchor" id="AUTOGENERATED-input-pipeline"></a>
+## Input pipeline
TensorFlow functions for setting up an input-prefetching pipeline.
Please see the [reading data how-to](../../how_tos/reading_data/index.md)
for context.
-### Beginning of an input pipeline <a class="md-anchor" id="AUTOGENERATED-beginning-of-an-input-pipeline"></a>
+### Beginning of an input pipeline
The "producer" functions add a queue to the graph and a corresponding
`QueueRunner` for running the subgraph that fills that queue.
- - -
-### `tf.train.match_filenames_once(pattern, name=None)` <a class="md-anchor" id="match_filenames_once"></a>
+### `tf.train.match_filenames_once(pattern, name=None)` {#match_filenames_once}
Save the list of files matching pattern, so it is only computed once.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`pattern`</b>: A file pattern (glob).
* <b>`name`</b>: A name for the operations (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A variable that is initialized to the list of files matching pattern.
- - -
-### `tf.train.limit_epochs(tensor, num_epochs=None, name=None)` <a class="md-anchor" id="limit_epochs"></a>
+### `tf.train.limit_epochs(tensor, num_epochs=None, name=None)` {#limit_epochs}
Returns tensor num_epochs times and then raises an OutOfRange error.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`tensor`</b>: Any Tensor.
@@ -1684,18 +1645,18 @@ Returns tensor num_epochs times and then raises an OutOfRange error.
of steps the output tensor may be evaluated.
* <b>`name`</b>: A name for the operations (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
tensor or OutOfRange.
- - -
-### `tf.train.range_input_producer(limit, num_epochs=None, shuffle=True, seed=None, capacity=32, name=None)` <a class="md-anchor" id="range_input_producer"></a>
+### `tf.train.range_input_producer(limit, num_epochs=None, shuffle=True, seed=None, capacity=32, name=None)` {#range_input_producer}
Produces the integers from 0 to limit-1 in a queue.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`limit`</b>: An int32 scalar tensor.
@@ -1709,7 +1670,7 @@ Produces the integers from 0 to limit-1 in a queue.
* <b>`capacity`</b>: An integer. Sets the queue capacity.
* <b>`name`</b>: A name for the operations (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A Queue with the output integers. A QueueRunner for the Queue
is added to the current Graph's QUEUE_RUNNER collection.
@@ -1717,14 +1678,14 @@ Produces the integers from 0 to limit-1 in a queue.
- - -
-### `tf.train.slice_input_producer(tensor_list, num_epochs=None, shuffle=True, seed=None, capacity=32, name=None)` <a class="md-anchor" id="slice_input_producer"></a>
+### `tf.train.slice_input_producer(tensor_list, num_epochs=None, shuffle=True, seed=None, capacity=32, name=None)` {#slice_input_producer}
Produces a slice of each Tensor in tensor_list.
Implemented using a Queue -- a QueueRunner for the Queue
is added to the current Graph's QUEUE_RUNNER collection.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`tensor_list`</b>: A list of Tensors. Every Tensor in tensor_list must
@@ -1737,7 +1698,7 @@ is added to the current Graph's QUEUE_RUNNER collection.
* <b>`capacity`</b>: An integer. Sets the queue capacity.
* <b>`name`</b>: A name for the operations (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A list of tensors, one for each element of tensor_list. If the tensor
in tensor_list has shape [N, a, b, .., z], then the corresponding output
@@ -1746,11 +1707,11 @@ is added to the current Graph's QUEUE_RUNNER collection.
- - -
-### `tf.train.string_input_producer(string_tensor, num_epochs=None, shuffle=True, seed=None, capacity=32, name=None)` <a class="md-anchor" id="string_input_producer"></a>
+### `tf.train.string_input_producer(string_tensor, num_epochs=None, shuffle=True, seed=None, capacity=32, name=None)` {#string_input_producer}
Output strings (e.g. filenames) to a queue for an input pipeline.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`string_tensor`</b>: A 1-D string tensor with the strings to produce.
@@ -1765,14 +1726,14 @@ Output strings (e.g. filenames) to a queue for an input pipeline.
* <b>`capacity`</b>: An integer. Sets the queue capacity.
* <b>`name`</b>: A name for the operations (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A queue with the output strings. A QueueRunner for the Queue
is added to the current Graph's QUEUE_RUNNER collection.
-### Batching at the end of an input pipeline <a class="md-anchor" id="AUTOGENERATED-batching-at-the-end-of-an-input-pipeline"></a>
+### Batching at the end of an input pipeline
These functions add a queue to the graph to assemble a batch of examples, with
possible shuffling. They also add a `QueueRunner` for running the subgraph
@@ -1793,7 +1754,7 @@ want them run by N threads.
- - -
-### `tf.train.batch(tensor_list, batch_size, num_threads=1, capacity=32, enqueue_many=False, shapes=None, name=None)` <a class="md-anchor" id="batch"></a>
+### `tf.train.batch(tensor_list, batch_size, num_threads=1, capacity=32, enqueue_many=False, shapes=None, name=None)` {#batch}
Creates batches of tensors in `tensor_list`.
@@ -1811,7 +1772,7 @@ first dimension. If an input tensor has shape `[*, x, y, z]`, the
output will have shape `[batch_size, x, y, z]`. The `capacity` argument
controls the how long the prefetching is allowed to grow the queues.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`tensor_list`</b>: The list of tensors to enqueue.
@@ -1823,14 +1784,14 @@ controls the how long the prefetching is allowed to grow the queues.
inferred shapes for `tensor_list`.
* <b>`name`</b>: (Optional) A name for the operations.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A list of tensors with the same number and types as `tensor_list`.
- - -
-### `tf.train.batch_join(tensor_list_list, batch_size, capacity=32, enqueue_many=False, shapes=None, name=None)` <a class="md-anchor" id="batch_join"></a>
+### `tf.train.batch_join(tensor_list_list, batch_size, capacity=32, enqueue_many=False, shapes=None, name=None)` {#batch_join}
Runs a list of tensors to fill a queue to create batches of examples.
@@ -1858,7 +1819,7 @@ same size in the first dimension. The slices of any input tensor
The `capacity` argument controls the how long the prefetching is allowed to
grow the queues.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`tensor_list_list`</b>: A list of tuples of tensors to enqueue.
@@ -1870,7 +1831,7 @@ grow the queues.
inferred shapes for `tensor_list_list[i]`.
* <b>`name`</b>: (Optional) A name for the operations.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A list of tensors with the same number and types as
`tensor_list_list[i]`.
@@ -1878,7 +1839,7 @@ grow the queues.
- - -
-### `tf.train.shuffle_batch(tensor_list, batch_size, capacity, min_after_dequeue, num_threads=1, seed=None, enqueue_many=False, shapes=None, name=None)` <a class="md-anchor" id="shuffle_batch"></a>
+### `tf.train.shuffle_batch(tensor_list, batch_size, capacity, min_after_dequeue, num_threads=1, seed=None, enqueue_many=False, shapes=None, name=None)` {#shuffle_batch}
Creates batches by randomly shuffling tensors.
@@ -1914,7 +1875,7 @@ image_batch, label_batch = tf.train.shuffle_batch(
min_after_dequeue=10000)
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`tensor_list`</b>: The list of tensors to enqueue.
@@ -1929,14 +1890,14 @@ image_batch, label_batch = tf.train.shuffle_batch(
inferred shapes for `tensor_list`.
* <b>`name`</b>: (Optional) A name for the operations.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A list of tensors with the same number and types as `tensor_list`.
- - -
-### `tf.train.shuffle_batch_join(tensor_list_list, batch_size, capacity, min_after_dequeue, seed=None, enqueue_many=False, shapes=None, name=None)` <a class="md-anchor" id="shuffle_batch_join"></a>
+### `tf.train.shuffle_batch_join(tensor_list_list, batch_size, capacity, min_after_dequeue, seed=None, enqueue_many=False, shapes=None, name=None)` {#shuffle_batch_join}
Create batches by randomly shuffling tensors.
@@ -1966,7 +1927,7 @@ y, z]`, the output will have shape `[batch_size, x, y, z]`.
The `capacity` argument controls the how long the prefetching is allowed to
grow the queues.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`tensor_list_list`</b>: A list of tuples of tensors to enqueue.
@@ -1981,7 +1942,7 @@ grow the queues.
inferred shapes for `tensor_list_list[i]`.
* <b>`name`</b>: (Optional) A name for the operations.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A list of tensors with the same number and types as `tensor_list_list[i]`.
diff --git a/tensorflow/g3doc/api_docs/python/math_ops.md b/tensorflow/g3doc/api_docs/python/math_ops.md
index c0d742c89b..1f6314d2a6 100644
--- a/tensorflow/g3doc/api_docs/python/math_ops.md
+++ b/tensorflow/g3doc/api_docs/python/math_ops.md
@@ -1,212 +1,136 @@
<!-- This file is machine generated: DO NOT EDIT! -->
-# Math <a class="md-anchor" id="AUTOGENERATED-math"></a>
+# Math
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
-### [Math](#AUTOGENERATED-math)
-* [Arithmetic Operators](#AUTOGENERATED-arithmetic-operators)
- * [`tf.add(x, y, name=None)`](#add)
- * [`tf.sub(x, y, name=None)`](#sub)
- * [`tf.mul(x, y, name=None)`](#mul)
- * [`tf.div(x, y, name=None)`](#div)
- * [`tf.mod(x, y, name=None)`](#mod)
-* [Basic Math Functions](#AUTOGENERATED-basic-math-functions)
- * [`tf.add_n(inputs, name=None)`](#add_n)
- * [`tf.abs(x, name=None)`](#abs)
- * [`tf.neg(x, name=None)`](#neg)
- * [`tf.sign(x, name=None)`](#sign)
- * [`tf.inv(x, name=None)`](#inv)
- * [`tf.square(x, name=None)`](#square)
- * [`tf.round(x, name=None)`](#round)
- * [`tf.sqrt(x, name=None)`](#sqrt)
- * [`tf.rsqrt(x, name=None)`](#rsqrt)
- * [`tf.pow(x, y, name=None)`](#pow)
- * [`tf.exp(x, name=None)`](#exp)
- * [`tf.log(x, name=None)`](#log)
- * [`tf.ceil(x, name=None)`](#ceil)
- * [`tf.floor(x, name=None)`](#floor)
- * [`tf.maximum(x, y, name=None)`](#maximum)
- * [`tf.minimum(x, y, name=None)`](#minimum)
- * [`tf.cos(x, name=None)`](#cos)
- * [`tf.sin(x, name=None)`](#sin)
-* [Matrix Math Functions](#AUTOGENERATED-matrix-math-functions)
- * [`tf.diag(diagonal, name=None)`](#diag)
- * [`tf.transpose(a, perm=None, name='transpose')`](#transpose)
- * [`tf.matmul(a, b, transpose_a=False, transpose_b=False, a_is_sparse=False, b_is_sparse=False, name=None)`](#matmul)
- * [`tf.batch_matmul(x, y, adj_x=None, adj_y=None, name=None)`](#batch_matmul)
- * [`tf.matrix_determinant(input, name=None)`](#matrix_determinant)
- * [`tf.batch_matrix_determinant(input, name=None)`](#batch_matrix_determinant)
- * [`tf.matrix_inverse(input, name=None)`](#matrix_inverse)
- * [`tf.batch_matrix_inverse(input, name=None)`](#batch_matrix_inverse)
- * [`tf.cholesky(input, name=None)`](#cholesky)
- * [`tf.batch_cholesky(input, name=None)`](#batch_cholesky)
-* [Complex Number Functions](#AUTOGENERATED-complex-number-functions)
- * [`tf.complex(real, imag, name=None)`](#complex)
- * [`tf.complex_abs(x, name=None)`](#complex_abs)
- * [`tf.conj(in_, name=None)`](#conj)
- * [`tf.imag(in_, name=None)`](#imag)
- * [`tf.real(in_, name=None)`](#real)
-* [Reduction](#AUTOGENERATED-reduction)
- * [`tf.reduce_sum(input_tensor, reduction_indices=None, keep_dims=False, name=None)`](#reduce_sum)
- * [`tf.reduce_prod(input_tensor, reduction_indices=None, keep_dims=False, name=None)`](#reduce_prod)
- * [`tf.reduce_min(input_tensor, reduction_indices=None, keep_dims=False, name=None)`](#reduce_min)
- * [`tf.reduce_max(input_tensor, reduction_indices=None, keep_dims=False, name=None)`](#reduce_max)
- * [`tf.reduce_mean(input_tensor, reduction_indices=None, keep_dims=False, name=None)`](#reduce_mean)
- * [`tf.reduce_all(input_tensor, reduction_indices=None, keep_dims=False, name=None)`](#reduce_all)
- * [`tf.reduce_any(input_tensor, reduction_indices=None, keep_dims=False, name=None)`](#reduce_any)
- * [`tf.accumulate_n(inputs, shape=None, tensor_dtype=None, name=None)`](#accumulate_n)
-* [Segmentation](#AUTOGENERATED-segmentation)
- * [`tf.segment_sum(data, segment_ids, name=None)`](#segment_sum)
- * [`tf.segment_prod(data, segment_ids, name=None)`](#segment_prod)
- * [`tf.segment_min(data, segment_ids, name=None)`](#segment_min)
- * [`tf.segment_max(data, segment_ids, name=None)`](#segment_max)
- * [`tf.segment_mean(data, segment_ids, name=None)`](#segment_mean)
- * [`tf.unsorted_segment_sum(data, segment_ids, num_segments, name=None)`](#unsorted_segment_sum)
- * [`tf.sparse_segment_sum(data, indices, segment_ids, name=None)`](#sparse_segment_sum)
- * [`tf.sparse_segment_mean(data, indices, segment_ids, name=None)`](#sparse_segment_mean)
-* [Sequence Comparison and Indexing](#AUTOGENERATED-sequence-comparison-and-indexing)
- * [`tf.argmin(input, dimension, name=None)`](#argmin)
- * [`tf.argmax(input, dimension, name=None)`](#argmax)
- * [`tf.listdiff(x, y, name=None)`](#listdiff)
- * [`tf.where(input, name=None)`](#where)
- * [`tf.unique(x, name=None)`](#unique)
- * [`tf.edit_distance(hypothesis, truth, normalize=True, name='edit_distance')`](#edit_distance)
- * [`tf.invert_permutation(x, name=None)`](#invert_permutation)
-* [Other Functions and Classes](#AUTOGENERATED-other-functions-and-classes)
- * [`tf.floordiv(x, y, name=None)`](#floordiv)
- * [`tf.truediv(x, y, name=None)`](#truediv)
-
-
-<!-- TOC-END This section was generated by neural network, THANKS FOR READING! -->
-
-## Arithmetic Operators <a class="md-anchor" id="AUTOGENERATED-arithmetic-operators"></a>
+[TOC]
+
+## Arithmetic Operators
TensorFlow provides several operations that you can use to add basic arithmetic
operators to your graph.
- - -
-### `tf.add(x, y, name=None)` <a class="md-anchor" id="add"></a>
+### `tf.add(x, y, name=None)` {#add}
Returns x + y element-wise.
*NOTE*: Add supports broadcasting. AddN does not.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int8`, `int16`, `int32`, `complex64`, `int64`.
* <b>`y`</b>: A `Tensor`. Must have the same type as `x`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `x`.
- - -
-### `tf.sub(x, y, name=None)` <a class="md-anchor" id="sub"></a>
+### `tf.sub(x, y, name=None)` {#sub}
Returns x - y element-wise.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `complex64`, `int64`.
* <b>`y`</b>: A `Tensor`. Must have the same type as `x`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `x`.
- - -
-### `tf.mul(x, y, name=None)` <a class="md-anchor" id="mul"></a>
+### `tf.mul(x, y, name=None)` {#mul}
Returns x * y element-wise.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int8`, `int16`, `int32`, `complex64`, `int64`.
* <b>`y`</b>: A `Tensor`. Must have the same type as `x`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `x`.
- - -
-### `tf.div(x, y, name=None)` <a class="md-anchor" id="div"></a>
+### `tf.div(x, y, name=None)` {#div}
Returns x / y element-wise.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `complex64`, `int64`.
* <b>`y`</b>: A `Tensor`. Must have the same type as `x`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `x`.
- - -
-### `tf.mod(x, y, name=None)` <a class="md-anchor" id="mod"></a>
+### `tf.mod(x, y, name=None)` {#mod}
Returns element-wise remainder of division.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor`. Must be one of the following types: `int32`, `int64`, `float32`, `float64`.
* <b>`y`</b>: A `Tensor`. Must have the same type as `x`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `x`.
-## Basic Math Functions <a class="md-anchor" id="AUTOGENERATED-basic-math-functions"></a>
+## Basic Math Functions
TensorFlow provides several operations that you can use to add basic
mathematical functions to your graph.
- - -
-### `tf.add_n(inputs, name=None)` <a class="md-anchor" id="add_n"></a>
+### `tf.add_n(inputs, name=None)` {#add_n}
Add all input tensors element wise.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`inputs`</b>: A list of at least 1 `Tensor` objects of the same type in: `float32`, `float64`, `int64`, `int32`, `uint8`, `int16`, `int8`, `complex64`, `qint8`, `quint8`, `qint32`.
Must all be the same size and shape.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `inputs`.
- - -
-### `tf.abs(x, name=None)` <a class="md-anchor" id="abs"></a>
+### `tf.abs(x, name=None)` {#abs}
Computes the absolute value of a tensor.
@@ -218,96 +142,96 @@ an input element and y is an output element, this operation computes
See [`tf.complex_abs()`](#tf_complex_abs) to compute the absolute value of a complex
number.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor` of type `float`, `double`, `int32`, or `int64`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` the same size and type as `x` with absolute values.
- - -
-### `tf.neg(x, name=None)` <a class="md-anchor" id="neg"></a>
+### `tf.neg(x, name=None)` {#neg}
Computes numerical negative value element-wise.
I.e., \\(y = -x\\).
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `complex64`, `int64`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `x`.
- - -
-### `tf.sign(x, name=None)` <a class="md-anchor" id="sign"></a>
+### `tf.sign(x, name=None)` {#sign}
Returns an element-wise indication of the sign of a number.
y = sign(x) = -1 if x < 0; 0 if x == 0; 1 if x > 0.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `int64`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `x`.
- - -
-### `tf.inv(x, name=None)` <a class="md-anchor" id="inv"></a>
+### `tf.inv(x, name=None)` {#inv}
Computes the reciprocal of x element-wise.
I.e., \\(y = 1 / x\\).
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `complex64`, `int64`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `x`.
- - -
-### `tf.square(x, name=None)` <a class="md-anchor" id="square"></a>
+### `tf.square(x, name=None)` {#square}
Computes square of x element-wise.
I.e., \\(y = x * x = x^2\\).
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `complex64`, `int64`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `x`.
- - -
-### `tf.round(x, name=None)` <a class="md-anchor" id="round"></a>
+### `tf.round(x, name=None)` {#round}
Rounds the values of a tensor to the nearest integer, element-wise.
@@ -318,58 +242,58 @@ For example:
tf.round(a) ==> [ 1.0, 3.0, 2.0, -4.0 ]
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor` of type `float` or `double`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` of same shape and type as `x`.
- - -
-### `tf.sqrt(x, name=None)` <a class="md-anchor" id="sqrt"></a>
+### `tf.sqrt(x, name=None)` {#sqrt}
Computes square root of x element-wise.
I.e., \\(y = \sqrt{x} = x^{1/2}\\).
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `complex64`, `int64`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `x`.
- - -
-### `tf.rsqrt(x, name=None)` <a class="md-anchor" id="rsqrt"></a>
+### `tf.rsqrt(x, name=None)` {#rsqrt}
Computes reciprocal of square root of x element-wise.
I.e., \\(y = 1 / \sqrt{x}\\).
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `complex64`, `int64`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `x`.
- - -
-### `tf.pow(x, y, name=None)` <a class="md-anchor" id="pow"></a>
+### `tf.pow(x, y, name=None)` {#pow}
Computes the power of one value to another.
@@ -382,167 +306,167 @@ corresponding elements in `x` and `y`. For example:
tf.pow(x, y) ==> [[256, 65536], [9, 27]]
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor` of type `float`, `double`, `int32`, `complex64`, or `int64`.
* <b>`y`</b>: A `Tensor` of type `float`, `double`, `int32`, `complex64`, or `int64`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`.
- - -
-### `tf.exp(x, name=None)` <a class="md-anchor" id="exp"></a>
+### `tf.exp(x, name=None)` {#exp}
Computes exponential of x element-wise. \\(y = e^x\\).
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `complex64`, `int64`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `x`.
- - -
-### `tf.log(x, name=None)` <a class="md-anchor" id="log"></a>
+### `tf.log(x, name=None)` {#log}
Computes natural logrithm of x element-wise.
I.e., \\(y = \log_e x\\).
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `complex64`, `int64`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `x`.
- - -
-### `tf.ceil(x, name=None)` <a class="md-anchor" id="ceil"></a>
+### `tf.ceil(x, name=None)` {#ceil}
Returns element-wise smallest integer in not less than x.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `x`.
- - -
-### `tf.floor(x, name=None)` <a class="md-anchor" id="floor"></a>
+### `tf.floor(x, name=None)` {#floor}
Returns element-wise largest integer not greater than x.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `x`.
- - -
-### `tf.maximum(x, y, name=None)` <a class="md-anchor" id="maximum"></a>
+### `tf.maximum(x, y, name=None)` {#maximum}
Returns the max of x and y (i.e. x > y ? x : y) element-wise, broadcasts.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `int64`.
* <b>`y`</b>: A `Tensor`. Must have the same type as `x`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `x`.
- - -
-### `tf.minimum(x, y, name=None)` <a class="md-anchor" id="minimum"></a>
+### `tf.minimum(x, y, name=None)` {#minimum}
Returns the min of x and y (i.e. x < y ? x : y) element-wise, broadcasts.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `int64`.
* <b>`y`</b>: A `Tensor`. Must have the same type as `x`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `x`.
- - -
-### `tf.cos(x, name=None)` <a class="md-anchor" id="cos"></a>
+### `tf.cos(x, name=None)` {#cos}
Computes cos of x element-wise.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `complex64`, `int64`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `x`.
- - -
-### `tf.sin(x, name=None)` <a class="md-anchor" id="sin"></a>
+### `tf.sin(x, name=None)` {#sin}
Computes sin of x element-wise.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `complex64`, `int64`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `x`.
-## Matrix Math Functions <a class="md-anchor" id="AUTOGENERATED-matrix-math-functions"></a>
+## Matrix Math Functions
TensorFlow provides several operations that you can use to add basic
mathematical functions for matrices to your graph.
- - -
-### `tf.diag(diagonal, name=None)` <a class="md-anchor" id="diag"></a>
+### `tf.diag(diagonal, name=None)` {#diag}
Returns a diagonal tensor with a given diagonal values.
@@ -564,21 +488,21 @@ tf.diag(diagonal) ==> [[1, 0, 0, 0]
[0, 0, 0, 4]]
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`diagonal`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `int64`.
Rank k tensor where k is at most 3.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `diagonal`.
- - -
-### `tf.transpose(a, perm=None, name='transpose')` <a class="md-anchor" id="transpose"></a>
+### `tf.transpose(a, perm=None, name='transpose')` {#transpose}
Transposes `a`. Permutes the dimensions according to `perm`.
@@ -616,14 +540,14 @@ tf.transpose(b, perm=[0, 2, 1]) ==> [[[1 4]
[9 12]]]
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`a`</b>: A `Tensor`.
* <b>`perm`</b>: A permutation of the dimensions of `a`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A transposed `Tensor`.
@@ -631,7 +555,7 @@ tf.transpose(b, perm=[0, 2, 1]) ==> [[[1 4]
- - -
-### `tf.matmul(a, b, transpose_a=False, transpose_b=False, a_is_sparse=False, b_is_sparse=False, name=None)` <a class="md-anchor" id="matmul"></a>
+### `tf.matmul(a, b, transpose_a=False, transpose_b=False, a_is_sparse=False, b_is_sparse=False, name=None)` {#matmul}
Multiplies matrix `a` by matrix `b`, producing `a` * `b`.
@@ -662,7 +586,7 @@ c = tf.matmul(a, b) => [[58 64]
[139 154]]
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`a`</b>: `Tensor` of type `float`, `double`, `int32` or `complex64`.
@@ -673,14 +597,14 @@ c = tf.matmul(a, b) => [[58 64]
* <b>`b_is_sparse`</b>: If `True`, `b` is treated as a sparse matrix.
* <b>`name`</b>: Name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` of the same type as `a`.
- - -
-### `tf.batch_matmul(x, y, adj_x=None, adj_y=None, name=None)` <a class="md-anchor" id="batch_matmul"></a>
+### `tf.batch_matmul(x, y, adj_x=None, adj_y=None, name=None)` {#batch_matmul}
Multiplies slices of two tensors in batches.
@@ -703,7 +627,7 @@ It is computed as:
out[..., :, :] = matrix(x[..., :, :]) * matrix(y[..., :, :])
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `complex64`.
@@ -716,7 +640,7 @@ It is computed as:
If `True`, adjoint the slices of `y`. Defaults to `False`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `x`.
3-D or higher with shape `[..., r_o, c_o]`
@@ -725,18 +649,18 @@ It is computed as:
- - -
-### `tf.matrix_determinant(input, name=None)` <a class="md-anchor" id="matrix_determinant"></a>
+### `tf.matrix_determinant(input, name=None)` {#matrix_determinant}
Calculates the determinant of a square matrix.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`input`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`.
A tensor of shape `[M, M]`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `input`.
A scalar, equal to the determinant of the input.
@@ -744,7 +668,7 @@ Calculates the determinant of a square matrix.
- - -
-### `tf.batch_matrix_determinant(input, name=None)` <a class="md-anchor" id="batch_matrix_determinant"></a>
+### `tf.batch_matrix_determinant(input, name=None)` {#batch_matrix_determinant}
Calculates the determinants for a batch of square matrices.
@@ -752,14 +676,14 @@ The input is a tensor of shape `[..., M, M]` whose inner-most 2 dimensions
form square matrices. The output is a 1-D tensor containing the determinants
for all input submatrices `[..., :, :]`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`input`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`.
Shape is `[..., M, M]`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `input`. Shape is `[...]`.
@@ -767,18 +691,18 @@ for all input submatrices `[..., :, :]`.
- - -
-### `tf.matrix_inverse(input, name=None)` <a class="md-anchor" id="matrix_inverse"></a>
+### `tf.matrix_inverse(input, name=None)` {#matrix_inverse}
Calculates the inverse of a square invertible matrix. Checks for invertibility.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`input`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`.
Shape is `[M, M]`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `input`.
Shape is `[M, M]` containing the matrix inverse of the input.
@@ -786,7 +710,7 @@ Calculates the inverse of a square invertible matrix. Checks for invertibility.
- - -
-### `tf.batch_matrix_inverse(input, name=None)` <a class="md-anchor" id="batch_matrix_inverse"></a>
+### `tf.batch_matrix_inverse(input, name=None)` {#batch_matrix_inverse}
Calculates the inverse of square invertible matrices. Checks for invertibility.
@@ -794,14 +718,14 @@ The input is a tensor of shape `[..., M, M]` whose inner-most 2 dimensions
form square matrices. The output is a tensor of the same shape as the input
containing the inverse for all input submatrices `[..., :, :]`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`input`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`.
Shape is `[..., M, M]`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `input`. Shape is `[..., M, M]`.
@@ -809,7 +733,7 @@ containing the inverse for all input submatrices `[..., :, :]`.
- - -
-### `tf.cholesky(input, name=None)` <a class="md-anchor" id="cholesky"></a>
+### `tf.cholesky(input, name=None)` {#cholesky}
Calculates the Cholesky decomposition of a square matrix.
@@ -820,21 +744,21 @@ will not be read.
The result is the lower-triangular matrix of the Cholesky decomposition of the
input.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`input`</b>: A `Tensor`. Must be one of the following types: `float64`, `float32`.
Shape is `[M, M]`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `input`. Shape is `[M, M]`.
- - -
-### `tf.batch_cholesky(input, name=None)` <a class="md-anchor" id="batch_cholesky"></a>
+### `tf.batch_cholesky(input, name=None)` {#batch_cholesky}
Calculates the Cholesky decomposition of a batch of square matrices.
@@ -843,27 +767,27 @@ form square matrices, with the same constraints as the single matrix Cholesky
decomposition above. The output is a tensor of the same shape as the input
containing the Cholesky decompositions for all input submatrices `[..., :, :]`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`input`</b>: A `Tensor`. Must be one of the following types: `float64`, `float32`.
Shape is `[..., M, M]`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `input`. Shape is `[..., M, M]`.
-## Complex Number Functions <a class="md-anchor" id="AUTOGENERATED-complex-number-functions"></a>
+## Complex Number Functions
TensorFlow provides several operations that you can use to add complex number
functions to your graph.
- - -
-### `tf.complex(real, imag, name=None)` <a class="md-anchor" id="complex"></a>
+### `tf.complex(real, imag, name=None)` {#complex}
Converts two real numbers to a complex number.
@@ -882,21 +806,21 @@ For example:
tf.complex(real, imag) ==> [[2.25 + 4.74j], [3.25 + 5.75j]]
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`real`</b>: A `Tensor` of type `float`.
* <b>`imag`</b>: A `Tensor` of type `float`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` of type `complex64`.
- - -
-### `tf.complex_abs(x, name=None)` <a class="md-anchor" id="complex_abs"></a>
+### `tf.complex_abs(x, name=None)` {#complex_abs}
Computes the complex absolute value of a tensor.
@@ -912,20 +836,20 @@ For example:
tf.complex_abs(x) ==> [5.25594902, 6.60492229]
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor` of type `complex64`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` of type `float32`.
- - -
-### `tf.conj(in_, name=None)` <a class="md-anchor" id="conj"></a>
+### `tf.conj(in_, name=None)` {#conj}
Returns the complex conjugate of a complex number.
@@ -943,20 +867,20 @@ For example:
tf.conj(in) ==> [-2.25 - 4.75j, 3.25 - 5.75j]
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`in_`</b>: A `Tensor` of type `complex64`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` of type `complex64`.
- - -
-### `tf.imag(in_, name=None)` <a class="md-anchor" id="imag"></a>
+### `tf.imag(in_, name=None)` {#imag}
Returns the imaginary part of a complex number.
@@ -972,20 +896,20 @@ For example:
tf.imag(in) ==> [4.75, 5.75]
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`in_`</b>: A `Tensor` of type `complex64`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` of type `float32`.
- - -
-### `tf.real(in_, name=None)` <a class="md-anchor" id="real"></a>
+### `tf.real(in_, name=None)` {#real}
Returns the real part of a complex number.
@@ -1001,26 +925,26 @@ For example:
tf.real(in) ==> [-2.25, 3.25]
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`in_`</b>: A `Tensor` of type `complex64`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` of type `float32`.
-## Reduction <a class="md-anchor" id="AUTOGENERATED-reduction"></a>
+## Reduction
TensorFlow provides several operations that you can use to perform
common math computations that reduce various dimensions of a tensor.
- - -
-### `tf.reduce_sum(input_tensor, reduction_indices=None, keep_dims=False, name=None)` <a class="md-anchor" id="reduce_sum"></a>
+### `tf.reduce_sum(input_tensor, reduction_indices=None, keep_dims=False, name=None)` {#reduce_sum}
Computes the sum of elements across dimensions of a tensor.
@@ -1044,7 +968,7 @@ tf.reduce_sum(x, 1, keep_dims=True) ==> [[3], [3]]
tf.reduce_sum(x, [0, 1]) ==> 6
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`input_tensor`</b>: The tensor to reduce. Should have numeric type.
@@ -1053,14 +977,14 @@ tf.reduce_sum(x, [0, 1]) ==> 6
* <b>`keep_dims`</b>: If true, retains reduced dimensions with length 1.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
The reduced tensor.
- - -
-### `tf.reduce_prod(input_tensor, reduction_indices=None, keep_dims=False, name=None)` <a class="md-anchor" id="reduce_prod"></a>
+### `tf.reduce_prod(input_tensor, reduction_indices=None, keep_dims=False, name=None)` {#reduce_prod}
Computes the product of elements across dimensions of a tensor.
@@ -1072,7 +996,7 @@ are retained with length 1.
If `reduction_indices` has no entries, all dimensions are reduced, and a
tensor with a single element is returned.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`input_tensor`</b>: The tensor to reduce. Should have numeric type.
@@ -1081,14 +1005,14 @@ tensor with a single element is returned.
* <b>`keep_dims`</b>: If true, retains reduced dimensions with length 1.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
The reduced tensor.
- - -
-### `tf.reduce_min(input_tensor, reduction_indices=None, keep_dims=False, name=None)` <a class="md-anchor" id="reduce_min"></a>
+### `tf.reduce_min(input_tensor, reduction_indices=None, keep_dims=False, name=None)` {#reduce_min}
Computes the minimum of elements across dimensions of a tensor.
@@ -1100,7 +1024,7 @@ are retained with length 1.
If `reduction_indices` has no entries, all dimensions are reduced, and a
tensor with a single element is returned.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`input_tensor`</b>: The tensor to reduce. Should have numeric type.
@@ -1109,14 +1033,14 @@ tensor with a single element is returned.
* <b>`keep_dims`</b>: If true, retains reduced dimensions with length 1.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
The reduced tensor.
- - -
-### `tf.reduce_max(input_tensor, reduction_indices=None, keep_dims=False, name=None)` <a class="md-anchor" id="reduce_max"></a>
+### `tf.reduce_max(input_tensor, reduction_indices=None, keep_dims=False, name=None)` {#reduce_max}
Computes the maximum of elements across dimensions of a tensor.
@@ -1128,7 +1052,7 @@ are retained with length 1.
If `reduction_indices` has no entries, all dimensions are reduced, and a
tensor with a single element is returned.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`input_tensor`</b>: The tensor to reduce. Should have numeric type.
@@ -1137,14 +1061,14 @@ tensor with a single element is returned.
* <b>`keep_dims`</b>: If true, retains reduced dimensions with length 1.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
The reduced tensor.
- - -
-### `tf.reduce_mean(input_tensor, reduction_indices=None, keep_dims=False, name=None)` <a class="md-anchor" id="reduce_mean"></a>
+### `tf.reduce_mean(input_tensor, reduction_indices=None, keep_dims=False, name=None)` {#reduce_mean}
Computes the mean of elements across dimensions of a tensor.
@@ -1166,7 +1090,7 @@ tf.reduce_mean(x, 0) ==> [1.5, 1.5]
tf.reduce_mean(x, 1) ==> [1., 2.]
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`input_tensor`</b>: The tensor to reduce. Should have numeric type.
@@ -1175,14 +1099,14 @@ tf.reduce_mean(x, 1) ==> [1., 2.]
* <b>`keep_dims`</b>: If true, retains reduced dimensions with length 1.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
The reduced tensor.
- - -
-### `tf.reduce_all(input_tensor, reduction_indices=None, keep_dims=False, name=None)` <a class="md-anchor" id="reduce_all"></a>
+### `tf.reduce_all(input_tensor, reduction_indices=None, keep_dims=False, name=None)` {#reduce_all}
Computes the "logical and" of elements across dimensions of a tensor.
@@ -1204,7 +1128,7 @@ tf.reduce_all(x, 0) ==> [False, False]
tf.reduce_all(x, 1) ==> [True, False]
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`input_tensor`</b>: The boolean tensor to reduce.
@@ -1213,14 +1137,14 @@ tf.reduce_all(x, 1) ==> [True, False]
* <b>`keep_dims`</b>: If true, retains reduced dimensions with length 1.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
The reduced tensor.
- - -
-### `tf.reduce_any(input_tensor, reduction_indices=None, keep_dims=False, name=None)` <a class="md-anchor" id="reduce_any"></a>
+### `tf.reduce_any(input_tensor, reduction_indices=None, keep_dims=False, name=None)` {#reduce_any}
Computes the "logical or" of elements across dimensions of a tensor.
@@ -1242,7 +1166,7 @@ tf.reduce_any(x, 0) ==> [True, True]
tf.reduce_any(x, 1) ==> [True, False]
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`input_tensor`</b>: The boolean tensor to reduce.
@@ -1251,7 +1175,7 @@ tf.reduce_any(x, 1) ==> [True, False]
* <b>`keep_dims`</b>: If true, retains reduced dimensions with length 1.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
The reduced tensor.
@@ -1259,7 +1183,7 @@ tf.reduce_any(x, 1) ==> [True, False]
- - -
-### `tf.accumulate_n(inputs, shape=None, tensor_dtype=None, name=None)` <a class="md-anchor" id="accumulate_n"></a>
+### `tf.accumulate_n(inputs, shape=None, tensor_dtype=None, name=None)` {#accumulate_n}
Returns the element-wise sum of a list of tensors.
@@ -1278,7 +1202,7 @@ tf.accumulate_n([a, b, a], shape=[2, 2], tensor_dtype=tf.int32)
==> [[7, 4], [6, 14]]
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`inputs`</b>: A list of `Tensor` objects, each with same shape and type.
@@ -1286,11 +1210,11 @@ tf.accumulate_n([a, b, a], shape=[2, 2], tensor_dtype=tf.int32)
* <b>`tensor_dtype`</b>: The type of `inputs`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` of same shape and type as the elements of `inputs`.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`ValueError`</b>: If `inputs` don't all have same shape and dtype or the shape
@@ -1298,7 +1222,7 @@ tf.accumulate_n([a, b, a], shape=[2, 2], tensor_dtype=tf.int32)
-## Segmentation <a class="md-anchor" id="AUTOGENERATED-segmentation"></a>
+## Segmentation
TensorFlow provides several operations that you can use to perform common
math computations on tensor segments.
@@ -1321,7 +1245,7 @@ tf.segment_sum(c, tf.constant([0, 0, 1]))
- - -
-### `tf.segment_sum(data, segment_ids, name=None)` <a class="md-anchor" id="segment_sum"></a>
+### `tf.segment_sum(data, segment_ids, name=None)` {#segment_sum}
Computes the sum along segments of a tensor.
@@ -1336,7 +1260,7 @@ that `segment_ids[j] == i`.
<img style="width:100%" src="../images/SegmentSum.png" alt>
</div>
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`data`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `int64`, `uint8`, `int16`, `int8`.
@@ -1345,7 +1269,7 @@ that `segment_ids[j] == i`.
first dimension. Values should be sorted and can be repeated.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `data`.
Has same shape as data, except for dimension_0 which
@@ -1354,7 +1278,7 @@ that `segment_ids[j] == i`.
- - -
-### `tf.segment_prod(data, segment_ids, name=None)` <a class="md-anchor" id="segment_prod"></a>
+### `tf.segment_prod(data, segment_ids, name=None)` {#segment_prod}
Computes the product along segments of a tensor.
@@ -1370,7 +1294,7 @@ that `segment_ids[j] == i`.
<img style="width:100%" src="../images/SegmentProd.png" alt>
</div>
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`data`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `int64`, `uint8`, `int16`, `int8`.
@@ -1379,7 +1303,7 @@ that `segment_ids[j] == i`.
first dimension. Values should be sorted and can be repeated.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `data`.
Has same shape as data, except for dimension_0 which
@@ -1388,7 +1312,7 @@ that `segment_ids[j] == i`.
- - -
-### `tf.segment_min(data, segment_ids, name=None)` <a class="md-anchor" id="segment_min"></a>
+### `tf.segment_min(data, segment_ids, name=None)` {#segment_min}
Computes the minimum along segments of a tensor.
@@ -1404,7 +1328,7 @@ that `segment_ids[j] == i`.
<img style="width:100%" src="../images/SegmentMin.png" alt>
</div>
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`data`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `int64`, `uint8`, `int16`, `int8`.
@@ -1413,7 +1337,7 @@ that `segment_ids[j] == i`.
first dimension. Values should be sorted and can be repeated.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `data`.
Has same shape as data, except for dimension_0 which
@@ -1422,7 +1346,7 @@ that `segment_ids[j] == i`.
- - -
-### `tf.segment_max(data, segment_ids, name=None)` <a class="md-anchor" id="segment_max"></a>
+### `tf.segment_max(data, segment_ids, name=None)` {#segment_max}
Computes the maximum along segments of a tensor.
@@ -1437,7 +1361,7 @@ that `segment_ids[j] == i`.
<img style="width:100%" src="../images/SegmentMax.png" alt>
</div>
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`data`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `int64`, `uint8`, `int16`, `int8`.
@@ -1446,7 +1370,7 @@ that `segment_ids[j] == i`.
first dimension. Values should be sorted and can be repeated.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `data`.
Has same shape as data, except for dimension_0 which
@@ -1455,7 +1379,7 @@ that `segment_ids[j] == i`.
- - -
-### `tf.segment_mean(data, segment_ids, name=None)` <a class="md-anchor" id="segment_mean"></a>
+### `tf.segment_mean(data, segment_ids, name=None)` {#segment_mean}
Computes the mean along segments of a tensor.
@@ -1472,7 +1396,7 @@ values summed.
<img style="width:100%" src="../images/SegmentMean.png" alt>
</div>
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`data`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `int64`, `uint8`, `int16`, `int8`.
@@ -1481,7 +1405,7 @@ values summed.
first dimension. Values should be sorted and can be repeated.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `data`.
Has same shape as data, except for dimension_0 which
@@ -1491,7 +1415,7 @@ values summed.
- - -
-### `tf.unsorted_segment_sum(data, segment_ids, num_segments, name=None)` <a class="md-anchor" id="unsorted_segment_sum"></a>
+### `tf.unsorted_segment_sum(data, segment_ids, num_segments, name=None)` {#unsorted_segment_sum}
Computes the sum along segments of a tensor.
@@ -1513,7 +1437,7 @@ If the sum is empty for a given segment ID `i`, `output[i] = 0`.
<img style="width:100%" src="../images/UnsortedSegmentSum.png" alt>
</div>
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`data`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `int64`, `uint8`, `int16`, `int8`.
@@ -1523,7 +1447,7 @@ If the sum is empty for a given segment ID `i`, `output[i] = 0`.
* <b>`num_segments`</b>: A `Tensor` of type `int32`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `data`.
Has same shape as data, except for dimension_0 which
@@ -1533,7 +1457,7 @@ If the sum is empty for a given segment ID `i`, `output[i] = 0`.
- - -
-### `tf.sparse_segment_sum(data, indices, segment_ids, name=None)` <a class="md-anchor" id="sparse_segment_sum"></a>
+### `tf.sparse_segment_sum(data, indices, segment_ids, name=None)` {#sparse_segment_sum}
Computes the sum along sparse segments of a tensor.
@@ -1567,7 +1491,7 @@ tf.sparse_segment_sum(c, tf.constant([0, 1, 2]), tf.constant([0, 0, 1]))
tf.segment_sum(c, tf.constant([0, 0, 1]))
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`data`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `int64`, `uint8`, `int16`, `int8`.
@@ -1577,7 +1501,7 @@ tf.segment_sum(c, tf.constant([0, 0, 1]))
A 1-D tensor. Values should be sorted and can be repeated.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `data`.
Has same shape as data, except for dimension_0 which
@@ -1586,7 +1510,7 @@ tf.segment_sum(c, tf.constant([0, 0, 1]))
- - -
-### `tf.sparse_segment_mean(data, indices, segment_ids, name=None)` <a class="md-anchor" id="sparse_segment_mean"></a>
+### `tf.sparse_segment_mean(data, indices, segment_ids, name=None)` {#sparse_segment_mean}
Computes the mean along sparse segments of a tensor.
@@ -1597,7 +1521,7 @@ 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`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`data`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`.
@@ -1607,7 +1531,7 @@ dimension, selecting a subset of dimension_0, specified by `indices`.
A 1-D tensor. Values should be sorted and can be repeated.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `data`.
Has same shape as data, except for dimension_0 which
@@ -1616,7 +1540,7 @@ dimension, selecting a subset of dimension_0, specified by `indices`.
-## Sequence Comparison and Indexing <a class="md-anchor" id="AUTOGENERATED-sequence-comparison-and-indexing"></a>
+## Sequence Comparison and Indexing
TensorFlow provides several operations that you can use to add sequence
comparison and index extraction to your graph. You can use these operations to
@@ -1625,11 +1549,11 @@ a tensor.
- - -
-### `tf.argmin(input, dimension, name=None)` <a class="md-anchor" id="argmin"></a>
+### `tf.argmin(input, dimension, name=None)` {#argmin}
Returns the index with the smallest value across dimensions of a tensor.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`input`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int64`, `int32`, `uint8`, `int16`, `int8`, `complex64`, `qint8`, `quint8`, `qint32`.
@@ -1638,18 +1562,18 @@ Returns the index with the smallest value across dimensions of a tensor.
of the input Tensor to reduce across. For vectors, use dimension = 0.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` of type `int64`.
- - -
-### `tf.argmax(input, dimension, name=None)` <a class="md-anchor" id="argmax"></a>
+### `tf.argmax(input, dimension, name=None)` {#argmax}
Returns the index with the largest value across dimensions of a tensor.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`input`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int64`, `int32`, `uint8`, `int16`, `int8`, `complex64`, `qint8`, `quint8`, `qint32`.
@@ -1658,7 +1582,7 @@ Returns the index with the largest value across dimensions of a tensor.
of the input Tensor to reduce across. For vectors, use dimension = 0.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` of type `int64`.
@@ -1666,7 +1590,7 @@ Returns the index with the largest value across dimensions of a tensor.
- - -
-### `tf.listdiff(x, y, name=None)` <a class="md-anchor" id="listdiff"></a>
+### `tf.listdiff(x, y, name=None)` {#listdiff}
Computes the difference between two lists of numbers.
@@ -1692,14 +1616,14 @@ out ==> [2, 4, 6]
idx ==> [1, 3, 5]
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor`. 1-D. Values to keep.
* <b>`y`</b>: A `Tensor`. Must have the same type as `x`. 1-D. Values to remove.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A tuple of `Tensor` objects (out, idx).
@@ -1709,7 +1633,7 @@ idx ==> [1, 3, 5]
- - -
-### `tf.where(input, name=None)` <a class="md-anchor" id="where"></a>
+### `tf.where(input, name=None)` {#where}
Returns locations of true values in a boolean tensor.
@@ -1745,20 +1669,20 @@ where(input) ==> [[0, 0, 0],
[2, 1, 1]]
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`input`</b>: A `Tensor` of type `bool`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` of type `int64`.
- - -
-### `tf.unique(x, name=None)` <a class="md-anchor" id="unique"></a>
+### `tf.unique(x, name=None)` {#unique}
Finds unique elements in a 1-D tensor.
@@ -1778,13 +1702,13 @@ y ==> [1, 2, 4, 7, 8]
idx ==> [0, 0, 1, 2, 2, 2, 3, 4, 4]
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor`. 1-D.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A tuple of `Tensor` objects (y, idx).
@@ -1795,7 +1719,7 @@ idx ==> [0, 0, 1, 2, 2, 2, 3, 4, 4]
- - -
-### `tf.edit_distance(hypothesis, truth, normalize=True, name='edit_distance')` <a class="md-anchor" id="edit_distance"></a>
+### `tf.edit_distance(hypothesis, truth, normalize=True, name='edit_distance')` {#edit_distance}
Computes the Levenshtein distance between sequences.
@@ -1841,7 +1765,7 @@ output ==> [[inf, 1.0], # (0,0): no truth, (0,1): no hypothesis
[0.5, 1.0]] # (1,0): addition, (1,1): no hypothesis
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`hypothesis`</b>: A `SparseTensor` containing hypothesis sequences.
@@ -1850,12 +1774,12 @@ output ==> [[inf, 1.0], # (0,0): no truth, (0,1): no hypothesis
length of `truth.`
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A dense `Tensor` with rank `R - 1`, where R is the rank of the
`SparseTensor` inputs `hypothesis` and `truth`.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`TypeError`</b>: If either `hypothesis` or `truth` are not a `SparseTensor`.
@@ -1864,7 +1788,7 @@ output ==> [[inf, 1.0], # (0,0): no truth, (0,1): no hypothesis
- - -
-### `tf.invert_permutation(x, name=None)` <a class="md-anchor" id="invert_permutation"></a>
+### `tf.invert_permutation(x, name=None)` {#invert_permutation}
Computes the inverse permutation of a tensor.
@@ -1884,22 +1808,22 @@ For example:
invert_permutation(x) ==> [2, 4, 3, 0, 1]
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor` of type `int32`. 1-D.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` of type `int32`. 1-D.
-## Other Functions and Classes <a class="md-anchor" id="AUTOGENERATED-other-functions-and-classes"></a>
+## Other Functions and Classes
- - -
-### `tf.floordiv(x, y, name=None)` <a class="md-anchor" id="floordiv"></a>
+### `tf.floordiv(x, y, name=None)` {#floordiv}
Divides `x / y` elementwise, rounding down for floating point.
@@ -1915,18 +1839,18 @@ Note that for efficiency, __floordiv__ uses C semantics for negative numbers
`x` and `y` must have the same type, and the result will have the same type
as well.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: `Tensor` numerator of real numeric type.
* <b>`y`</b>: `Tensor` numerator of real numeric type.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
`x / y` rounded down (except possibly for integers in C).
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`TypeError`</b>: If the inputs are complex.
@@ -1934,7 +1858,7 @@ as well.
- - -
-### `tf.truediv(x, y, name=None)` <a class="md-anchor" id="truediv"></a>
+### `tf.truediv(x, y, name=None)` {#truediv}
Divides x / y elementwise, always producing floating point results.
@@ -1949,18 +1873,18 @@ point, the output will have the same type. If the inputs are integral, the
inputs are cast to `float32` for `int8` and `int16` and `float64` for `int32`
and `int64` (matching the behavior of Numpy).
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: `Tensor` numerator of numeric type.
* <b>`y`</b>: `Tensor` denominator of numeric type.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
`x / y` evaluated in floating point.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`TypeError`</b>: If `x` and `y` have different dtypes.
diff --git a/tensorflow/g3doc/api_docs/python/nn.md b/tensorflow/g3doc/api_docs/python/nn.md
index 640ceb1bea..7371b9d0d2 100644
--- a/tensorflow/g3doc/api_docs/python/nn.md
+++ b/tensorflow/g3doc/api_docs/python/nn.md
@@ -1,60 +1,13 @@
<!-- This file is machine generated: DO NOT EDIT! -->
-# Neural Network <a class="md-anchor" id="AUTOGENERATED-neural-network"></a>
+# Neural Network
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
-### [Neural Network](#AUTOGENERATED-neural-network)
-* [Activation Functions](#AUTOGENERATED-activation-functions)
- * [`tf.nn.relu(features, name=None)`](#relu)
- * [`tf.nn.relu6(features, name=None)`](#relu6)
- * [`tf.nn.softplus(features, name=None)`](#softplus)
- * [`tf.nn.dropout(x, keep_prob, noise_shape=None, seed=None, name=None)`](#dropout)
- * [`tf.nn.bias_add(value, bias, name=None)`](#bias_add)
- * [`tf.sigmoid(x, name=None)`](#sigmoid)
- * [`tf.tanh(x, name=None)`](#tanh)
-* [Convolution](#AUTOGENERATED-convolution)
- * [`tf.nn.conv2d(input, filter, strides, padding, use_cudnn_on_gpu=None, name=None)`](#conv2d)
- * [`tf.nn.depthwise_conv2d(input, filter, strides, padding, name=None)`](#depthwise_conv2d)
- * [`tf.nn.separable_conv2d(input, depthwise_filter, pointwise_filter, strides, padding, name=None)`](#separable_conv2d)
-* [Pooling](#AUTOGENERATED-pooling)
- * [`tf.nn.avg_pool(value, ksize, strides, padding, name=None)`](#avg_pool)
- * [`tf.nn.max_pool(value, ksize, strides, padding, name=None)`](#max_pool)
- * [`tf.nn.max_pool_with_argmax(input, ksize, strides, padding, Targmax=None, name=None)`](#max_pool_with_argmax)
-* [Normalization](#AUTOGENERATED-normalization)
- * [`tf.nn.l2_normalize(x, dim, epsilon=1e-12, name=None)`](#l2_normalize)
- * [`tf.nn.local_response_normalization(input, depth_radius=None, bias=None, alpha=None, beta=None, name=None)`](#local_response_normalization)
- * [`tf.nn.moments(x, axes, name=None)`](#moments)
-* [Losses](#AUTOGENERATED-losses)
- * [`tf.nn.l2_loss(t, name=None)`](#l2_loss)
-* [Classification](#AUTOGENERATED-classification)
- * [`tf.nn.sigmoid_cross_entropy_with_logits(logits, targets, name=None)`](#sigmoid_cross_entropy_with_logits)
- * [`tf.nn.softmax(logits, name=None)`](#softmax)
- * [`tf.nn.softmax_cross_entropy_with_logits(logits, labels, name=None)`](#softmax_cross_entropy_with_logits)
-* [Embeddings](#AUTOGENERATED-embeddings)
- * [`tf.nn.embedding_lookup(params, ids, name=None)`](#embedding_lookup)
-* [Evaluation](#AUTOGENERATED-evaluation)
- * [`tf.nn.top_k(input, k, name=None)`](#top_k)
- * [`tf.nn.in_top_k(predictions, targets, k, name=None)`](#in_top_k)
-* [Candidate Sampling](#AUTOGENERATED-candidate-sampling)
- * [Sampled Loss Functions](#AUTOGENERATED-sampled-loss-functions)
- * [`tf.nn.nce_loss(weights, biases, inputs, labels, num_sampled, num_classes, num_true=1, sampled_values=None, remove_accidental_hits=False, name='nce_loss')`](#nce_loss)
- * [`tf.nn.sampled_softmax_loss(weights, biases, inputs, labels, num_sampled, num_classes, num_true=1, sampled_values=None, remove_accidental_hits=True, name='sampled_softmax_loss')`](#sampled_softmax_loss)
- * [Candidate Samplers](#AUTOGENERATED-candidate-samplers)
- * [`tf.nn.uniform_candidate_sampler(true_classes, num_true, num_sampled, unique, range_max, seed=None, name=None)`](#uniform_candidate_sampler)
- * [`tf.nn.log_uniform_candidate_sampler(true_classes, num_true, num_sampled, unique, range_max, seed=None, name=None)`](#log_uniform_candidate_sampler)
- * [`tf.nn.learned_unigram_candidate_sampler(true_classes, num_true, num_sampled, unique, range_max, seed=None, name=None)`](#learned_unigram_candidate_sampler)
- * [`tf.nn.fixed_unigram_candidate_sampler(true_classes, num_true, num_sampled, unique, range_max, vocab_file='', distortion=0.0, num_reserved_ids=0, num_shards=1, shard=0, unigrams=[], seed=None, name=None)`](#fixed_unigram_candidate_sampler)
- * [Miscellaneous candidate sampling utilities](#AUTOGENERATED-miscellaneous-candidate-sampling-utilities)
- * [`tf.nn.compute_accidental_hits(true_classes, sampled_candidates, num_true, seed=None, name=None)`](#compute_accidental_hits)
-
-
-<!-- TOC-END This section was generated by neural network, THANKS FOR READING! -->
-
-## Activation Functions <a class="md-anchor" id="AUTOGENERATED-activation-functions"></a>
+[TOC]
+
+## Activation Functions
The activation ops provide different types of nonlinearities for use in
neural networks. These include smooth nonlinearities (`sigmoid`,
@@ -67,59 +20,59 @@ shape as the input tensor.
- - -
-### `tf.nn.relu(features, name=None)` <a class="md-anchor" id="relu"></a>
+### `tf.nn.relu(features, name=None)` {#relu}
Computes rectified linear: `max(features, 0)`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`features`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `int64`, `uint8`, `int16`, `int8`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `features`.
- - -
-### `tf.nn.relu6(features, name=None)` <a class="md-anchor" id="relu6"></a>
+### `tf.nn.relu6(features, name=None)` {#relu6}
Computes Rectified Linear 6: `min(max(features, 0), 6)`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`features`</b>: A `Tensor` with type `float`, `double`, `int32`, `int64`, `uint8`,
`int16`, or `int8`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` with the same type as `features`.
- - -
-### `tf.nn.softplus(features, name=None)` <a class="md-anchor" id="softplus"></a>
+### `tf.nn.softplus(features, name=None)` {#softplus}
Computes softplus: `log(exp(features) + 1)`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`features`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `int64`, `uint8`, `int16`, `int8`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `features`.
- - -
-### `tf.nn.dropout(x, keep_prob, noise_shape=None, seed=None, name=None)` <a class="md-anchor" id="dropout"></a>
+### `tf.nn.dropout(x, keep_prob, noise_shape=None, seed=None, name=None)` {#dropout}
Computes dropout.
@@ -135,7 +88,7 @@ will make independent decisions. For example, if `shape(x) = [k, l, m, n]`
and `noise_shape = [k, 1, 1, n]`, each batch and channel component will be
kept independently and each row and column will be kept or not kept together.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A tensor.
@@ -148,11 +101,11 @@ kept independently and each row and column will be kept or not kept together.
for behavior.
* <b>`name`</b>: A name for this operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A Tensor of the same shape of `x`.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`ValueError`</b>: If `keep_prob` is not in `(0, 1]`.
@@ -160,7 +113,7 @@ kept independently and each row and column will be kept or not kept together.
- - -
-### `tf.nn.bias_add(value, bias, name=None)` <a class="md-anchor" id="bias_add"></a>
+### `tf.nn.bias_add(value, bias, name=None)` {#bias_add}
Adds `bias` to `value`.
@@ -169,7 +122,7 @@ Broadcasting is supported, so `value` may have any number of dimensions.
Unlike `tf.add`, the type of `bias` is allowed to differ from `value` in the
case where both types are quantized.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`value`</b>: A `Tensor` with type `float`, `double`, `int64`, `int32`, `uint8`,
@@ -179,27 +132,27 @@ case where both types are quantized.
in which case a different quantized type may be used.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` with the same type as `value`.
- - -
-### `tf.sigmoid(x, name=None)` <a class="md-anchor" id="sigmoid"></a>
+### `tf.sigmoid(x, name=None)` {#sigmoid}
Computes sigmoid of `x` element-wise.
Specifically, `y = 1 / (1 + exp(-x))`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A Tensor with type `float`, `double`, `int32`, `complex64`, `int64`,
or `qint32`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A Tensor with the same type as `x` if `x.dtype != qint32`
otherwise the return type is `quint8`.
@@ -207,25 +160,25 @@ Specifically, `y = 1 / (1 + exp(-x))`.
- - -
-### `tf.tanh(x, name=None)` <a class="md-anchor" id="tanh"></a>
+### `tf.tanh(x, name=None)` {#tanh}
Computes hyperbolic tangent of `x` element-wise.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A Tensor with type `float`, `double`, `int32`, `complex64`, `int64`,
or `qint32`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A Tensor with the same type as `x` if `x.dtype != qint32` otherwise
the return type is `quint8`.
-## Convolution <a class="md-anchor" id="AUTOGENERATED-convolution"></a>
+## Convolution
The convolution ops sweep a 2-D filter over a batch of images, applying the
filter to each window of each image of the appropriate size. The different
@@ -295,7 +248,7 @@ concatenated.
- - -
-### `tf.nn.conv2d(input, filter, strides, padding, use_cudnn_on_gpu=None, name=None)` <a class="md-anchor" id="conv2d"></a>
+### `tf.nn.conv2d(input, filter, strides, padding, use_cudnn_on_gpu=None, name=None)` {#conv2d}
Computes a 2-D convolution given 4-D `input` and `filter` tensors.
@@ -321,7 +274,7 @@ In detail,
Must have `strides[0] = strides[3] = 1`. For the most common case of the same
horizontal and vertices strides, `strides = [1, stride, stride, 1]`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`input`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`.
@@ -334,14 +287,14 @@ horizontal and vertices strides, `strides = [1, stride, stride, 1]`.
* <b>`use_cudnn_on_gpu`</b>: An optional `bool`. Defaults to `True`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `input`.
- - -
-### `tf.nn.depthwise_conv2d(input, filter, strides, padding, name=None)` <a class="md-anchor" id="depthwise_conv2d"></a>
+### `tf.nn.depthwise_conv2d(input, filter, strides, padding, name=None)` {#depthwise_conv2d}
Depthwise 2-D convolution.
@@ -362,7 +315,7 @@ In detail,
Must have `strides[0] = strides[3] = 1`. For the most common case of the
same horizontal and vertical strides, `strides = [1, stride, stride, 1]`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`input`</b>: 4-D with shape `[batch, in_height, in_width, in_channels]`.
@@ -373,7 +326,7 @@ same horizontal and vertical strides, `strides = [1, stride, stride, 1]`.
* <b>`padding`</b>: A string, either `'VALID'` or `'SAME'`. The padding algorithm.
* <b>`name`</b>: A name for this operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A 4-D `Tensor` of shape
`[batch, out_height, out_width, in_channels * channel_multiplier].`
@@ -381,7 +334,7 @@ same horizontal and vertical strides, `strides = [1, stride, stride, 1]`.
- - -
-### `tf.nn.separable_conv2d(input, depthwise_filter, pointwise_filter, strides, padding, name=None)` <a class="md-anchor" id="separable_conv2d"></a>
+### `tf.nn.separable_conv2d(input, depthwise_filter, pointwise_filter, strides, padding, name=None)` {#separable_conv2d}
2-D convolution with separable filters.
@@ -402,7 +355,7 @@ the pointwise convolution has implicit strides of `[1, 1, 1, 1]`. Must have
`strides[0] = strides[3] = 1`. For the most common case of the same
horizontal and vertical strides, `strides = [1, stride, stride, 1]`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`input`</b>: 4-D `Tensor` with shape `[batch, in_height, in_width, in_channels]`.
@@ -417,13 +370,13 @@ horizontal and vertical strides, `strides = [1, stride, stride, 1]`.
* <b>`padding`</b>: A string, either `'VALID'` or `'SAME'`. The padding algorithm.
* <b>`name`</b>: A name for this operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A 4-D `Tensor` of shape `[batch, out_height, out_width, out_channels]`.
-## Pooling <a class="md-anchor" id="AUTOGENERATED-pooling"></a>
+## Pooling
The pooling ops sweep a rectangular window over the input tensor, computing a
reduction operation for each window (average, max, or max with argmax). Each
@@ -440,14 +393,14 @@ to the `Convolution` section for details about the padding calculation.
- - -
-### `tf.nn.avg_pool(value, ksize, strides, padding, name=None)` <a class="md-anchor" id="avg_pool"></a>
+### `tf.nn.avg_pool(value, ksize, strides, padding, name=None)` {#avg_pool}
Performs the average pooling on the input.
Each entry in `output` is the mean of the corresponding size `ksize`
window in `value`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`value`</b>: A 4-D `Tensor` of shape `[batch, height, width, channels]` and type
@@ -460,18 +413,18 @@ window in `value`.
* <b>`padding`</b>: A string, either `'VALID'` or `'SAME'`. The padding algorithm.
* <b>`name`</b>: Optional name for the operation.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` with the same type as `value`. The average pooled output tensor.
- - -
-### `tf.nn.max_pool(value, ksize, strides, padding, name=None)` <a class="md-anchor" id="max_pool"></a>
+### `tf.nn.max_pool(value, ksize, strides, padding, name=None)` {#max_pool}
Performs the max pooling on the input.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`value`</b>: A 4-D `Tensor` with shape `[batch, height, width, channels]` and
@@ -483,14 +436,14 @@ Performs the max pooling on the input.
* <b>`padding`</b>: A string, either `'VALID'` or `'SAME'`. The padding algorithm.
* <b>`name`</b>: Optional name for the operation.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` with the same type as `value`. The max pooled output tensor.
- - -
-### `tf.nn.max_pool_with_argmax(input, ksize, strides, padding, Targmax=None, name=None)` <a class="md-anchor" id="max_pool_with_argmax"></a>
+### `tf.nn.max_pool_with_argmax(input, ksize, strides, padding, Targmax=None, name=None)` {#max_pool_with_argmax}
Performs max pooling on the input and outputs both max values and indices.
@@ -498,7 +451,7 @@ The indices in `argmax` are flattened, so that a maximum value at position
`[b, y, x, c]` becomes flattened index
`((b * height + y) * width + x) * channels + c`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`input`</b>: A `Tensor` of type `float32`.
@@ -513,7 +466,7 @@ The indices in `argmax` are flattened, so that a maximum value at position
* <b>`Targmax`</b>: An optional `tf.DType` from: `tf.int32, tf.int64`. Defaults to `tf.int64`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A tuple of `Tensor` objects (output, argmax).
@@ -522,14 +475,14 @@ The indices in `argmax` are flattened, so that a maximum value at position
-## Normalization <a class="md-anchor" id="AUTOGENERATED-normalization"></a>
+## Normalization
Normalization is useful to prevent neurons from saturating when inputs may
have varying scale, and to aid generalization.
- - -
-### `tf.nn.l2_normalize(x, dim, epsilon=1e-12, name=None)` <a class="md-anchor" id="l2_normalize"></a>
+### `tf.nn.l2_normalize(x, dim, epsilon=1e-12, name=None)` {#l2_normalize}
Normalizes along dimension `dim` using an L2 norm.
@@ -540,7 +493,7 @@ For a 1-D tensor with `dim = 0`, computes
For `x` with more dimensions, independently normalizes each 1-D slice along
dimension `dim`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor`.
@@ -549,14 +502,14 @@ dimension `dim`.
divisor if `norm < sqrt(epsilon)`.
* <b>`name`</b>: A name for this operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` with the same shape as `x`.
- - -
-### `tf.nn.local_response_normalization(input, depth_radius=None, bias=None, alpha=None, beta=None, name=None)` <a class="md-anchor" id="local_response_normalization"></a>
+### `tf.nn.local_response_normalization(input, depth_radius=None, bias=None, alpha=None, beta=None, name=None)` {#local_response_normalization}
Local Response Normalization.
@@ -573,7 +526,7 @@ For details, see [Krizhevsky et al., ImageNet classification with deep
convolutional neural networks (NIPS 2012)]
(http://papers.nips.cc/paper/4824-imagenet-classification-with-deep-convolutional-neural-networks).
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`input`</b>: A `Tensor` of type `float32`. 4-D.
@@ -586,14 +539,14 @@ convolutional neural networks (NIPS 2012)]
* <b>`beta`</b>: An optional `float`. Defaults to `0.5`. An exponent.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` of type `float32`.
- - -
-### `tf.nn.moments(x, axes, name=None)` <a class="md-anchor" id="moments"></a>
+### `tf.nn.moments(x, axes, name=None)` {#moments}
Calculate the mean and variance of `x`.
@@ -605,7 +558,7 @@ For so-called "global normalization" needed for convolutional filters pass
`axes=[0, 1, 2]` (batch, height, width). For batch normalization pass
`axes=[0]` (batch).
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`x`</b>: A `Tensor`.
@@ -613,13 +566,13 @@ For so-called "global normalization" needed for convolutional filters pass
variance.
* <b>`name`</b>: Name used to scope the operations that compute the moments.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
Two `Tensor` objects: `mean` and `variance`.
-## Losses <a class="md-anchor" id="AUTOGENERATED-losses"></a>
+## Losses
The loss ops measure error between two tensors, or between a tensor and zero.
These can be used for measuring accuracy of a network in a regression task
@@ -627,7 +580,7 @@ or for regularization purposes (weight decay).
- - -
-### `tf.nn.l2_loss(t, name=None)` <a class="md-anchor" id="l2_loss"></a>
+### `tf.nn.l2_loss(t, name=None)` {#l2_loss}
L2 Loss.
@@ -635,26 +588,26 @@ Computes half the L2 norm of a tensor without the `sqrt`:
output = sum(t ** 2) / 2
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`t`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int64`, `int32`, `uint8`, `int16`, `int8`, `complex64`, `qint8`, `quint8`, `qint32`.
Typically 2-D, but may have any dimensions.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `t`. 0-D.
-## Classification <a class="md-anchor" id="AUTOGENERATED-classification"></a>
+## Classification
TensorFlow provides several operations that help you perform classification.
- - -
-### `tf.nn.sigmoid_cross_entropy_with_logits(logits, targets, name=None)` <a class="md-anchor" id="sigmoid_cross_entropy_with_logits"></a>
+### `tf.nn.sigmoid_cross_entropy_with_logits(logits, targets, name=None)` {#sigmoid_cross_entropy_with_logits}
Computes sigmoid cross entropy given `logits`.
@@ -673,14 +626,14 @@ To ensure stability and avoid overflow, the implementation uses
`logits` and `targets` must have the same type and shape.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`logits`</b>: A `Tensor` of type `float32` or `float64`.
* <b>`targets`</b>: A `Tensor` of the same type and shape as `logits`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` of the same shape as `logits` with the componentwise
logistic losses.
@@ -688,7 +641,7 @@ To ensure stability and avoid overflow, the implementation uses
- - -
-### `tf.nn.softmax(logits, name=None)` <a class="md-anchor" id="softmax"></a>
+### `tf.nn.softmax(logits, name=None)` {#softmax}
Computes softmax activations.
@@ -696,21 +649,21 @@ For each batch `i` and class `j` we have
softmax[i, j] = exp(logits[i, j]) / sum(exp(logits[i]))
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`logits`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`.
2-D with shape `[batch_size, num_classes]`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `logits`. Same shape as `logits`.
- - -
-### `tf.nn.softmax_cross_entropy_with_logits(logits, labels, name=None)` <a class="md-anchor" id="softmax_cross_entropy_with_logits"></a>
+### `tf.nn.softmax_cross_entropy_with_logits(logits, labels, name=None)` {#softmax_cross_entropy_with_logits}
Computes softmax cross entropy between `logits` and `labels`.
@@ -726,28 +679,28 @@ output of `softmax`, as it will produce incorrect results.
`logits` and `labels` must have the same shape `[batch_size, num_classes]`
and the same dtype (either `float32` or `float64`).
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`logits`</b>: Unscaled log probabilities.
* <b>`labels`</b>: Each row `labels[i]` must be a valid probability distribution.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A 1-D `Tensor` of length `batch_size` of the same type as `logits` with the
softmax cross entropy loss.
-## Embeddings <a class="md-anchor" id="AUTOGENERATED-embeddings"></a>
+## Embeddings
TensorFlow provides library support for looking up values in embedding
tensors.
- - -
-### `tf.nn.embedding_lookup(params, ids, name=None)` <a class="md-anchor" id="embedding_lookup"></a>
+### `tf.nn.embedding_lookup(params, ids, name=None)` {#embedding_lookup}
Looks up `ids` in a list of embedding tensors.
@@ -763,7 +716,7 @@ then used to look up the slice `params[p][id // len(params), ...]`.
The results of the lookup are then concatenated into a dense
tensor. The returned tensor has shape `shape(ids) + shape(params)[1:]`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`params`</b>: A list of tensors with the same shape and type.
@@ -771,25 +724,25 @@ tensor. The returned tensor has shape `shape(ids) + shape(params)[1:]`.
up in `params`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` with the same type as the tensors in `params`.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`ValueError`</b>: If `params` is empty.
-## Evaluation <a class="md-anchor" id="AUTOGENERATED-evaluation"></a>
+## Evaluation
The evaluation ops are useful for measuring the performance of a network.
Since they are nondifferentiable, they are typically used at evaluation time.
- - -
-### `tf.nn.top_k(input, k, name=None)` <a class="md-anchor" id="top_k"></a>
+### `tf.nn.top_k(input, k, name=None)` {#top_k}
Returns the values and indices of the k largest elements for each row.
@@ -799,7 +752,7 @@ Returns the values and indices of the k largest elements for each row.
such that \\(input_{i, indices_{i, j}} = values_{i, j}\\). If two
elements are equal, the lower-index element appears first.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`input`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `int64`, `uint8`, `int16`, `int8`.
@@ -808,7 +761,7 @@ elements are equal, the lower-index element appears first.
Number of top elements to look for within each row
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A tuple of `Tensor` objects (values, indices).
@@ -819,7 +772,7 @@ elements are equal, the lower-index element appears first.
- - -
-### `tf.nn.in_top_k(predictions, targets, k, name=None)` <a class="md-anchor" id="in_top_k"></a>
+### `tf.nn.in_top_k(predictions, targets, k, name=None)` {#in_top_k}
Says whether the targets are in the top K predictions.
@@ -838,7 +791,7 @@ More formally, let
$$out_i = predictions_{i, targets_i} \in TopKIncludingTies(predictions_i)$$
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`predictions`</b>: A `Tensor` of type `float32`. A batch_size x classes tensor
@@ -846,13 +799,13 @@ $$out_i = predictions_{i, targets_i} \in TopKIncludingTies(predictions_i)$$
* <b>`k`</b>: An `int`. Number of top elements to look at for computing precision
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` of type `bool`. Computed Precision at k as a bool Tensor
-## Candidate Sampling <a class="md-anchor" id="AUTOGENERATED-candidate-sampling"></a>
+## Candidate Sampling
Do you want to train a multiclass or multilabel model with thousands
or millions of output classes (for example, a language model with a
@@ -865,13 +818,13 @@ only considering a small randomly-chosen subset of contrastive classes
See our [Candidate Sampling Algorithms Reference]
(../../extras/candidate_sampling.pdf)
-### Sampled Loss Functions <a class="md-anchor" id="AUTOGENERATED-sampled-loss-functions"></a>
+### Sampled Loss Functions
TensorFlow provides the following sampled loss functions for faster training.
- - -
-### `tf.nn.nce_loss(weights, biases, inputs, labels, num_sampled, num_classes, num_true=1, sampled_values=None, remove_accidental_hits=False, name='nce_loss')` <a class="md-anchor" id="nce_loss"></a>
+### `tf.nn.nce_loss(weights, biases, inputs, labels, num_sampled, num_classes, num_true=1, sampled_values=None, remove_accidental_hits=False, name='nce_loss')` {#nce_loss}
Computes and returns the noise-contrastive estimation training loss.
@@ -891,7 +844,7 @@ For now, if you have a variable number of target classes, you can pad them
out to a constant number by either repeating them or by padding
with an otherwise unused class.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`weights`</b>: A `Tensor` of shape [num_classes, dim]. The class embeddings.
@@ -915,14 +868,14 @@ with an otherwise unused class.
Default is False.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A batch_size 1-D tensor of per-example NCE losses.
- - -
-### `tf.nn.sampled_softmax_loss(weights, biases, inputs, labels, num_sampled, num_classes, num_true=1, sampled_values=None, remove_accidental_hits=True, name='sampled_softmax_loss')` <a class="md-anchor" id="sampled_softmax_loss"></a>
+### `tf.nn.sampled_softmax_loss(weights, biases, inputs, labels, num_sampled, num_classes, num_true=1, sampled_values=None, remove_accidental_hits=True, name='sampled_softmax_loss')` {#sampled_softmax_loss}
Computes and returns the sampled softmax training loss.
@@ -940,7 +893,7 @@ See our [Candidate Sampling Algorithms Reference]
Also see Section 3 of http://arxiv.org/abs/1412.2007 for the math.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`weights`</b>: A `Tensor` of shape [num_classes, dim]. The class embeddings.
@@ -961,20 +914,20 @@ Also see Section 3 of http://arxiv.org/abs/1412.2007 for the math.
True.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A batch_size 1-D tensor of per-example sampled softmax losses.
-### Candidate Samplers <a class="md-anchor" id="AUTOGENERATED-candidate-samplers"></a>
+### Candidate Samplers
TensorFlow provides the following samplers for randomly sampling candidate
classes when using one of the sampled loss functions above.
- - -
-### `tf.nn.uniform_candidate_sampler(true_classes, num_true, num_sampled, unique, range_max, seed=None, name=None)` <a class="md-anchor" id="uniform_candidate_sampler"></a>
+### `tf.nn.uniform_candidate_sampler(true_classes, num_true, num_sampled, unique, range_max, seed=None, name=None)` {#uniform_candidate_sampler}
Samples a set of classes using a uniform base distribution.
@@ -998,7 +951,7 @@ document](http://www.tensorflow.org/extras/candidate_sampling.pdf).
If `unique=True`, then these are post-rejection probabilities and we
compute them approximately.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`true_classes`</b>: A `Tensor` of type `int64` and shape `[batch_size,
@@ -1011,7 +964,7 @@ compute them approximately.
* <b>`seed`</b>: An `int`. An operation-specific seed. Default is 0.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
* <b>`sampled_candidates`</b>: A tensor of type `int64` and shape `[num_sampled]`.
@@ -1026,7 +979,7 @@ compute them approximately.
- - -
-### `tf.nn.log_uniform_candidate_sampler(true_classes, num_true, num_sampled, unique, range_max, seed=None, name=None)` <a class="md-anchor" id="log_uniform_candidate_sampler"></a>
+### `tf.nn.log_uniform_candidate_sampler(true_classes, num_true, num_sampled, unique, range_max, seed=None, name=None)` {#log_uniform_candidate_sampler}
Samples a set of classes using a log-uniform (Zipfian) base distribution.
@@ -1057,7 +1010,7 @@ document](http://www.tensorflow.org/extras/candidate_sampling.pdf).
If `unique=True`, then these are post-rejection probabilities and we
compute them approximately.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`true_classes`</b>: A `Tensor` of type `int64` and shape `[batch_size,
@@ -1070,7 +1023,7 @@ compute them approximately.
* <b>`seed`</b>: An `int`. An operation-specific seed. Default is 0.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
* <b>`sampled_candidates`</b>: A tensor of type `int64` and shape `[num_sampled]`.
@@ -1085,7 +1038,7 @@ compute them approximately.
- - -
-### `tf.nn.learned_unigram_candidate_sampler(true_classes, num_true, num_sampled, unique, range_max, seed=None, name=None)` <a class="md-anchor" id="learned_unigram_candidate_sampler"></a>
+### `tf.nn.learned_unigram_candidate_sampler(true_classes, num_true, num_sampled, unique, range_max, seed=None, name=None)` {#learned_unigram_candidate_sampler}
Samples a set of classes from a distribution learned during training.
@@ -1113,7 +1066,7 @@ document](http://www.tensorflow.org/extras/candidate_sampling.pdf).
If `unique=True`, then these are post-rejection probabilities and we
compute them approximately.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`true_classes`</b>: A `Tensor` of type `int64` and shape `[batch_size,
@@ -1126,7 +1079,7 @@ compute them approximately.
* <b>`seed`</b>: An `int`. An operation-specific seed. Default is 0.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
* <b>`sampled_candidates`</b>: A tensor of type `int64` and shape `[num_sampled]`.
@@ -1141,7 +1094,7 @@ compute them approximately.
- - -
-### `tf.nn.fixed_unigram_candidate_sampler(true_classes, num_true, num_sampled, unique, range_max, vocab_file='', distortion=0.0, num_reserved_ids=0, num_shards=1, shard=0, unigrams=[], seed=None, name=None)` <a class="md-anchor" id="fixed_unigram_candidate_sampler"></a>
+### `tf.nn.fixed_unigram_candidate_sampler(true_classes, num_true, num_sampled, unique, range_max, vocab_file='', distortion=0.0, num_reserved_ids=0, num_shards=1, shard=0, unigrams=[], seed=None, name=None)` {#fixed_unigram_candidate_sampler}
Samples a set of classes using the provided (fixed) base distribution.
@@ -1166,7 +1119,7 @@ document](http://www.tensorflow.org/extras/candidate_sampling.pdf).
If `unique=True`, then these are post-rejection probabilities and we
compute them approximately.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`true_classes`</b>: A `Tensor` of type `int64` and shape `[batch_size,
@@ -1204,7 +1157,7 @@ compute them approximately.
* <b>`seed`</b>: An `int`. An operation-specific seed. Default is 0.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
* <b>`sampled_candidates`</b>: A tensor of type `int64` and shape `[num_sampled]`.
@@ -1218,11 +1171,11 @@ compute them approximately.
-### Miscellaneous candidate sampling utilities <a class="md-anchor" id="AUTOGENERATED-miscellaneous-candidate-sampling-utilities"></a>
+### Miscellaneous candidate sampling utilities
- - -
-### `tf.nn.compute_accidental_hits(true_classes, sampled_candidates, num_true, seed=None, name=None)` <a class="md-anchor" id="compute_accidental_hits"></a>
+### `tf.nn.compute_accidental_hits(true_classes, sampled_candidates, num_true, seed=None, name=None)` {#compute_accidental_hits}
Compute the ids of positions in sampled_candidates matching true_classes.
@@ -1246,7 +1199,7 @@ operation, then added to the logits of the sampled classes. This
removes the contradictory effect of accidentally sampling the true
target classes as noise classes for the same example.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`true_classes`</b>: A `Tensor` of type `int64` and shape `[batch_size,
@@ -1257,7 +1210,7 @@ target classes as noise classes for the same example.
* <b>`seed`</b>: An `int`. An operation-specific seed. Default is 0.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
* <b>`indices`</b>: A `Tensor` of type `int32` and shape `[num_accidental_hits]`.
diff --git a/tensorflow/g3doc/api_docs/python/python_io.md b/tensorflow/g3doc/api_docs/python/python_io.md
index d349c0a106..8fcba1df68 100644
--- a/tensorflow/g3doc/api_docs/python/python_io.md
+++ b/tensorflow/g3doc/api_docs/python/python_io.md
@@ -1,18 +1,9 @@
<!-- This file is machine generated: DO NOT EDIT! -->
-# Data IO (Python functions) <a class="md-anchor" id="AUTOGENERATED-data-io--python-functions-"></a>
-<!-- TOC-BEGIN This section is generated by neural network: DO NOT EDIT! -->
-## Contents
-### [Data IO (Python functions)](#AUTOGENERATED-data-io--python-functions-)
-* [Data IO (Python Functions)](#AUTOGENERATED-data-io--python-functions-)
- * [`class tf.python_io.TFRecordWriter`](#TFRecordWriter)
- * [`tf.python_io.tf_record_iterator(path)`](#tf_record_iterator)
- * [TFRecords Format Details](#AUTOGENERATED-tfrecords-format-details)
+# Data IO (Python functions)
+[TOC]
-
-<!-- TOC-END This section was generated by neural network, THANKS FOR READING! -->
-
-## Data IO (Python Functions) <a class="md-anchor" id="AUTOGENERATED-data-io--python-functions-"></a>
+## Data IO (Python Functions)
A TFRecords file represents a sequence of (binary) strings. The format is not
random access, so it is suitable for streaming large amounts of data but not
@@ -20,7 +11,7 @@ suitable if fast sharding or other non-sequential access is desired.
- - -
-### `class tf.python_io.TFRecordWriter` <a class="md-anchor" id="TFRecordWriter"></a>
+### `class tf.python_io.TFRecordWriter` {#TFRecordWriter}
A class to write records to a TFRecords file.
@@ -29,16 +20,16 @@ in `with` blocks like a normal file.
- - -
-#### `tf.python_io.TFRecordWriter.__init__(path)` <a class="md-anchor" id="TFRecordWriter.__init__"></a>
+#### `tf.python_io.TFRecordWriter.__init__(path)` {#TFRecordWriter.__init__}
Opens file `path` and creates a `TFRecordWriter` writing to it.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`path`</b>: The path to the TFRecords file.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`IOError`</b>: If `path` cannot be opened for writing.
@@ -46,11 +37,11 @@ Opens file `path` and creates a `TFRecordWriter` writing to it.
- - -
-#### `tf.python_io.TFRecordWriter.write(record)` <a class="md-anchor" id="TFRecordWriter.write"></a>
+#### `tf.python_io.TFRecordWriter.write(record)` {#TFRecordWriter.write}
Write a string record to the file.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`record`</b>: str
@@ -58,7 +49,7 @@ Write a string record to the file.
- - -
-#### `tf.python_io.TFRecordWriter.close()` <a class="md-anchor" id="TFRecordWriter.close"></a>
+#### `tf.python_io.TFRecordWriter.close()` {#TFRecordWriter.close}
Close the file.
@@ -66,20 +57,20 @@ Close the file.
- - -
-### `tf.python_io.tf_record_iterator(path)` <a class="md-anchor" id="tf_record_iterator"></a>
+### `tf.python_io.tf_record_iterator(path)` {#tf_record_iterator}
An iterator that read the records from a TFRecords file.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`path`</b>: The path to the TFRecords file.
-##### Yields: <a class="md-anchor" id="AUTOGENERATED-yields-"></a>
+##### Yields:
Strings.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`IOError`</b>: If `path` cannot be opened for reading.
@@ -88,7 +79,7 @@ An iterator that read the records from a TFRecords file.
- - -
-### TFRecords Format Details <a class="md-anchor" id="AUTOGENERATED-tfrecords-format-details"></a>
+### TFRecords Format Details
A TFRecords file contains a sequence of strings with CRC hashes. Each record
has the format
diff --git a/tensorflow/g3doc/api_docs/python/sparse_ops.md b/tensorflow/g3doc/api_docs/python/sparse_ops.md
index 8c83897031..13220c70fc 100644
--- a/tensorflow/g3doc/api_docs/python/sparse_ops.md
+++ b/tensorflow/g3doc/api_docs/python/sparse_ops.md
@@ -1,30 +1,13 @@
<!-- This file is machine generated: DO NOT EDIT! -->
-# Sparse Tensors <a class="md-anchor" id="AUTOGENERATED-sparse-tensors"></a>
+# Sparse Tensors
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
-### [Sparse Tensors](#AUTOGENERATED-sparse-tensors)
-* [Sparse Tensor Representation](#AUTOGENERATED-sparse-tensor-representation)
- * [`class tf.SparseTensor`](#SparseTensor)
- * [`class tf.SparseTensorValue`](#SparseTensorValue)
-* [Sparse to Dense Conversion](#AUTOGENERATED-sparse-to-dense-conversion)
- * [`tf.sparse_to_dense(sparse_indices, output_shape, sparse_values, default_value, name=None)`](#sparse_to_dense)
- * [`tf.sparse_tensor_to_dense(sp_input, default_value, name=None)`](#sparse_tensor_to_dense)
- * [`tf.sparse_to_indicator(sp_input, vocab_size, name=None)`](#sparse_to_indicator)
-* [Manipulation](#AUTOGENERATED-manipulation)
- * [`tf.sparse_concat(concat_dim, sp_inputs, name=None)`](#sparse_concat)
- * [`tf.sparse_reorder(sp_input, name=None)`](#sparse_reorder)
- * [`tf.sparse_retain(sp_input, to_retain)`](#sparse_retain)
- * [`tf.sparse_fill_empty_rows(sp_input, default_value, name=None)`](#sparse_fill_empty_rows)
+[TOC]
-
-<!-- TOC-END This section was generated by neural network, THANKS FOR READING! -->
-
-## Sparse Tensor Representation <a class="md-anchor" id="AUTOGENERATED-sparse-tensor-representation"></a>
+## Sparse Tensor Representation
Tensorflow supports a `SparseTensor` representation for data that is sparse
in multiple dimensions. Contrast this representation with `IndexedSlices`,
@@ -33,7 +16,7 @@ dimension, and dense along all other dimensions.
- - -
-### `class tf.SparseTensor` <a class="md-anchor" id="SparseTensor"></a>
+### `class tf.SparseTensor` {#SparseTensor}
Represents a sparse tensor.
@@ -81,92 +64,92 @@ represents the dense tensor
- - -
-#### `tf.SparseTensor.__init__(indices, values, shape)` <a class="md-anchor" id="SparseTensor.__init__"></a>
+#### `tf.SparseTensor.__init__(indices, values, shape)` {#SparseTensor.__init__}
Creates a `SparseTensor`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`indices`</b>: A 2-D int64 tensor of shape `[N, ndims]`.
* <b>`values`</b>: A 1-D tensor of any type and shape `[N]`.
* <b>`dense_shape`</b>: A 1-D int64 tensor of shape `[ndims]`.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `SparseTensor`
- - -
-#### `tf.SparseTensor.indices` <a class="md-anchor" id="SparseTensor.indices"></a>
+#### `tf.SparseTensor.indices` {#SparseTensor.indices}
The indices of non-zero values in the represented dense tensor.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A 2-D Tensor of int64 with shape `[N, ndims]`, where `N` is the
number of non-zero values in the tensor, and `ndims` is the rank.
- - -
-#### `tf.SparseTensor.values` <a class="md-anchor" id="SparseTensor.values"></a>
+#### `tf.SparseTensor.values` {#SparseTensor.values}
The non-zero values in the represented dense tensor.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A 1-D Tensor of any data type.
- - -
-#### `tf.SparseTensor.dtype` <a class="md-anchor" id="SparseTensor.dtype"></a>
+#### `tf.SparseTensor.dtype` {#SparseTensor.dtype}
The `DType` of elements in this tensor.
- - -
-#### `tf.SparseTensor.shape` <a class="md-anchor" id="SparseTensor.shape"></a>
+#### `tf.SparseTensor.shape` {#SparseTensor.shape}
A 1-D Tensor of int64 representing the shape of the dense tensor.
- - -
-#### `tf.SparseTensor.graph` <a class="md-anchor" id="SparseTensor.graph"></a>
+#### `tf.SparseTensor.graph` {#SparseTensor.graph}
The `Graph` that contains the index, value, and shape tensors.
- - -
-### `class tf.SparseTensorValue` <a class="md-anchor" id="SparseTensorValue"></a>
+### `class tf.SparseTensorValue` {#SparseTensorValue}
SparseTensorValue(indices, values, shape)
- - -
-#### `tf.SparseTensorValue.indices` <a class="md-anchor" id="SparseTensorValue.indices"></a>
+#### `tf.SparseTensorValue.indices` {#SparseTensorValue.indices}
Alias for field number 0
- - -
-#### `tf.SparseTensorValue.shape` <a class="md-anchor" id="SparseTensorValue.shape"></a>
+#### `tf.SparseTensorValue.shape` {#SparseTensorValue.shape}
Alias for field number 2
- - -
-#### `tf.SparseTensorValue.values` <a class="md-anchor" id="SparseTensorValue.values"></a>
+#### `tf.SparseTensorValue.values` {#SparseTensorValue.values}
Alias for field number 1
-## Sparse to Dense Conversion <a class="md-anchor" id="AUTOGENERATED-sparse-to-dense-conversion"></a>
+## Sparse to Dense Conversion
- - -
-### `tf.sparse_to_dense(sparse_indices, output_shape, sparse_values, default_value, name=None)` <a class="md-anchor" id="sparse_to_dense"></a>
+### `tf.sparse_to_dense(sparse_indices, output_shape, sparse_values, default_value, name=None)` {#sparse_to_dense}
Converts a sparse representation into a dense tensor.
@@ -186,7 +169,7 @@ dense[sparse_indices[i][0], ..., sparse_indices[i][d-1]] = sparse_values[i]
All other values in `dense` are set to `default_value`. If `sparse_values` is a
scalar, all sparse indices are set to this single value.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`sparse_indices`</b>: A `Tensor`. Must be one of the following types: `int32`, `int64`.
@@ -202,7 +185,7 @@ scalar, all sparse indices are set to this single value.
`sparse_indices`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `sparse_values`.
Dense output tensor of shape `output_shape`.
@@ -210,7 +193,7 @@ scalar, all sparse indices are set to this single value.
- - -
-### `tf.sparse_tensor_to_dense(sp_input, default_value, name=None)` <a class="md-anchor" id="sparse_tensor_to_dense"></a>
+### `tf.sparse_tensor_to_dense(sp_input, default_value, name=None)` {#sparse_tensor_to_dense}
Converts a `SparseTensor` into a dense tensor.
@@ -229,7 +212,7 @@ string tensor with values:
[x x x x x]
[c x x x x]]
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`sp_input`</b>: The input `SparseTensor`.
@@ -237,13 +220,13 @@ string tensor with values:
`sp_input`.
* <b>`name`</b>: A name prefix for the returned tensors (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A dense tensor with shape `sp_input.shape` and values specified by
the non-empty values in `sp_input`. Indices not in `sp_input` are assigned
`default_value`.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`TypeError`</b>: If `sp_input` is not a `SparseTensor`.
@@ -251,7 +234,7 @@ string tensor with values:
- - -
-### `tf.sparse_to_indicator(sp_input, vocab_size, name=None)` <a class="md-anchor" id="sparse_to_indicator"></a>
+### `tf.sparse_to_indicator(sp_input, vocab_size, name=None)` {#sparse_to_indicator}
Converts a `SparseTensor` of ids into a dense bool indicator tensor.
@@ -282,7 +265,7 @@ compatibility with ops that expect dense tensors.
The input `SparseTensor` must be in row-major order.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`sp_input`</b>: A `SparseTensor` of type `int32` or `int64`.
@@ -290,22 +273,22 @@ The input `SparseTensor` must be in row-major order.
`all(0 <= sp_input.values < vocab_size)`.
* <b>`name`</b>: A name prefix for the returned tensors (optional)
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A dense bool indicator tensor representing the indices with specified value.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`TypeError`</b>: If `sp_input` is not a `SparseTensor`.
-## Manipulation <a class="md-anchor" id="AUTOGENERATED-manipulation"></a>
+## Manipulation
- - -
-### `tf.sparse_concat(concat_dim, sp_inputs, name=None)` <a class="md-anchor" id="sparse_concat"></a>
+### `tf.sparse_concat(concat_dim, sp_inputs, name=None)` {#sparse_concat}
Concatenates a list of `SparseTensor` along the specified dimension.
@@ -351,18 +334,18 @@ Graphically this is equivalent to doing
[ a] concat [ d e ] = [ a d e ]
[b c ] [ ] [b c ]
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`concat_dim`</b>: Dimension to concatenate along.
* <b>`sp_inputs`</b>: List of `SparseTensor` to concatenate.
* <b>`name`</b>: A name prefix for the returned tensors (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `SparseTensor` with the concatenated output.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`TypeError`</b>: If `sp_inputs` is not a list of `SparseTensor`.
@@ -370,7 +353,7 @@ Graphically this is equivalent to doing
- - -
-### `tf.sparse_reorder(sp_input, name=None)` <a class="md-anchor" id="sparse_reorder"></a>
+### `tf.sparse_reorder(sp_input, name=None)` {#sparse_reorder}
Reorders a `SparseTensor` into the canonical, row-major ordering.
@@ -395,18 +378,18 @@ then the output will be a `SparseTensor` of shape `[4, 5]` and
[2, 0]: c
[3, 1]: d
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`sp_input`</b>: The input `SparseTensor`.
* <b>`name`</b>: A name prefix for the returned tensors (optional)
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `SparseTensor` with the same shape and non-empty values, but in
canonical ordering.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`TypeError`</b>: If `sp_input` is not a `SparseTensor`.
@@ -414,7 +397,7 @@ then the output will be a `SparseTensor` of shape `[4, 5]` and
- - -
-### `tf.sparse_retain(sp_input, to_retain)` <a class="md-anchor" id="sparse_retain"></a>
+### `tf.sparse_retain(sp_input, to_retain)` {#sparse_retain}
Retains specified non-empty values within a `SparseTensor`.
@@ -431,18 +414,18 @@ be a `SparseTensor` of shape `[4, 5]` with 2 non-empty values:
[0, 1]: a
[3, 1]: d
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`sp_input`</b>: The input `SparseTensor` with `N` non-empty elements.
* <b>`to_retain`</b>: A bool vector of length `N` with `M` true values.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `SparseTensor` with the same shape as the input and `M` non-empty
elements corresponding to the true positions in `to_retain`.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`TypeError`</b>: If `sp_input` is not a `SparseTensor`.
@@ -450,7 +433,7 @@ be a `SparseTensor` of shape `[4, 5]` with 2 non-empty values:
- - -
-### `tf.sparse_fill_empty_rows(sp_input, default_value, name=None)` <a class="md-anchor" id="sparse_fill_empty_rows"></a>
+### `tf.sparse_fill_empty_rows(sp_input, default_value, name=None)` {#sparse_fill_empty_rows}
Fills empty rows in the input 2-D `SparseTensor` with a default value.
@@ -483,7 +466,7 @@ This op also returns an indicator vector such that
empty_row_indicator[i] = True iff row i was an empty row.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`sp_input`</b>: A `SparseTensor` with shape `[N, M]`.
@@ -491,7 +474,7 @@ This op also returns an indicator vector such that
`sp_input.`
* <b>`name`</b>: A name prefix for the returned tensors (optional)
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
* <b>`sp_ordered_output`</b>: A `SparseTensor` with shape `[N, M]`, and with all empty
@@ -499,7 +482,7 @@ This op also returns an indicator vector such that
* <b>`empty_row_indicator`</b>: A bool vector of length `N` indicating whether each
input row was empty.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`TypeError`</b>: If `sp_input` is not a `SparseTensor`.
diff --git a/tensorflow/g3doc/api_docs/python/state_ops.md b/tensorflow/g3doc/api_docs/python/state_ops.md
index 7d2ab83ae6..16ca336a7e 100644
--- a/tensorflow/g3doc/api_docs/python/state_ops.md
+++ b/tensorflow/g3doc/api_docs/python/state_ops.md
@@ -1,51 +1,17 @@
<!-- This file is machine generated: DO NOT EDIT! -->
-# Variables <a class="md-anchor" id="AUTOGENERATED-variables"></a>
+# Variables
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
-### [Variables](#AUTOGENERATED-variables)
-* [Variables](#AUTOGENERATED-variables)
- * [`class tf.Variable`](#Variable)
-* [Variable helper functions](#AUTOGENERATED-variable-helper-functions)
- * [`tf.all_variables()`](#all_variables)
- * [`tf.trainable_variables()`](#trainable_variables)
- * [`tf.initialize_all_variables()`](#initialize_all_variables)
- * [`tf.initialize_variables(var_list, name='init')`](#initialize_variables)
- * [`tf.assert_variables_initialized(var_list=None)`](#assert_variables_initialized)
-* [Saving and Restoring Variables](#AUTOGENERATED-saving-and-restoring-variables)
- * [`class tf.train.Saver`](#Saver)
- * [`tf.train.latest_checkpoint(checkpoint_dir, latest_filename=None)`](#latest_checkpoint)
- * [`tf.train.get_checkpoint_state(checkpoint_dir, latest_filename=None)`](#get_checkpoint_state)
- * [`tf.train.update_checkpoint_state(save_dir, model_checkpoint_path, all_model_checkpoint_paths=None, latest_filename=None)`](#update_checkpoint_state)
-* [Sharing Variables](#AUTOGENERATED-sharing-variables)
- * [`tf.get_variable(name, shape=None, dtype=tf.float32, initializer=None, trainable=True, collections=None)`](#get_variable)
- * [`tf.get_variable_scope()`](#get_variable_scope)
- * [`tf.variable_scope(name_or_scope, reuse=None, initializer=None)`](#variable_scope)
- * [`tf.constant_initializer(value=0.0)`](#constant_initializer)
- * [`tf.random_normal_initializer(mean=0.0, stddev=1.0, seed=None)`](#random_normal_initializer)
- * [`tf.truncated_normal_initializer(mean=0.0, stddev=1.0, seed=None)`](#truncated_normal_initializer)
- * [`tf.random_uniform_initializer(minval=0.0, maxval=1.0, seed=None)`](#random_uniform_initializer)
- * [`tf.uniform_unit_scaling_initializer(factor=1.0, seed=None)`](#uniform_unit_scaling_initializer)
- * [`tf.zeros_initializer(shape, dtype=tf.float32)`](#zeros_initializer)
-* [Sparse Variable Updates](#AUTOGENERATED-sparse-variable-updates)
- * [`tf.scatter_update(ref, indices, updates, use_locking=None, name=None)`](#scatter_update)
- * [`tf.scatter_add(ref, indices, updates, use_locking=None, name=None)`](#scatter_add)
- * [`tf.scatter_sub(ref, indices, updates, use_locking=None, name=None)`](#scatter_sub)
- * [`tf.sparse_mask(a, mask_indices, name=None)`](#sparse_mask)
- * [`class tf.IndexedSlices`](#IndexedSlices)
-
-
-<!-- TOC-END This section was generated by neural network, THANKS FOR READING! -->
-
-## Variables <a class="md-anchor" id="AUTOGENERATED-variables"></a>
+[TOC]
+
+## Variables
- - -
-### `class tf.Variable` <a class="md-anchor" id="Variable"></a>
+### `class tf.Variable` {#Variable}
See the [Variables How To](../../how_tos/variables/index.md) for a high
level overview.
@@ -138,7 +104,7 @@ Creating a variable.
- - -
-#### `tf.Variable.__init__(initial_value, trainable=True, collections=None, validate_shape=True, name=None)` <a class="md-anchor" id="Variable.__init__"></a>
+#### `tf.Variable.__init__(initial_value, trainable=True, collections=None, validate_shape=True, name=None)` {#Variable.__init__}
Creates a new variable with value `initial_value`.
@@ -151,7 +117,7 @@ If `trainable` is `True` the variable is also added to the graph collection
This constructor creates both a `variable` Op and an `assign` Op to set the
variable to its initial value.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`initial_value`</b>: A `Tensor`, or Python object convertible to a `Tensor`.
@@ -168,11 +134,11 @@ variable to its initial value.
* <b>`name`</b>: Optional name for the variable. Defaults to `'Variable'` and gets
uniquified automatically.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A Variable.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`ValueError`</b>: If the initial value does not have a shape and
@@ -181,7 +147,7 @@ variable to its initial value.
- - -
-#### `tf.Variable.initialized_value()` <a class="md-anchor" id="Variable.initialized_value"></a>
+#### `tf.Variable.initialized_value()` {#Variable.initialized_value}
Returns the value of the initialized variable.
@@ -197,7 +163,7 @@ v = tf.Variable(tf.truncated_normal([10, 40]))
w = tf.Variable(v.initialized_value() * 2.0)
```
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` holding the value of this variable after its initializer
has run.
@@ -208,19 +174,19 @@ Changing a variable value.
- - -
-#### `tf.Variable.assign(value, use_locking=False)` <a class="md-anchor" id="Variable.assign"></a>
+#### `tf.Variable.assign(value, use_locking=False)` {#Variable.assign}
Assigns a new value to the variable.
This is essentially a shortcut for `assign(self, value)`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`value`</b>: A `Tensor`. The new value for this variable.
* <b>`use_locking`</b>: If `True`, use locking during the assignment.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` that will hold the new value of this variable after
the assignment has completed.
@@ -228,19 +194,19 @@ This is essentially a shortcut for `assign(self, value)`.
- - -
-#### `tf.Variable.assign_add(delta, use_locking=False)` <a class="md-anchor" id="Variable.assign_add"></a>
+#### `tf.Variable.assign_add(delta, use_locking=False)` {#Variable.assign_add}
Adds a value to this variable.
This is essentially a shortcut for `assign_add(self, delta)`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`delta`</b>: A `Tensor`. The value to add to this variable.
* <b>`use_locking`</b>: If `True`, use locking during the operation.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` that will hold the new value of this variable after
the addition has completed.
@@ -248,19 +214,19 @@ Adds a value to this variable.
- - -
-#### `tf.Variable.assign_sub(delta, use_locking=False)` <a class="md-anchor" id="Variable.assign_sub"></a>
+#### `tf.Variable.assign_sub(delta, use_locking=False)` {#Variable.assign_sub}
Subtracts a value from this variable.
This is essentially a shortcut for `assign_sub(self, delta)`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`delta`</b>: A `Tensor`. The value to subtract from this variable.
* <b>`use_locking`</b>: If `True`, use locking during the operation.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` that will hold the new value of this variable after
the subtraction has completed.
@@ -268,25 +234,25 @@ This is essentially a shortcut for `assign_sub(self, delta)`.
- - -
-#### `tf.Variable.scatter_sub(sparse_delta, use_locking=False)` <a class="md-anchor" id="Variable.scatter_sub"></a>
+#### `tf.Variable.scatter_sub(sparse_delta, use_locking=False)` {#Variable.scatter_sub}
Subtracts `IndexedSlices` from this variable.
This is essentially a shortcut for `scatter_sub(self, sparse_delta.indices,
sparse_delta.values)`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`sparse_delta`</b>: `IndexedSlices` to be subtracted from this variable.
* <b>`use_locking`</b>: If `True`, use locking during the operation.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` that will hold the new value of this variable after
the scattered subtraction has completed.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`ValueError`</b>: if `sparse_delta` is not an `IndexedSlices`.
@@ -294,7 +260,7 @@ sparse_delta.values)`.
- - -
-#### `tf.Variable.count_up_to(limit)` <a class="md-anchor" id="Variable.count_up_to"></a>
+#### `tf.Variable.count_up_to(limit)` {#Variable.count_up_to}
Increments this variable until it reaches `limit`.
@@ -307,12 +273,12 @@ the increment.
This is essentially a shortcut for `count_up_to(self, limit)`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`limit`</b>: value at which incrementing the variable raises an error.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor` that will hold the variable value before the increment. If no
other Op modifies this variable, the values produced will all be
@@ -322,7 +288,7 @@ This is essentially a shortcut for `count_up_to(self, limit)`.
- - -
-#### `tf.Variable.eval(session=None)` <a class="md-anchor" id="Variable.eval"></a>
+#### `tf.Variable.eval(session=None)` {#Variable.eval}
In a session, computes and returns the value of this variable.
@@ -346,13 +312,13 @@ with tf.Session() as sess:
print v.eval()
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`session`</b>: The session to use to evaluate this variable. If
none, the default session is used.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A numpy `ndarray` with a copy of the value of this variable.
@@ -362,61 +328,61 @@ Properties.
- - -
-#### `tf.Variable.name` <a class="md-anchor" id="Variable.name"></a>
+#### `tf.Variable.name` {#Variable.name}
The name of this variable.
- - -
-#### `tf.Variable.dtype` <a class="md-anchor" id="Variable.dtype"></a>
+#### `tf.Variable.dtype` {#Variable.dtype}
The `DType` of this variable.
- - -
-#### `tf.Variable.get_shape()` <a class="md-anchor" id="Variable.get_shape"></a>
+#### `tf.Variable.get_shape()` {#Variable.get_shape}
The `TensorShape` of this variable.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `TensorShape`.
- - -
-#### `tf.Variable.device` <a class="md-anchor" id="Variable.device"></a>
+#### `tf.Variable.device` {#Variable.device}
The device of this variable.
- - -
-#### `tf.Variable.initializer` <a class="md-anchor" id="Variable.initializer"></a>
+#### `tf.Variable.initializer` {#Variable.initializer}
The initializer operation for this variable.
- - -
-#### `tf.Variable.graph` <a class="md-anchor" id="Variable.graph"></a>
+#### `tf.Variable.graph` {#Variable.graph}
The `Graph` of this variable.
- - -
-#### `tf.Variable.op` <a class="md-anchor" id="Variable.op"></a>
+#### `tf.Variable.op` {#Variable.op}
The `Operation` of this variable.
-## Variable helper functions <a class="md-anchor" id="AUTOGENERATED-variable-helper-functions"></a>
+## Variable helper functions
TensorFlow provides a set of functions to help manage the set of variables
collected in the graph.
- - -
-### `tf.all_variables()` <a class="md-anchor" id="all_variables"></a>
+### `tf.all_variables()` {#all_variables}
Returns all variables collected in the graph.
@@ -424,14 +390,14 @@ The `Variable()` constructor automatically adds new variables to the graph
collection `GraphKeys.VARIABLES`. This convenience function returns the
contents of that collection.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A list of `Variable` objects.
- - -
-### `tf.trainable_variables()` <a class="md-anchor" id="trainable_variables"></a>
+### `tf.trainable_variables()` {#trainable_variables}
Returns all variables created with `trainable=True`.
@@ -440,7 +406,7 @@ adds new variables to the graph collection
`GraphKeys.TRAINABLE_VARIABLES`. This convenience function returns the
contents of that collection.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A list of Variable objects.
@@ -448,20 +414,20 @@ contents of that collection.
- - -
-### `tf.initialize_all_variables()` <a class="md-anchor" id="initialize_all_variables"></a>
+### `tf.initialize_all_variables()` {#initialize_all_variables}
Returns an Op that initializes all variables.
This is just a shortcut for `initialize_variables(all_variables())`
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
An Op that initializes all variables in the graph.
- - -
-### `tf.initialize_variables(var_list, name='init')` <a class="md-anchor" id="initialize_variables"></a>
+### `tf.initialize_variables(var_list, name='init')` {#initialize_variables}
Returns an Op that initializes a list of variables.
@@ -475,20 +441,20 @@ initializers to `Group()`.
If `var_list` is empty, however, the function still returns an Op that can
be run. That Op just has no effect.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`var_list`</b>: List of `Variable` objects to initialize.
* <b>`name`</b>: Optional name for the returned operation.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
An Op that run the initializers of all the specified variables.
- - -
-### `tf.assert_variables_initialized(var_list=None)` <a class="md-anchor" id="assert_variables_initialized"></a>
+### `tf.assert_variables_initialized(var_list=None)` {#assert_variables_initialized}
Returns an Op to check if variables are initialized.
@@ -499,23 +465,23 @@ Note: This function is implemented by trying to fetch the values of the
variables. If one of the variables is not initialized a message may be
logged by the C++ runtime. This is expected.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`var_list`</b>: List of `Variable` objects to check. Defaults to the
value of `all_variables().`
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
An Op, or None if there are no variables.
-## Saving and Restoring Variables <a class="md-anchor" id="AUTOGENERATED-saving-and-restoring-variables"></a>
+## Saving and Restoring Variables
- - -
-### `class tf.train.Saver` <a class="md-anchor" id="Saver"></a>
+### `class tf.train.Saver` {#Saver}
Saves and restores variables.
@@ -591,7 +557,7 @@ protocol buffer file in the call to `save()`.
- - -
-#### `tf.train.Saver.__init__(var_list=None, reshape=False, sharded=False, max_to_keep=5, keep_checkpoint_every_n_hours=10000.0, name=None, restore_sequentially=False, saver_def=None, builder=None)` <a class="md-anchor" id="Saver.__init__"></a>
+#### `tf.train.Saver.__init__(var_list=None, reshape=False, sharded=False, max_to_keep=5, keep_checkpoint_every_n_hours=10000.0, name=None, restore_sequentially=False, saver_def=None, builder=None)` {#Saver.__init__}
Creates a `Saver`.
@@ -629,7 +595,7 @@ want to reload it from an older checkpoint.
The optional `sharded` argument, if True, instructs the saver to shard
checkpoints per device.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`var_list`</b>: A list of Variables or a dictionary mapping names to
@@ -653,7 +619,7 @@ checkpoints per device.
* <b>`builder`</b>: Optional SaverBuilder to use if a saver_def was not provided.
Defaults to BaseSaverBuilder().
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`TypeError`</b>: If `var_list` is invalid.
@@ -662,7 +628,7 @@ checkpoints per device.
- - -
-#### `tf.train.Saver.save(sess, save_path, global_step=None, latest_filename=None)` <a class="md-anchor" id="Saver.save"></a>
+#### `tf.train.Saver.save(sess, save_path, global_step=None, latest_filename=None)` {#Saver.save}
Saves variables.
@@ -673,7 +639,7 @@ save must also have been initialized.
The method returns the path of the newly created checkpoint file. This
path can be passed directly to a call to `restore()`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`sess`</b>: A Session to use to save the variables.
@@ -688,13 +654,13 @@ path can be passed directly to a call to `restore()`.
managed by the saver to keep track of recent checkpoints. Defaults to
'checkpoint'.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A string: path at which the variables were saved. If the saver is
sharded, this string ends with: '-?????-of-nnnnn' where 'nnnnn'
is the number of shards created.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`TypeError`</b>: If `sess` is not a Session.
@@ -702,7 +668,7 @@ path can be passed directly to a call to `restore()`.
- - -
-#### `tf.train.Saver.restore(sess, save_path)` <a class="md-anchor" id="Saver.restore"></a>
+#### `tf.train.Saver.restore(sess, save_path)` {#Saver.restore}
Restores previously saved variables.
@@ -714,7 +680,7 @@ to initialize variables.
The `save_path` argument is typically a value previously returned from a
`save()` call, or a call to `latest_checkpoint()`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`sess`</b>: A Session to use to restore the parameters.
@@ -726,28 +692,28 @@ Other utility methods.
- - -
-#### `tf.train.Saver.last_checkpoints` <a class="md-anchor" id="Saver.last_checkpoints"></a>
+#### `tf.train.Saver.last_checkpoints` {#Saver.last_checkpoints}
List of not-yet-deleted checkpoint filenames.
You can pass any of the returned values to `restore()`.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A list of checkpoint filenames, sorted from oldest to newest.
- - -
-#### `tf.train.Saver.set_last_checkpoints(last_checkpoints)` <a class="md-anchor" id="Saver.set_last_checkpoints"></a>
+#### `tf.train.Saver.set_last_checkpoints(last_checkpoints)` {#Saver.set_last_checkpoints}
Sets the list of not-yet-deleted checkpoint filenames.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`last_checkpoints`</b>: a list of checkpoint filenames.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`AssertionError`</b>: if the list of checkpoint filenames has already been set.
@@ -755,11 +721,11 @@ Sets the list of not-yet-deleted checkpoint filenames.
- - -
-#### `tf.train.Saver.as_saver_def()` <a class="md-anchor" id="Saver.as_saver_def"></a>
+#### `tf.train.Saver.as_saver_def()` {#Saver.as_saver_def}
Generates a `SaverDef` representation of this saver.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `SaverDef` proto.
@@ -768,11 +734,11 @@ Generates a `SaverDef` representation of this saver.
- - -
-### `tf.train.latest_checkpoint(checkpoint_dir, latest_filename=None)` <a class="md-anchor" id="latest_checkpoint"></a>
+### `tf.train.latest_checkpoint(checkpoint_dir, latest_filename=None)` {#latest_checkpoint}
Finds the filename of latest saved checkpoint file.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`checkpoint_dir`</b>: Directory where the variables were saved.
@@ -780,7 +746,7 @@ Finds the filename of latest saved checkpoint file.
contains the list of most recent checkpoint filenames.
See the corresponding argument to `Saver.save()`.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
The full path to the latest checkpoint or None if no checkpoint was found.
@@ -788,21 +754,21 @@ Finds the filename of latest saved checkpoint file.
- - -
-### `tf.train.get_checkpoint_state(checkpoint_dir, latest_filename=None)` <a class="md-anchor" id="get_checkpoint_state"></a>
+### `tf.train.get_checkpoint_state(checkpoint_dir, latest_filename=None)` {#get_checkpoint_state}
Returns CheckpointState proto from the "checkpoint" file.
If the "checkpoint" file contains a valid CheckpointState
proto, returns it.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`checkpoint_dir`</b>: The directory of checkpoints.
* <b>`latest_filename`</b>: Optional name of the checkpoint file. Default to
'checkpoint'.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A CheckpointState if the state was available, None
otherwise.
@@ -810,14 +776,14 @@ proto, returns it.
- - -
-### `tf.train.update_checkpoint_state(save_dir, model_checkpoint_path, all_model_checkpoint_paths=None, latest_filename=None)` <a class="md-anchor" id="update_checkpoint_state"></a>
+### `tf.train.update_checkpoint_state(save_dir, model_checkpoint_path, all_model_checkpoint_paths=None, latest_filename=None)` {#update_checkpoint_state}
Updates the content of the 'checkpoint' file.
This updates the checkpoint file containing a CheckpointState
proto.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`save_dir`</b>: Directory where the model was saved.
@@ -829,21 +795,21 @@ proto.
* <b>`latest_filename`</b>: Optional name of the checkpoint file. Default to
'checkpoint'.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`RuntimeError`</b>: If the save paths conflict.
-## Sharing Variables <a class="md-anchor" id="AUTOGENERATED-sharing-variables"></a>
+## Sharing Variables
TensorFlow provides several classes and operations that you can use to
create variables contingent on certain conditions.
- - -
-### `tf.get_variable(name, shape=None, dtype=tf.float32, initializer=None, trainable=True, collections=None)` <a class="md-anchor" id="get_variable"></a>
+### `tf.get_variable(name, shape=None, dtype=tf.float32, initializer=None, trainable=True, collections=None)` {#get_variable}
Gets an existing variable with these parameters or create a new one.
@@ -864,7 +830,7 @@ If initializer is `None` (the default), the default initializer passed in
the constructor is used. If that one is `None` too, a
`UniformUnitScalingInitializer` will be used.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`name`</b>: the name of the new or existing variable.
@@ -876,11 +842,11 @@ the constructor is used. If that one is `None` too, a
* <b>`collections`</b>: List of graph collections keys to add the Variable to.
Defaults to `[GraphKeys.VARIABLES]` (see variables.Variable).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
The created or existing variable.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`ValueError`</b>: when creating a new variable and shape is not declared,
@@ -890,14 +856,14 @@ the constructor is used. If that one is `None` too, a
- - -
-### `tf.get_variable_scope()` <a class="md-anchor" id="get_variable_scope"></a>
+### `tf.get_variable_scope()` {#get_variable_scope}
Returns the current variable scope.
- - -
-### `tf.variable_scope(name_or_scope, reuse=None, initializer=None)` <a class="md-anchor" id="variable_scope"></a>
+### `tf.variable_scope(name_or_scope, reuse=None, initializer=None)` {#variable_scope}
Returns a context for variable scope.
@@ -957,7 +923,7 @@ with tf.variable_scope("foo", reuse=True):
Note that the `reuse` flag is inherited: if we open a reusing scope,
then all its sub-scopes become reusing as well.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`name_or_scope`</b>: `string` or `VariableScope`: the scope to open.
@@ -965,11 +931,11 @@ then all its sub-scopes become reusing as well.
well as all sub-scopes; if `None`, we just inherit the parent scope reuse.
* <b>`initializer`</b>: default initializer for variables within this scope.
-##### Yields: <a class="md-anchor" id="AUTOGENERATED-yields-"></a>
+##### Yields:
A scope that can be to captured and reused.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`ValueError`</b>: when trying to reuse within a create scope, or create within
@@ -980,28 +946,28 @@ then all its sub-scopes become reusing as well.
- - -
-### `tf.constant_initializer(value=0.0)` <a class="md-anchor" id="constant_initializer"></a>
+### `tf.constant_initializer(value=0.0)` {#constant_initializer}
Returns an initializer that generates Tensors with a single value.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`value`</b>: A Python scalar. All elements of the initialized variable
will be set to this value.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
An initializer that generates Tensors with a single value.
- - -
-### `tf.random_normal_initializer(mean=0.0, stddev=1.0, seed=None)` <a class="md-anchor" id="random_normal_initializer"></a>
+### `tf.random_normal_initializer(mean=0.0, stddev=1.0, seed=None)` {#random_normal_initializer}
Returns an initializer that generates Tensors with a normal distribution.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`mean`</b>: a python scalar or a scalar tensor. Mean of the random values
@@ -1012,14 +978,14 @@ Returns an initializer that generates Tensors with a normal distribution.
[`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
An initializer that generates Tensors with a normal distribution.
- - -
-### `tf.truncated_normal_initializer(mean=0.0, stddev=1.0, seed=None)` <a class="md-anchor" id="truncated_normal_initializer"></a>
+### `tf.truncated_normal_initializer(mean=0.0, stddev=1.0, seed=None)` {#truncated_normal_initializer}
Returns an initializer that generates a truncated normal distribution.
@@ -1028,7 +994,7 @@ except that values more than two standard deviations from the mean
are discarded and re-drawn. This is the recommended initializer for
neural network weights and filters.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`mean`</b>: a python scalar or a scalar tensor. Mean of the random values
@@ -1039,7 +1005,7 @@ neural network weights and filters.
[`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
An initializer that generates Tensors with a truncated normal
distribution.
@@ -1047,11 +1013,11 @@ neural network weights and filters.
- - -
-### `tf.random_uniform_initializer(minval=0.0, maxval=1.0, seed=None)` <a class="md-anchor" id="random_uniform_initializer"></a>
+### `tf.random_uniform_initializer(minval=0.0, maxval=1.0, seed=None)` {#random_uniform_initializer}
Returns an initializer that generates Tensors with a uniform distribution.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`minval`</b>: a python scalar or a scalar tensor. lower bound of the range
@@ -1062,14 +1028,14 @@ Returns an initializer that generates Tensors with a uniform distribution.
[`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
An initializer that generates Tensors with a uniform distribution.
- - -
-### `tf.uniform_unit_scaling_initializer(factor=1.0, seed=None)` <a class="md-anchor" id="uniform_unit_scaling_initializer"></a>
+### `tf.uniform_unit_scaling_initializer(factor=1.0, seed=None)` {#uniform_unit_scaling_initializer}
Returns an initializer that generates tensors without scaling variance.
@@ -1088,7 +1054,7 @@ See <https://arxiv.org/pdf/1412.6558v3.pdf> for deeper motivation, experiments
and the calculation of constants. In section 2.3 there, the constants were
numerically computed: for a linear layer it's 1.0, relu: ~1.43, tanh: ~1.15.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`factor`</b>: Float. A multiplicative factor by which the values will be scaled.
@@ -1096,20 +1062,20 @@ numerically computed: for a linear layer it's 1.0, relu: ~1.43, tanh: ~1.15.
[`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
for behavior.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
An initializer that generates tensors with unit variance.
- - -
-### `tf.zeros_initializer(shape, dtype=tf.float32)` <a class="md-anchor" id="zeros_initializer"></a>
+### `tf.zeros_initializer(shape, dtype=tf.float32)` {#zeros_initializer}
An adaptor for zeros() to match the Initializer spec.
-## Sparse Variable Updates <a class="md-anchor" id="AUTOGENERATED-sparse-variable-updates"></a>
+## Sparse Variable Updates
The sparse update ops modify a subset of the entries in a dense `Variable`,
either overwriting the entries or adding / subtracting a delta. These are
@@ -1125,7 +1091,7 @@ automatically by the optimizers in most cases.
- - -
-### `tf.scatter_update(ref, indices, updates, use_locking=None, name=None)` <a class="md-anchor" id="scatter_update"></a>
+### `tf.scatter_update(ref, indices, updates, use_locking=None, name=None)` {#scatter_update}
Applies sparse updates to a variable reference.
@@ -1152,7 +1118,7 @@ Requires `updates.shape = indices.shape + ref.shape[1:]`.
<img style="width:100%" src="../images/ScatterUpdate.png" alt>
</div>
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`ref`</b>: A mutable `Tensor`. Should be from a `Variable` node.
@@ -1165,7 +1131,7 @@ Requires `updates.shape = indices.shape + ref.shape[1:]`.
otherwise the behavior is undefined, but may exhibit less contention.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
Same as `ref`. Returned as a convenience for operations that want
to use the updated values after the update is done.
@@ -1173,7 +1139,7 @@ Requires `updates.shape = indices.shape + ref.shape[1:]`.
- - -
-### `tf.scatter_add(ref, indices, updates, use_locking=None, name=None)` <a class="md-anchor" id="scatter_add"></a>
+### `tf.scatter_add(ref, indices, updates, use_locking=None, name=None)` {#scatter_add}
Adds sparse updates to a variable reference.
@@ -1200,7 +1166,7 @@ Requires `updates.shape = indices.shape + ref.shape[1:]`.
<img style="width:100%" src="../images/ScatterAdd.png" alt>
</div>
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`ref`</b>: A mutable `Tensor`. Must be one of the following types: `float32`, `float64`, `int64`, `int32`, `uint8`, `int16`, `int8`, `complex64`, `qint8`, `quint8`, `qint32`.
@@ -1214,7 +1180,7 @@ Requires `updates.shape = indices.shape + ref.shape[1:]`.
otherwise the behavior is undefined, but may exhibit less contention.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
Same as `ref`. Returned as a convenience for operations that want
to use the updated values after the update is done.
@@ -1222,7 +1188,7 @@ Requires `updates.shape = indices.shape + ref.shape[1:]`.
- - -
-### `tf.scatter_sub(ref, indices, updates, use_locking=None, name=None)` <a class="md-anchor" id="scatter_sub"></a>
+### `tf.scatter_sub(ref, indices, updates, use_locking=None, name=None)` {#scatter_sub}
Subtracts sparse updates to a variable reference.
@@ -1247,7 +1213,7 @@ Requires `updates.shape = indices.shape + ref.shape[1:]`.
<img style="width:100%" src="../images/ScatterSub.png" alt>
</div>
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`ref`</b>: A mutable `Tensor`. Must be one of the following types: `float32`, `float64`, `int64`, `int32`, `uint8`, `int16`, `int8`, `complex64`, `qint8`, `quint8`, `qint32`.
@@ -1261,7 +1227,7 @@ Requires `updates.shape = indices.shape + ref.shape[1:]`.
otherwise the behavior is undefined, but may exhibit less contention.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
Same as `ref`. Returned as a convenience for operations that want
to use the updated values after the update is done.
@@ -1269,7 +1235,7 @@ Requires `updates.shape = indices.shape + ref.shape[1:]`.
- - -
-### `tf.sparse_mask(a, mask_indices, name=None)` <a class="md-anchor" id="sparse_mask"></a>
+### `tf.sparse_mask(a, mask_indices, name=None)` {#sparse_mask}
Masks elements of `IndexedSlices`.
@@ -1298,20 +1264,20 @@ tf.shape(b.values) => [2, 10]
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* `a`: An `IndexedSlices` instance.
* `mask_indices`: Indices of elements to mask.
* `name`: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
The masked `IndexedSlices` instance.
- - -
-### `class tf.IndexedSlices` <a class="md-anchor" id="IndexedSlices"></a>
+### `class tf.IndexedSlices` {#IndexedSlices}
A sparse representation of a set of tensor slices at given indices.
@@ -1341,7 +1307,7 @@ which uses multi-dimensional indices and scalar values.
- - -
-#### `tf.IndexedSlices.__init__(values, indices, dense_shape=None)` <a class="md-anchor" id="IndexedSlices.__init__"></a>
+#### `tf.IndexedSlices.__init__(values, indices, dense_shape=None)` {#IndexedSlices.__init__}
Creates an `IndexedSlices`.
@@ -1349,44 +1315,44 @@ Creates an `IndexedSlices`.
- - -
-#### `tf.IndexedSlices.values` <a class="md-anchor" id="IndexedSlices.values"></a>
+#### `tf.IndexedSlices.values` {#IndexedSlices.values}
A `Tensor` containing the values of the slices.
- - -
-#### `tf.IndexedSlices.indices` <a class="md-anchor" id="IndexedSlices.indices"></a>
+#### `tf.IndexedSlices.indices` {#IndexedSlices.indices}
A 1-D `Tensor` containing the indices of the slices.
- - -
-#### `tf.IndexedSlices.dense_shape` <a class="md-anchor" id="IndexedSlices.dense_shape"></a>
+#### `tf.IndexedSlices.dense_shape` {#IndexedSlices.dense_shape}
A 1-D `Tensor` containing the shape of the corresponding dense tensor.
- - -
-#### `tf.IndexedSlices.name` <a class="md-anchor" id="IndexedSlices.name"></a>
+#### `tf.IndexedSlices.name` {#IndexedSlices.name}
The name of this `IndexedSlices`.
- - -
-#### `tf.IndexedSlices.dtype` <a class="md-anchor" id="IndexedSlices.dtype"></a>
+#### `tf.IndexedSlices.dtype` {#IndexedSlices.dtype}
The `DType` of elements in this tensor.
- - -
-#### `tf.IndexedSlices.device` <a class="md-anchor" id="IndexedSlices.device"></a>
+#### `tf.IndexedSlices.device` {#IndexedSlices.device}
The name of the device on which `values` will be produced, or `None`.
- - -
-#### `tf.IndexedSlices.op` <a class="md-anchor" id="IndexedSlices.op"></a>
+#### `tf.IndexedSlices.op` {#IndexedSlices.op}
The `Operation` that produces `values` as an output.
diff --git a/tensorflow/g3doc/api_docs/python/train.md b/tensorflow/g3doc/api_docs/python/train.md
index a1ea3c2a2f..2213d5f027 100644
--- a/tensorflow/g3doc/api_docs/python/train.md
+++ b/tensorflow/g3doc/api_docs/python/train.md
@@ -1,60 +1,11 @@
<!-- This file is machine generated: DO NOT EDIT! -->
-# Training <a class="md-anchor" id="AUTOGENERATED-training"></a>
-<!-- TOC-BEGIN This section is generated by neural network: DO NOT EDIT! -->
-## Contents
-### [Training](#AUTOGENERATED-training)
-* [Optimizers](#AUTOGENERATED-optimizers)
- * [`class tf.train.Optimizer`](#Optimizer)
- * [Usage](#AUTOGENERATED-usage)
- * [Processing gradients before applying them.](#AUTOGENERATED-processing-gradients-before-applying-them.)
- * [Gating Gradients](#AUTOGENERATED-gating-gradients)
- * [Slots](#AUTOGENERATED-slots)
- * [`class tf.train.GradientDescentOptimizer`](#GradientDescentOptimizer)
- * [`class tf.train.AdagradOptimizer`](#AdagradOptimizer)
- * [`class tf.train.MomentumOptimizer`](#MomentumOptimizer)
- * [`class tf.train.AdamOptimizer`](#AdamOptimizer)
- * [`class tf.train.FtrlOptimizer`](#FtrlOptimizer)
- * [`class tf.train.RMSPropOptimizer`](#RMSPropOptimizer)
-* [Gradient Computation](#AUTOGENERATED-gradient-computation)
- * [`tf.gradients(ys, xs, grad_ys=None, name='gradients', colocate_gradients_with_ops=False, gate_gradients=False, aggregation_method=None)`](#gradients)
- * [`class tf.AggregationMethod`](#AggregationMethod)
- * [`tf.stop_gradient(input, name=None)`](#stop_gradient)
-* [Gradient Clipping](#AUTOGENERATED-gradient-clipping)
- * [`tf.clip_by_value(t, clip_value_min, clip_value_max, name=None)`](#clip_by_value)
- * [`tf.clip_by_norm(t, clip_norm, name=None)`](#clip_by_norm)
- * [`tf.clip_by_average_norm(t, clip_norm, name=None)`](#clip_by_average_norm)
- * [`tf.clip_by_global_norm(t_list, clip_norm, use_norm=None, name=None)`](#clip_by_global_norm)
- * [`tf.global_norm(t_list, name=None)`](#global_norm)
-* [Decaying the learning rate](#AUTOGENERATED-decaying-the-learning-rate)
- * [`tf.train.exponential_decay(learning_rate, global_step, decay_steps, decay_rate, staircase=False, name=None)`](#exponential_decay)
-* [Moving Averages](#AUTOGENERATED-moving-averages)
- * [`class tf.train.ExponentialMovingAverage`](#ExponentialMovingAverage)
-* [Coordinator and QueueRunner](#AUTOGENERATED-coordinator-and-queuerunner)
- * [`class tf.train.Coordinator`](#Coordinator)
- * [`class tf.train.QueueRunner`](#QueueRunner)
- * [`tf.train.add_queue_runner(qr, collection='queue_runners')`](#add_queue_runner)
- * [`tf.train.start_queue_runners(sess=None, coord=None, daemon=True, start=True, collection='queue_runners')`](#start_queue_runners)
-* [Summary Operations](#AUTOGENERATED-summary-operations)
- * [`tf.scalar_summary(tags, values, collections=None, name=None)`](#scalar_summary)
- * [`tf.image_summary(tag, tensor, max_images=None, collections=None, name=None)`](#image_summary)
- * [`tf.histogram_summary(tag, values, collections=None, name=None)`](#histogram_summary)
- * [`tf.nn.zero_fraction(value, name=None)`](#zero_fraction)
- * [`tf.merge_summary(inputs, collections=None, name=None)`](#merge_summary)
- * [`tf.merge_all_summaries(key='summaries')`](#merge_all_summaries)
-* [Adding Summaries to Event Files](#AUTOGENERATED-adding-summaries-to-event-files)
- * [`class tf.train.SummaryWriter`](#SummaryWriter)
- * [`tf.train.summary_iterator(path)`](#summary_iterator)
-* [Training utilities](#AUTOGENERATED-training-utilities)
- * [`tf.train.global_step(sess, global_step_tensor)`](#global_step)
- * [`tf.train.write_graph(graph_def, logdir, name, as_text=True)`](#write_graph)
-
-
-<!-- TOC-END This section was generated by neural network, THANKS FOR READING! -->
+# Training
+[TOC]
This library provides a set of classes and functions that helps train models.
-## Optimizers <a class="md-anchor" id="AUTOGENERATED-optimizers"></a>
+## Optimizers
The Optimizer base class provides methods to compute gradients for a loss and
apply gradients to variables. A collection of subclasses implement classic
@@ -65,7 +16,7 @@ of the subclasses.
- - -
-### `class tf.train.Optimizer` <a class="md-anchor" id="Optimizer"></a>
+### `class tf.train.Optimizer` {#Optimizer}
Base class for optimizers.
@@ -73,7 +24,7 @@ This class defines the API to add Ops to train a model. You never use this
class directly, but instead instantiate one of its subclasses such as
`GradientDescentOptimizer`, `AdagradOptimizer`, or `MomentumOptimizer`.
-### Usage <a class="md-anchor" id="AUTOGENERATED-usage"></a>
+### Usage
```
# Create an optimizer with the desired parameters.
@@ -91,7 +42,7 @@ In the training program you will just have to run the returned Op.
opt_op.run()
```
-### Processing gradients before applying them. <a class="md-anchor" id="AUTOGENERATED-processing-gradients-before-applying-them."></a>
+### Processing gradients before applying them.
Calling `minimize()` takes care of both computing the gradients and
applying them to the variables. If you want to process the gradients
@@ -120,13 +71,13 @@ opt.apply_gradients(capped_grads_and_vars)
- - -
-#### `tf.train.Optimizer.__init__(use_locking, name)` <a class="md-anchor" id="Optimizer.__init__"></a>
+#### `tf.train.Optimizer.__init__(use_locking, name)` {#Optimizer.__init__}
Create a new Optimizer.
This must be called by the constructors of subclasses.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`use_locking`</b>: Bool. If True apply use locks to prevent concurrent updates
@@ -134,7 +85,7 @@ This must be called by the constructors of subclasses.
* <b>`name`</b>: A non-empty string. The name to use for accumulators created
for the optimizer.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`ValueError`</b>: if name is malformed.
@@ -143,7 +94,7 @@ This must be called by the constructors of subclasses.
- - -
-#### `tf.train.Optimizer.minimize(loss, global_step=None, var_list=None, gate_gradients=1, aggregation_method=None, name=None)` <a class="md-anchor" id="Optimizer.minimize"></a>
+#### `tf.train.Optimizer.minimize(loss, global_step=None, var_list=None, gate_gradients=1, aggregation_method=None, name=None)` {#Optimizer.minimize}
Add operations to minimize 'loss' by updating 'var_list'.
@@ -152,7 +103,7 @@ apply_gradients(). If you want to process the gradient before applying them
call compute_gradients() and apply_gradients() explicitly instead of using
this function.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`loss`</b>: A Tensor containing the value to minimize.
@@ -167,12 +118,12 @@ this function.
Valid values are defined in the class `AggregationMethod`.
* <b>`name`</b>: Optional name for the returned operation.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
An Operation that updates the variables in 'var_list'. If 'global_step'
was not None, that operation also increments global_step.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`ValueError`</b>: if some of the variables are not variables.Variable objects.
@@ -180,7 +131,7 @@ this function.
- - -
-#### `tf.train.Optimizer.compute_gradients(loss, var_list=None, gate_gradients=1, aggregation_method=None)` <a class="md-anchor" id="Optimizer.compute_gradients"></a>
+#### `tf.train.Optimizer.compute_gradients(loss, var_list=None, gate_gradients=1, aggregation_method=None)` {#Optimizer.compute_gradients}
Compute gradients of "loss" for the variables in "var_list".
@@ -190,7 +141,7 @@ for "variable". Note that "gradient" can be a Tensor, a
IndexedSlices, or None if there is no gradient for the
given variable.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`loss`</b>: A Tensor containing the value to minimize.
@@ -202,11 +153,11 @@ given variable.
* <b>`aggregation_method`</b>: Specifies the method used to combine gradient terms.
Valid values are defined in the class `AggregationMethod`.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A list of (gradient, variable) pairs.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`TypeError`</b>: If var_list contains anything else than variables.Variable.
@@ -215,14 +166,14 @@ given variable.
- - -
-#### `tf.train.Optimizer.apply_gradients(grads_and_vars, global_step=None, name=None)` <a class="md-anchor" id="Optimizer.apply_gradients"></a>
+#### `tf.train.Optimizer.apply_gradients(grads_and_vars, global_step=None, name=None)` {#Optimizer.apply_gradients}
Apply gradients to variables.
This is the second part of minimize(). It returns an Operation that
applies gradients.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`grads_and_vars`</b>: List of (gradient, variable) pairs as returned by
@@ -232,19 +183,19 @@ applies gradients.
* <b>`name`</b>: Optional name for the returned operation. Default to the
name passed to the Optimizer constructor.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
An Operation that applies the specified gradients. If 'global_step'
was not None, that operation also increments global_step.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`TypeError`</b>: if grads_and_vars is malformed.
-### Gating Gradients <a class="md-anchor" id="AUTOGENERATED-gating-gradients"></a>
+### Gating Gradients
Both `minimize()` and `compute_gradients()` accept a `gate_gradient` argument
that controls the degree of parallelism during the application of the
@@ -267,7 +218,7 @@ multiple inputs where the gradients depend on the inputs.
before any one of them is used. This provides the least parallelism but can
be useful if you want to process all gradients before applying any of them.
-### Slots <a class="md-anchor" id="AUTOGENERATED-slots"></a>
+### Slots
Some optimizer subclasses, such as `MomentumOptimizer` and `AdagradOptimizer`
allocate and manage additional variables associated with the variables to
@@ -280,20 +231,20 @@ about the slots, etc.
- - -
-#### `tf.train.Optimizer.get_slot_names()` <a class="md-anchor" id="Optimizer.get_slot_names"></a>
+#### `tf.train.Optimizer.get_slot_names()` {#Optimizer.get_slot_names}
Return a list of the names of slots created by the Optimizer.
See get_slot().
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A list of strings.
- - -
-#### `tf.train.Optimizer.get_slot(var, name)` <a class="md-anchor" id="Optimizer.get_slot"></a>
+#### `tf.train.Optimizer.get_slot(var, name)` {#Optimizer.get_slot}
Return a slot named "name" created for "var" by the Optimizer.
@@ -303,13 +254,13 @@ gives access to these Variables if for some reason you need them.
Use get_slot_names() to get the list of slot names created by the Optimizer.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`var`</b>: A variable passed to minimize() or apply_gradients().
* <b>`name`</b>: A string.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
The Variable for the slot if it was created, None otherwise.
@@ -318,17 +269,17 @@ Use get_slot_names() to get the list of slot names created by the Optimizer.
- - -
-### `class tf.train.GradientDescentOptimizer` <a class="md-anchor" id="GradientDescentOptimizer"></a>
+### `class tf.train.GradientDescentOptimizer` {#GradientDescentOptimizer}
Optimizer that implements the gradient descent algorithm.
- - -
-#### `tf.train.GradientDescentOptimizer.__init__(learning_rate, use_locking=False, name='GradientDescent')` <a class="md-anchor" id="GradientDescentOptimizer.__init__"></a>
+#### `tf.train.GradientDescentOptimizer.__init__(learning_rate, use_locking=False, name='GradientDescent')` {#GradientDescentOptimizer.__init__}
Construct a new gradient descent optimizer.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`learning_rate`</b>: A Tensor or a floating point value. The learning
@@ -341,17 +292,17 @@ Construct a new gradient descent optimizer.
- - -
-### `class tf.train.AdagradOptimizer` <a class="md-anchor" id="AdagradOptimizer"></a>
+### `class tf.train.AdagradOptimizer` {#AdagradOptimizer}
Optimizer that implements the Adagrad algorithm.
- - -
-#### `tf.train.AdagradOptimizer.__init__(learning_rate, initial_accumulator_value=0.1, use_locking=False, name='Adagrad')` <a class="md-anchor" id="AdagradOptimizer.__init__"></a>
+#### `tf.train.AdagradOptimizer.__init__(learning_rate, initial_accumulator_value=0.1, use_locking=False, name='Adagrad')` {#AdagradOptimizer.__init__}
Construct a new Adagrad optimizer.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`learning_rate`</b>: A `Tensor` or a floating point value. The learning rate.
@@ -361,7 +312,7 @@ Construct a new Adagrad optimizer.
* <b>`name`</b>: Optional name prefix for the operations created when applying
gradients. Defaults to "Adagrad".
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`ValueError`</b>: If the initial_accumulator_value is invalid.
@@ -370,17 +321,17 @@ Construct a new Adagrad optimizer.
- - -
-### `class tf.train.MomentumOptimizer` <a class="md-anchor" id="MomentumOptimizer"></a>
+### `class tf.train.MomentumOptimizer` {#MomentumOptimizer}
Optimizer that implements the Momentum algorithm.
- - -
-#### `tf.train.MomentumOptimizer.__init__(learning_rate, momentum, use_locking=False, name='Momentum')` <a class="md-anchor" id="MomentumOptimizer.__init__"></a>
+#### `tf.train.MomentumOptimizer.__init__(learning_rate, momentum, use_locking=False, name='Momentum')` {#MomentumOptimizer.__init__}
Construct a new Momentum optimizer.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`learning_rate`</b>: A `Tensor` or a floating point value. The learning rate.
@@ -393,13 +344,13 @@ Construct a new Momentum optimizer.
- - -
-### `class tf.train.AdamOptimizer` <a class="md-anchor" id="AdamOptimizer"></a>
+### `class tf.train.AdamOptimizer` {#AdamOptimizer}
Optimizer that implements the Adam algorithm.
- - -
-#### `tf.train.AdamOptimizer.__init__(learning_rate=0.001, beta1=0.9, beta2=0.999, epsilon=1e-08, use_locking=False, name='Adam')` <a class="md-anchor" id="AdamOptimizer.__init__"></a>
+#### `tf.train.AdamOptimizer.__init__(learning_rate=0.001, beta1=0.9, beta2=0.999, epsilon=1e-08, use_locking=False, name='Adam')` {#AdamOptimizer.__init__}
Construct a new Adam optimizer.
@@ -429,7 +380,7 @@ The default value of 1e-8 for epsilon might not be a good default in
general. For example, when training an Inception network on ImageNet a
current good choice is 1.0 or 0.1.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`learning_rate`</b>: A Tensor or a floating point value. The learning rate.
@@ -446,13 +397,13 @@ current good choice is 1.0 or 0.1.
- - -
-### `class tf.train.FtrlOptimizer` <a class="md-anchor" id="FtrlOptimizer"></a>
+### `class tf.train.FtrlOptimizer` {#FtrlOptimizer}
Optimizer that implements the FTRL algorithm.
- - -
-#### `tf.train.FtrlOptimizer.__init__(learning_rate, learning_rate_power=-0.5, initial_accumulator_value=0.1, l1_regularization_strength=0.0, l2_regularization_strength=0.0, use_locking=False, name='Ftrl')` <a class="md-anchor" id="FtrlOptimizer.__init__"></a>
+#### `tf.train.FtrlOptimizer.__init__(learning_rate, learning_rate_power=-0.5, initial_accumulator_value=0.1, l1_regularization_strength=0.0, l2_regularization_strength=0.0, use_locking=False, name='Ftrl')` {#FtrlOptimizer.__init__}
Construct a new FTRL optimizer.
@@ -480,7 +431,7 @@ Note that the real regularization coefficient of `|w|^2` for objective
function is `1 / lambda_2` if specifying `l2 = lambda_2` as argument when
using this function.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`learning_rate`</b>: A float value or a constant float `Tensor`.
@@ -495,7 +446,7 @@ using this function.
* <b>`name`</b>: Optional name prefix for the operations created when applying
gradients. Defaults to "Ftrl".
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`ValueError`</b>: if one of the arguments is invalid.
@@ -504,17 +455,17 @@ using this function.
- - -
-### `class tf.train.RMSPropOptimizer` <a class="md-anchor" id="RMSPropOptimizer"></a>
+### `class tf.train.RMSPropOptimizer` {#RMSPropOptimizer}
Optimizer that implements the RMSProp algorithm.
- - -
-#### `tf.train.RMSPropOptimizer.__init__(learning_rate, decay, momentum=0.0, epsilon=1e-10, use_locking=False, name='RMSProp')` <a class="md-anchor" id="RMSPropOptimizer.__init__"></a>
+#### `tf.train.RMSPropOptimizer.__init__(learning_rate, decay, momentum=0.0, epsilon=1e-10, use_locking=False, name='RMSProp')` {#RMSPropOptimizer.__init__}
Construct a new RMSProp optimizer.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`learning_rate`</b>: A Tensor or a floating point value. The learning rate.
@@ -528,7 +479,7 @@ Construct a new RMSProp optimizer.
-## Gradient Computation <a class="md-anchor" id="AUTOGENERATED-gradient-computation"></a>
+## Gradient Computation
TensorFlow provides functions to compute the derivatives for a given
TensorFlow computation graph, adding operations to the graph. The
@@ -538,7 +489,7 @@ functions below.
- - -
-### `tf.gradients(ys, xs, grad_ys=None, name='gradients', colocate_gradients_with_ops=False, gate_gradients=False, aggregation_method=None)` <a class="md-anchor" id="gradients"></a>
+### `tf.gradients(ys, xs, grad_ys=None, name='gradients', colocate_gradients_with_ops=False, gate_gradients=False, aggregation_method=None)` {#gradients}
Constructs symbolic partial derivatives of `ys` w.r.t. x in `xs`.
@@ -559,7 +510,7 @@ derivatives using a different initial gradient for each y (e.g., if
one wanted to weight the gradient differently for each value in
each y).
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`ys`</b>: A `Tensor` or list of tensors to be differentiated.
@@ -575,11 +526,11 @@ each y).
* <b>`aggregation_method`</b>: Specifies the method used to combine gradient terms.
Accepted values are constants defined in the class `AggregationMethod`.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A list of `sum(dy/dx)` for each x in `xs`.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`LookupError`</b>: if one of the operations between `x` and `y` does not
@@ -589,7 +540,7 @@ each y).
- - -
-### `class tf.AggregationMethod` <a class="md-anchor" id="AggregationMethod"></a>
+### `class tf.AggregationMethod` {#AggregationMethod}
A class listing aggregation methods used to combine gradients.
@@ -605,7 +556,7 @@ be used to combine gradients in the graph:
- - -
-### `tf.stop_gradient(input, name=None)` <a class="md-anchor" id="stop_gradient"></a>
+### `tf.stop_gradient(input, name=None)` {#stop_gradient}
Stops gradient computation.
@@ -629,20 +580,20 @@ to pretend that the value was a constant. Some examples include:
* Adversarial training, where no backprop should happen through the adversarial
example generation process.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`input`</b>: A `Tensor`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Tensor`. Has the same type as `input`.
-## Gradient Clipping <a class="md-anchor" id="AUTOGENERATED-gradient-clipping"></a>
+## Gradient Clipping
TensorFlow provides several operations that you can use to add clipping
functions to your graph. You can use these functions to perform general data
@@ -651,7 +602,7 @@ gradients.
- - -
-### `tf.clip_by_value(t, clip_value_min, clip_value_max, name=None)` <a class="md-anchor" id="clip_by_value"></a>
+### `tf.clip_by_value(t, clip_value_min, clip_value_max, name=None)` {#clip_by_value}
Clips tensor values to a specified min and max.
@@ -660,7 +611,7 @@ shape as `t` with its values clipped to `clip_value_min` and `clip_value_max`.
Any values less than `clip_value_min` are set to `clip_value_min`. Any values
greater than `clip_value_max` are set to `clip_value_max`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`t`</b>: A `Tensor`.
@@ -668,14 +619,14 @@ greater than `clip_value_max` are set to `clip_value_max`.
* <b>`clip_value_max`</b>: A 0-D (scalar) `Tensor`. The maximum value to clip by.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A clipped `Tensor`.
- - -
-### `tf.clip_by_norm(t, clip_norm, name=None)` <a class="md-anchor" id="clip_by_norm"></a>
+### `tf.clip_by_norm(t, clip_norm, name=None)` {#clip_by_norm}
Clips tensor values to a maximum L2-norm.
@@ -693,21 +644,21 @@ In this case, the L2-norm of the output tensor is `clip_norm`.
This operation is typically used to clip gradients before applying them with
an optimizer.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`t`</b>: A `Tensor`.
* <b>`clip_norm`</b>: A 0-D (scalar) `Tensor` > 0. A maximum clipping value.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A clipped `Tensor`.
- - -
-### `tf.clip_by_average_norm(t, clip_norm, name=None)` <a class="md-anchor" id="clip_by_average_norm"></a>
+### `tf.clip_by_average_norm(t, clip_norm, name=None)` {#clip_by_average_norm}
Clips tensor values to a maximum average L2-norm.
@@ -725,21 +676,21 @@ In this case, the average L2-norm of the output tensor is `clip_norm`.
This operation is typically used to clip gradients before applying them with
an optimizer.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`t`</b>: A `Tensor`.
* <b>`clip_norm`</b>: A 0-D (scalar) `Tensor` > 0. A maximum clipping value.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A clipped `Tensor`.
- - -
-### `tf.clip_by_global_norm(t_list, clip_norm, use_norm=None, name=None)` <a class="md-anchor" id="clip_by_global_norm"></a>
+### `tf.clip_by_global_norm(t_list, clip_norm, use_norm=None, name=None)` {#clip_by_global_norm}
Clips values of multiple tensors by the ratio of the sum of their norms.
@@ -769,7 +720,7 @@ Recurrent Neural Networks". http://arxiv.org/abs/1211.5063)
However, it is slower than `clip_by_norm()` because all the parameters must be
ready before the clipping operation can be performed.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`t_list`</b>: A tuple or list of mixed `Tensors`, `IndexedSlices`, or None.
@@ -778,13 +729,13 @@ ready before the clipping operation can be performed.
norm to use. If not provided, `global_norm()` is used to compute the norm.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
* <b>`list_clipped`</b>: A list of `Tensors` of the same type as `list_t`.
* <b>`global_norm`</b>: A 0-D (scalar) `Tensor` representing the global norm.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`TypeError`</b>: If `t_list` is not a sequence.
@@ -792,7 +743,7 @@ ready before the clipping operation can be performed.
- - -
-### `tf.global_norm(t_list, name=None)` <a class="md-anchor" id="global_norm"></a>
+### `tf.global_norm(t_list, name=None)` {#global_norm}
Computes the global norm of multiple tensors.
@@ -804,27 +755,27 @@ computed as:
Any entries in `t_list` that are of type None are ignored.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`t_list`</b>: A tuple or list of mixed `Tensors`, `IndexedSlices`, or None.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A 0-D (scalar) `Tensor` of type `float`.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`TypeError`</b>: If `t_list` is not a sequence.
-## Decaying the learning rate <a class="md-anchor" id="AUTOGENERATED-decaying-the-learning-rate"></a>
+## Decaying the learning rate
- - -
-### `tf.train.exponential_decay(learning_rate, global_step, decay_steps, decay_rate, staircase=False, name=None)` <a class="md-anchor" id="exponential_decay"></a>
+### `tf.train.exponential_decay(learning_rate, global_step, decay_steps, decay_rate, staircase=False, name=None)` {#exponential_decay}
Applies exponential decay to the learning rate.
@@ -857,7 +808,7 @@ optimizer = tf.GradientDescentOptimizer(learning_rate)
optimizer.minimize(...my loss..., global_step=global_step)
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`learning_rate`</b>: A scalar `float32` or `float64` `Tensor` or a
@@ -871,14 +822,14 @@ optimizer.minimize(...my loss..., global_step=global_step)
* <b>`staircase`</b>: Boolean. It `True` decay the learning rate at discrete intervals.
* <b>`name`</b>: string. Optional name of the operation. Defaults to 'ExponentialDecay'
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A scalar `Tensor` of the same type as `learning_rate`. The decayed
learning rate.
-## Moving Averages <a class="md-anchor" id="AUTOGENERATED-moving-averages"></a>
+## Moving Averages
Some training algorithms, such as GradientDescent and Momentum often benefit
from maintaining a moving average of variables during optimization. Using the
@@ -886,7 +837,7 @@ moving averages for evaluations often improve results significantly.
- - -
-### `class tf.train.ExponentialMovingAverage` <a class="md-anchor" id="ExponentialMovingAverage"></a>
+### `class tf.train.ExponentialMovingAverage` {#ExponentialMovingAverage}
Maintains moving averages of variables by employing an exponential decay.
@@ -970,7 +921,7 @@ saver.restore(...checkpoint filename...)
- - -
-#### `tf.train.ExponentialMovingAverage.__init__(decay, num_updates=None, name='ExponentialMovingAverage')` <a class="md-anchor" id="ExponentialMovingAverage.__init__"></a>
+#### `tf.train.ExponentialMovingAverage.__init__(decay, num_updates=None, name='ExponentialMovingAverage')` {#ExponentialMovingAverage.__init__}
Creates a new ExponentialMovingAverage object.
@@ -985,7 +936,7 @@ move faster. If passed, the actual decay rate used is:
`min(decay, (1 + num_updates) / (10 + num_updates))`
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`decay`</b>: Float. The decay to use.
@@ -996,7 +947,7 @@ move faster. If passed, the actual decay rate used is:
- - -
-#### `tf.train.ExponentialMovingAverage.apply(var_list=None)` <a class="md-anchor" id="ExponentialMovingAverage.apply"></a>
+#### `tf.train.ExponentialMovingAverage.apply(var_list=None)` {#ExponentialMovingAverage.apply}
Maintains moving averages of variables.
@@ -1014,17 +965,17 @@ Returns an op that updates all shadow variables as described above.
Note that `apply()` can be called multiple times with different lists of
variables.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`var_list`</b>: A list of Variable or Tensor objects. The variables
and Tensors must be of types float32 or float64.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
An Operation that updates the moving averages.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`TypeError`</b>: If the arguments are not all float32 or float64.
@@ -1034,7 +985,7 @@ variables.
- - -
-#### `tf.train.ExponentialMovingAverage.average_name(var)` <a class="md-anchor" id="ExponentialMovingAverage.average_name"></a>
+#### `tf.train.ExponentialMovingAverage.average_name(var)` {#ExponentialMovingAverage.average_name}
Returns the name of the `Variable` holding the average for `var`.
@@ -1049,12 +1000,12 @@ to restore the variable from the moving average value with:
`average_name()` can be called whether or not `apply()` has been called.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`var`</b>: A `Variable` object.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A string: the name of the variable that will be used or was used
by the `ExponentialMovingAverage class` to hold the moving average of
@@ -1063,16 +1014,16 @@ to restore the variable from the moving average value with:
- - -
-#### `tf.train.ExponentialMovingAverage.average(var)` <a class="md-anchor" id="ExponentialMovingAverage.average"></a>
+#### `tf.train.ExponentialMovingAverage.average(var)` {#ExponentialMovingAverage.average}
Returns the `Variable` holding the average of `var`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`var`</b>: A `Variable` object.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A `Variable` object or `None` if the moving average of `var`
is not maintained..
@@ -1080,7 +1031,7 @@ Returns the `Variable` holding the average of `var`.
-## Coordinator and QueueRunner <a class="md-anchor" id="AUTOGENERATED-coordinator-and-queuerunner"></a>
+## Coordinator and QueueRunner
See [Threading and Queues](../../how_tos/threading_and_queues/index.md)
for how to use threads and queues. For documentation on the Queue API,
@@ -1088,14 +1039,14 @@ see [Queues](../../api_docs/python/io_ops.md#queues).
- - -
-### `class tf.train.Coordinator` <a class="md-anchor" id="Coordinator"></a>
+### `class tf.train.Coordinator` {#Coordinator}
A coordinator for threads.
This class implements a simple mechanism to coordinate the termination of a
set of threads.
-#### Usage: <a class="md-anchor" id="AUTOGENERATED-usage-"></a>
+#### Usage:
```python
# Create a coordinator.
@@ -1119,7 +1070,7 @@ while not coord.should_stop():
...do some work...
```
-#### Exception handling: <a class="md-anchor" id="AUTOGENERATED-exception-handling-"></a>
+#### Exception handling:
A thread can report an exception to the Coordinator as part of the
`should_stop()` call. The exception will be re-raised from the
@@ -1150,7 +1101,7 @@ except Exception, e:
...exception that was passed to coord.request_stop()
```
-#### Grace period for stopping: <a class="md-anchor" id="AUTOGENERATED-grace-period-for-stopping-"></a>
+#### Grace period for stopping:
After a thread has called `coord.request_stop()` the other threads have a
fixed time to stop, this is called the 'stop grace period' and defaults to 2
@@ -1174,14 +1125,14 @@ except Exception:
```
- - -
-#### `tf.train.Coordinator.__init__()` <a class="md-anchor" id="Coordinator.__init__"></a>
+#### `tf.train.Coordinator.__init__()` {#Coordinator.__init__}
Create a new Coordinator.
- - -
-#### `tf.train.Coordinator.join(threads, stop_grace_period_secs=120)` <a class="md-anchor" id="Coordinator.join"></a>
+#### `tf.train.Coordinator.join(threads, stop_grace_period_secs=120)` {#Coordinator.join}
Wait for threads to terminate.
@@ -1196,14 +1147,14 @@ alive after that period expires, a RuntimeError is raised. Note that if
an 'exc_info' was passed to request_stop() then it is raised instead of
that RuntimeError.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`threads`</b>: List threading.Threads. The started threads to join.
* <b>`stop_grace_period_secs`</b>: Number of seconds given to threads to stop after
request_stop() has been called.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`RuntimeError`</b>: If any thread is still alive after request_stop()
@@ -1212,13 +1163,13 @@ that RuntimeError.
- - -
-#### `tf.train.Coordinator.request_stop(ex=None)` <a class="md-anchor" id="Coordinator.request_stop"></a>
+#### `tf.train.Coordinator.request_stop(ex=None)` {#Coordinator.request_stop}
Request that the threads stop.
After this is called, calls to should_stop() will return True.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`ex`</b>: Optional Exception, or Python 'exc_info' tuple as returned by
@@ -1228,28 +1179,28 @@ After this is called, calls to should_stop() will return True.
- - -
-#### `tf.train.Coordinator.should_stop()` <a class="md-anchor" id="Coordinator.should_stop"></a>
+#### `tf.train.Coordinator.should_stop()` {#Coordinator.should_stop}
Check if stop was requested.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
True if a stop was requested.
- - -
-#### `tf.train.Coordinator.wait_for_stop(timeout=None)` <a class="md-anchor" id="Coordinator.wait_for_stop"></a>
+#### `tf.train.Coordinator.wait_for_stop(timeout=None)` {#Coordinator.wait_for_stop}
Wait till the Coordinator is told to stop.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`timeout`</b>: float. Sleep for up to that many seconds waiting for
should_stop() to become True.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
True if the Coordinator is told stop, False if the timeout expired.
@@ -1257,7 +1208,7 @@ Wait till the Coordinator is told to stop.
- - -
-### `class tf.train.QueueRunner` <a class="md-anchor" id="QueueRunner"></a>
+### `class tf.train.QueueRunner` {#QueueRunner}
Holds a list of enqueue operations for a queue, each to be run in a thread.
@@ -1275,7 +1226,7 @@ and reporting exceptions, etc.
The `QueueRunner`, combined with the `Coordinator`, helps handle these issues.
- - -
-#### `tf.train.QueueRunner.__init__(queue, enqueue_ops)` <a class="md-anchor" id="QueueRunner.__init__"></a>
+#### `tf.train.QueueRunner.__init__(queue, enqueue_ops)` {#QueueRunner.__init__}
Create a QueueRunner.
@@ -1288,7 +1239,7 @@ enqueue op in parallel with the other threads. The enqueue ops do not have
to all be the same op, but it is expected that they all enqueue tensors in
`queue`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`queue`</b>: A `Queue`.
@@ -1297,7 +1248,7 @@ to all be the same op, but it is expected that they all enqueue tensors in
- - -
-#### `tf.train.QueueRunner.create_threads(sess, coord=None, daemon=False, start=False)` <a class="md-anchor" id="QueueRunner.create_threads"></a>
+#### `tf.train.QueueRunner.create_threads(sess, coord=None, daemon=False, start=False)` {#QueueRunner.create_threads}
Create threads to run the enqueue ops.
@@ -1313,7 +1264,7 @@ coordinator requests a stop.
This method may be called again as long as all threads from a previous call
have stopped.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`sess`</b>: A `Session`.
@@ -1323,11 +1274,11 @@ have stopped.
* <b>`start`</b>: Boolean. If `True` starts the threads. If `False` the
caller must call the `start()` method of the returned threads.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A list of threads.
-##### Raises: <a class="md-anchor" id="AUTOGENERATED-raises-"></a>
+##### Raises:
* <b>`RuntimeError`</b>: If threads from a previous call to `create_threads()` are
@@ -1336,7 +1287,7 @@ have stopped.
- - -
-#### `tf.train.QueueRunner.exceptions_raised` <a class="md-anchor" id="QueueRunner.exceptions_raised"></a>
+#### `tf.train.QueueRunner.exceptions_raised` {#QueueRunner.exceptions_raised}
Exceptions raised but not handled by the `QueueRunner` threads.
@@ -1349,7 +1300,7 @@ depending on whether or not a `Coordinator` was passed to
* Without a `Coordinator`, exceptions are captured by the `QueueRunner` and
made available in this `exceptions_raised` property.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A list of Python `Exception` objects. The list is empty if no exception
was captured. (No exceptions are captured when using a Coordinator.)
@@ -1357,7 +1308,7 @@ depending on whether or not a `Coordinator` was passed to
- - -
-### `tf.train.add_queue_runner(qr, collection='queue_runners')` <a class="md-anchor" id="add_queue_runner"></a>
+### `tf.train.add_queue_runner(qr, collection='queue_runners')` {#add_queue_runner}
Adds a `QueueRunner` to a collection in the graph.
@@ -1368,7 +1319,7 @@ allows you to add a queue runner to a well known collection in the graph.
The companion method `start_queue_runners()` can be used to start threads for
all the collected queue runners.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`qr`</b>: A `QueueRunner`.
@@ -1378,7 +1329,7 @@ all the collected queue runners.
- - -
-### `tf.train.start_queue_runners(sess=None, coord=None, daemon=True, start=True, collection='queue_runners')` <a class="md-anchor" id="start_queue_runners"></a>
+### `tf.train.start_queue_runners(sess=None, coord=None, daemon=True, start=True, collection='queue_runners')` {#start_queue_runners}
Starts all queue runners collected in the graph.
@@ -1386,7 +1337,7 @@ This is a companion method to `add_queue_runner()`. It just starts
threads for all queue runners collected in the graph. It returns
the list of all threads.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`sess`</b>: `Session` used to run the queue ops. Defaults to the
@@ -1398,13 +1349,13 @@ the list of all threads.
* <b>`collection`</b>: A `GraphKey` specifying the graph collection to
get the queue runners from. Defaults to `GraphKeys.QUEUE_RUNNERS`.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A list of threads.
-## Summary Operations <a class="md-anchor" id="AUTOGENERATED-summary-operations"></a>
+## Summary Operations
The following ops output
[`Summary`](https://tensorflow.googlesource.com/tensorflow/+/master/tensorflow/core/framework/summary.proto)
@@ -1422,14 +1373,14 @@ details.
- - -
-### `tf.scalar_summary(tags, values, collections=None, name=None)` <a class="md-anchor" id="scalar_summary"></a>
+### `tf.scalar_summary(tags, values, collections=None, name=None)` {#scalar_summary}
Outputs a `Summary` protocol buffer with scalar values.
The input `tags` and `values` must have the same shape. The generated
summary has a summary value for each tag-value pair in `tags` and `values`.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`tags`</b>: A 1-D `string` `Tensor`. Tags for the summaries.
@@ -1438,7 +1389,7 @@ summary has a summary value for each tag-value pair in `tags` and `values`.
added to these collections. Defaults to `[GraphKeys.SUMMARIES]`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A scalar `Tensor` of type `string`. The serialized `Summary` protocol
buffer.
@@ -1446,7 +1397,7 @@ summary has a summary value for each tag-value pair in `tags` and `values`.
- - -
-### `tf.image_summary(tag, tensor, max_images=None, collections=None, name=None)` <a class="md-anchor" id="image_summary"></a>
+### `tf.image_summary(tag, tensor, max_images=None, collections=None, name=None)` {#image_summary}
Outputs a `Summary` protocol buffer with images.
@@ -1476,7 +1427,7 @@ build the `tag` of the summary values:
* If `max_images` is greater than 1, the summary value tags are
generated sequentially as '*tag*/image/0', '*tag*/image/1', etc.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`tag`</b>: A scalar `Tensor` of type `string`. Used to build the `tag`
@@ -1488,7 +1439,7 @@ build the `tag` of the summary values:
summary to. Defaults to [ops.GraphKeys.SUMMARIES]
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A scalar `Tensor` of type `string`. The serialized `Summary` protocol
buffer.
@@ -1496,7 +1447,7 @@ build the `tag` of the summary values:
- - -
-### `tf.histogram_summary(tag, values, collections=None, name=None)` <a class="md-anchor" id="histogram_summary"></a>
+### `tf.histogram_summary(tag, values, collections=None, name=None)` {#histogram_summary}
Outputs a `Summary` protocol buffer with a histogram.
@@ -1506,7 +1457,7 @@ has one summary value containing a histogram for `values`.
This op reports an `OutOfRange` error if any value is not finite.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`tag`</b>: A `string` `Tensor`. 0-D. Tag to use for the summary value.
@@ -1516,7 +1467,7 @@ This op reports an `OutOfRange` error if any value is not finite.
added to these collections. Defaults to `[GraphKeys.SUMMARIES]`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A scalar `Tensor` of type `string`. The serialized `Summary` protocol
buffer.
@@ -1524,7 +1475,7 @@ This op reports an `OutOfRange` error if any value is not finite.
- - -
-### `tf.nn.zero_fraction(value, name=None)` <a class="md-anchor" id="zero_fraction"></a>
+### `tf.nn.zero_fraction(value, name=None)` {#zero_fraction}
Returns the fraction of zeros in `value`.
@@ -1535,13 +1486,13 @@ This is useful in summaries to measure and report sparsity. For example,
z = tf.Relu(...)
summ = tf.scalar_summary('sparsity', tf.zero_fraction(z))
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`value`</b>: A tensor of numeric type.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
The fraction of zeros in `value`, with type `float32`.
@@ -1549,7 +1500,7 @@ This is useful in summaries to measure and report sparsity. For example,
- - -
-### `tf.merge_summary(inputs, collections=None, name=None)` <a class="md-anchor" id="merge_summary"></a>
+### `tf.merge_summary(inputs, collections=None, name=None)` {#merge_summary}
Merges summaries.
@@ -1561,7 +1512,7 @@ summaries.
When the Op is run, it reports an `InvalidArgument` error if multiple values
in the summaries to merge use the same tag.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`inputs`</b>: A list of `string` `Tensor` objects containing serialized `Summary`
@@ -1570,7 +1521,7 @@ in the summaries to merge use the same tag.
added to these collections. Defaults to `[GraphKeys.SUMMARIES]`.
* <b>`name`</b>: A name for the operation (optional).
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
A scalar `Tensor` of type `string`. The serialized `Summary` protocol
buffer resulting from the merging.
@@ -1578,17 +1529,17 @@ in the summaries to merge use the same tag.
- - -
-### `tf.merge_all_summaries(key='summaries')` <a class="md-anchor" id="merge_all_summaries"></a>
+### `tf.merge_all_summaries(key='summaries')` {#merge_all_summaries}
Merges all summaries collected in the default graph.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`key`</b>: `GraphKey` used to collect the summaries. Defaults to
`GraphKeys.SUMMARIES`.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
If no summaries were collected, returns None. Otherwise returns a scalar
`Tensor` of type`string` containing the serialized `Summary` protocol
@@ -1596,7 +1547,7 @@ Merges all summaries collected in the default graph.
-## Adding Summaries to Event Files <a class="md-anchor" id="AUTOGENERATED-adding-summaries-to-event-files"></a>
+## Adding Summaries to Event Files
See [Summaries and
TensorBoard](../../how_tos/summaries_and_tensorboard/index.md) for an
@@ -1604,7 +1555,7 @@ overview of summaries, event files, and visualization in TensorBoard.
- - -
-### `class tf.train.SummaryWriter` <a class="md-anchor" id="SummaryWriter"></a>
+### `class tf.train.SummaryWriter` {#SummaryWriter}
Writes `Summary` protocol buffers to event files.
@@ -1616,7 +1567,7 @@ training.
- - -
-#### `tf.train.SummaryWriter.__init__(logdir, graph_def=None, max_queue=10, flush_secs=120)` <a class="md-anchor" id="SummaryWriter.__init__"></a>
+#### `tf.train.SummaryWriter.__init__(logdir, graph_def=None, max_queue=10, flush_secs=120)` {#SummaryWriter.__init__}
Creates a `SummaryWriter` and an event file.
@@ -1648,7 +1599,7 @@ the event file:
* `max_queue`: Maximum number of summaries or events pending to be
written to disk before one of the 'add' calls block.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`logdir`</b>: A string. Directory where event file will be written.
@@ -1661,7 +1612,7 @@ the event file:
- - -
-#### `tf.train.SummaryWriter.add_summary(summary, global_step=None)` <a class="md-anchor" id="SummaryWriter.add_summary"></a>
+#### `tf.train.SummaryWriter.add_summary(summary, global_step=None)` {#SummaryWriter.add_summary}
Adds a `Summary` protocol buffer to the event file.
@@ -1675,7 +1626,7 @@ function. Alternatively, you can pass a `tf.Summary` protocol
buffer that you populate with your own data. The latter is
commonly done to report evaluation results in event files.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`summary`</b>: A `Summary` protocol buffer, optionally serialized as a string.
@@ -1685,11 +1636,11 @@ commonly done to report evaluation results in event files.
- - -
-#### `tf.train.SummaryWriter.add_event(event)` <a class="md-anchor" id="SummaryWriter.add_event"></a>
+#### `tf.train.SummaryWriter.add_event(event)` {#SummaryWriter.add_event}
Adds an event to the event file.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`event`</b>: An `Event` protocol buffer.
@@ -1697,14 +1648,14 @@ Adds an event to the event file.
- - -
-#### `tf.train.SummaryWriter.add_graph(graph_def, global_step=None)` <a class="md-anchor" id="SummaryWriter.add_graph"></a>
+#### `tf.train.SummaryWriter.add_graph(graph_def, global_step=None)` {#SummaryWriter.add_graph}
Adds a `GraphDef` protocol buffer to the event file.
The graph described by the protocol buffer will be displayed by
TensorBoard. Most users pass a graph in the constructor instead.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`graph_def`</b>: A `GraphDef` protocol buffer.
@@ -1715,7 +1666,7 @@ TensorBoard. Most users pass a graph in the constructor instead.
- - -
-#### `tf.train.SummaryWriter.flush()` <a class="md-anchor" id="SummaryWriter.flush"></a>
+#### `tf.train.SummaryWriter.flush()` {#SummaryWriter.flush}
Flushes the event file to disk.
@@ -1725,7 +1676,7 @@ disk.
- - -
-#### `tf.train.SummaryWriter.close()` <a class="md-anchor" id="SummaryWriter.close"></a>
+#### `tf.train.SummaryWriter.close()` {#SummaryWriter.close}
Flushes the event file to disk and close the file.
@@ -1735,7 +1686,7 @@ Call this method when you do not need the summary writer anymore.
- - -
-### `tf.train.summary_iterator(path)` <a class="md-anchor" id="summary_iterator"></a>
+### `tf.train.summary_iterator(path)` {#summary_iterator}
An iterator for reading `Event` protocol buffers from an event file.
@@ -1768,22 +1719,22 @@ and
[Summary](https://tensorflow.googlesource.com/tensorflow/+/master/tensorflow/core/framework/summary.proto)
for more information about their attributes.
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`path`</b>: The path to an event file created by a `SummaryWriter`.
-##### Yields: <a class="md-anchor" id="AUTOGENERATED-yields-"></a>
+##### Yields:
`Event` protocol buffers.
-## Training utilities <a class="md-anchor" id="AUTOGENERATED-training-utilities"></a>
+## Training utilities
- - -
-### `tf.train.global_step(sess, global_step_tensor)` <a class="md-anchor" id="global_step"></a>
+### `tf.train.global_step(sess, global_step_tensor)` {#global_step}
Small helper to get the global step.
@@ -1799,21 +1750,21 @@ print 'global_step:', tf.train.global_step(sess, global_step_tensor)
global_step: 10
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`sess`</b>: A brain `Session` object.
* <b>`global_step_tensor`</b>: `Tensor` or the `name` of the operation that contains
the global step.
-##### Returns: <a class="md-anchor" id="AUTOGENERATED-returns-"></a>
+##### Returns:
The global step value.
- - -
-### `tf.train.write_graph(graph_def, logdir, name, as_text=True)` <a class="md-anchor" id="write_graph"></a>
+### `tf.train.write_graph(graph_def, logdir, name, as_text=True)` {#write_graph}
Writes a graph proto on disk.
@@ -1825,7 +1776,7 @@ sess = tf.Session()
tf.train.write_graph(sess.graph_def, '/tmp/my-model', 'train.pbtxt')
```
-##### Args: <a class="md-anchor" id="AUTOGENERATED-args-"></a>
+##### Args:
* <b>`graph_def`</b>: A `GraphDef` protocol buffer.
diff --git a/tensorflow/g3doc/get_started/basic_usage.md b/tensorflow/g3doc/get_started/basic_usage.md
index 3799fc2ffc..f4dcdf1c08 100644
--- a/tensorflow/g3doc/get_started/basic_usage.md
+++ b/tensorflow/g3doc/get_started/basic_usage.md
@@ -1,4 +1,4 @@
-# Basic Usage <a class="md-anchor" id="AUTOGENERATED-basic-usage"></a>
+# Basic Usage
To use TensorFlow you need to understand how TensorFlow:
@@ -8,7 +8,7 @@ To use TensorFlow you need to understand how TensorFlow:
* Maintains state with `Variables`.
* Uses feeds and fetches to get data into and out of arbitrary operations.
-## Overview <a class="md-anchor" id="AUTOGENERATED-overview"></a>
+## Overview
TensorFlow is a programming system in which you represent computations as
graphs. Nodes in the graph are called *ops* (short for operations). An op
@@ -24,7 +24,7 @@ methods return tensors produced by ops as [numpy](http://www.numpy.org)
`ndarray` objects in Python, and as `tensorflow::Tensor` instances in C and
C++.
-## The computation graph <a class="md-anchor" id="AUTOGENERATED-the-computation-graph"></a>
+## The computation graph
TensorFlow programs are usually structured into a construction phase, that
assembles a graph, and an execution phase that uses a session to execute ops in
@@ -40,7 +40,7 @@ of helper functions not available in the C and C++ libraries.
The session libraries have equivalent functionalities for the three languages.
-### Building the graph <a class="md-anchor" id="AUTOGENERATED-building-the-graph"></a>
+### Building the graph
To build a graph start with ops that do not need any input (source ops), such as
`Constant`, and pass their output to other ops that do computation.
@@ -77,7 +77,7 @@ The default graph now has three nodes: two `constant()` ops and one `matmul()`
op. To actually multiply the matrices, and get the result of the multiplication,
you must launch the graph in a session.
-### Launching the graph in a session <a class="md-anchor" id="AUTOGENERATED-launching-the-graph-in-a-session"></a>
+### Launching the graph in a session
Launching follows construction. To launch a graph, create a `Session` object.
Without arguments the session constructor launches the default graph.
@@ -146,7 +146,7 @@ Devices are specified with strings. The currently supported devices are:
See [Using GPUs](../how_tos/using_gpu/index.md) for more information about GPUs
and TensorFlow.
-## Interactive Usage <a class="md-anchor" id="AUTOGENERATED-interactive-usage"></a>
+## Interactive Usage
The Python examples in the documentation launch the graph with a
[`Session`](../api_docs/python/client.md#Session) and use the
@@ -171,13 +171,13 @@ a = tf.constant([3.0, 3.0])
# Initialize 'x' using the run() method of its initializer op.
x.initializer.run()
-# Add an op to subtact 'a' from 'x'. Run it and print the result
+# Add an op to subtract 'a' from 'x'. Run it and print the result
sub = tf.sub(x, a)
print sub.eval()
# ==> [-2. -1.]
```
-## Tensors <a class="md-anchor" id="AUTOGENERATED-tensors"></a>
+## Tensors
TensorFlow programs use a tensor data structure to represent all data -- only
tensors are passed between operations in the computation graph. You can think
@@ -186,7 +186,7 @@ static type a rank, and a shape. To learn more about how TensorFlow handles
these concepts, see the [Rank, Shape, and Type](../resources/dims_types.md)
reference.
-## Variables <a class="md-anchor" id="AUTOGENERATED-variables"></a>
+## Variables
Variables maintain state across executions of the graph. The following example
shows a variable serving as a simple counter. See
@@ -235,7 +235,7 @@ Variables. For example, you would store the weights for a neural network as a
tensor in a Variable. During training you update this tensor by running a
training graph repeatedly.
-## Fetches <a class="md-anchor" id="AUTOGENERATED-fetches"></a>
+## Fetches
To fetch the outputs of operations, execute the graph with a `run()` call on
the `Session` object and pass in the tensors to retrieve. In the previous
@@ -260,7 +260,7 @@ with tf.Session() as sess:
All the ops needed to produce the values of the requested tensors are run once
(not once per requested tensor).
-## Feeds <a class="md-anchor" id="AUTOGENERATED-feeds"></a>
+## Feeds
The examples above introduce tensors into the computation graph by storing them
in `Constants` and `Variables`. TensorFlow also provides a feed mechanism for
diff --git a/tensorflow/g3doc/get_started/index.md b/tensorflow/g3doc/get_started/index.md
index 0c58b969c7..3fce5e9d89 100644
--- a/tensorflow/g3doc/get_started/index.md
+++ b/tensorflow/g3doc/get_started/index.md
@@ -1,4 +1,4 @@
-# Introduction <a class="md-anchor" id="AUTOGENERATED-introduction"></a>
+# Introduction
Let's get you up and running with TensorFlow!
@@ -43,6 +43,10 @@ for step in xrange(0, 201):
# Learns best fit is W: [[0.100 0.200]], b: [0.300]
```
+The first part of this code builds the data flow graph. TensorFlow does not
+actually run any computation until the session is created and the `run`
+function is called.
+
To whet your appetite further, we suggest you check out what a classical
machine learning problem looks like in TensorFlow. In the land of neural
networks the most "classic" classical problem is the MNIST handwritten digit
@@ -67,7 +71,7 @@ these and charge ahead. Don't worry, you'll still get to see MNIST -- we'll
also use MNIST as an example in our technical tutorial where we elaborate on
TensorFlow features.
-## Recommended Next Steps: <a class="md-anchor" id="AUTOGENERATED-recommended-next-steps-"></a>
+## Recommended Next Steps:
* [Download and Setup](../get_started/os_setup.md)
* [Basic Usage](../get_started/basic_usage.md)
* [TensorFlow Mechanics 101](../tutorials/mnist/tf/index.md)
diff --git a/tensorflow/g3doc/get_started/os_setup.md b/tensorflow/g3doc/get_started/os_setup.md
index e5cd016544..f7776ca4de 100644
--- a/tensorflow/g3doc/get_started/os_setup.md
+++ b/tensorflow/g3doc/get_started/os_setup.md
@@ -1,8 +1,8 @@
-# Download and Setup <a class="md-anchor" id="AUTOGENERATED-download-and-setup"></a>
+# Download and Setup
You can install TensorFlow using our provided binary packages or from source.
-## Binary Installation <a class="md-anchor" id="AUTOGENERATED-binary-installation"></a>
+## Binary Installation
The TensorFlow Python API currently requires Python 2.7: we are
[working](https://github.com/tensorflow/tensorflow/issues/1) on adding support
@@ -16,7 +16,7 @@ If you encounter installation errors, see
installation, please consider using our virtualenv-based instructions
[here](#virtualenv_install).
-### Ubuntu/Linux 64-bit <a class="md-anchor" id="AUTOGENERATED-ubuntu-linux-64-bit"></a>
+### Ubuntu/Linux 64-bit
```bash
# For CPU-only version
@@ -26,7 +26,7 @@ $ pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5
$ pip install https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl
```
-### Mac OS X <a class="md-anchor" id="AUTOGENERATED-mac-os-x"></a>
+### Mac OS X
On OS X, we recommend installing [homebrew](http://brew.sh) and `brew install
python` before proceeding, or installing TensorFlow within [virtualenv](#virtualenv_install).
@@ -36,7 +36,7 @@ python` before proceeding, or installing TensorFlow within [virtualenv](#virtual
$ pip install https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl
```
-## Docker-based installation <a class="md-anchor" id="AUTOGENERATED-docker-based-installation"></a>
+## Docker-based installation
We also support running TensorFlow via [Docker](http://docker.com/), which lets
you avoid worrying about setting up dependencies.
@@ -51,7 +51,7 @@ $ docker run -it b.gcr.io/tensorflow/tensorflow
This will start a container with TensorFlow and all its dependencies already
installed.
-### Additional images <a class="md-anchor" id="AUTOGENERATED-additional-images"></a>
+### Additional images
The default Docker image above contains just a minimal set of libraries for
getting up and running with TensorFlow. We also have the following container,
@@ -62,7 +62,7 @@ which you can use in the `docker run` command above:
makes it easy to experiment directly with the source, without needing to
install any of the dependencies described above.
-## VirtualEnv-based installation <a class="md-anchor" id="virtualenv_install"></a>
+## VirtualEnv-based installation {#virtualenv_install}
We recommend using [virtualenv](https://pypi.python.org/pypi/virtualenv) to
create an isolated container and install TensorFlow in that container -- it is
@@ -121,9 +121,9 @@ then run an example TensorFlow program like:
$ # Your prompt should change back
```
-## Try your first TensorFlow program <a class="md-anchor" id="AUTOGENERATED-try-your-first-tensorflow-program"></a>
+## Try your first TensorFlow program
-### (Optional) Enable GPU Support <a class="md-anchor" id="AUTOGENERATED--optional--enable-gpu-support"></a>
+### (Optional) Enable GPU Support
If you installed the GPU-enabled TensorFlow pip binary, you must have the
correct versions of the CUDA SDK and CUDNN installed on your
@@ -138,7 +138,7 @@ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64"
export CUDA_HOME=/usr/local/cuda
```
-### Run TensorFlow <a class="md-anchor" id="AUTOGENERATED-run-tensorflow"></a>
+### Run TensorFlow
Open a python terminal:
@@ -158,9 +158,9 @@ Hello, TensorFlow!
```
-## Installing from sources <a class="md-anchor" id="source"></a>
+## Installing from sources {#source}
-### Clone the TensorFlow repository <a class="md-anchor" id="AUTOGENERATED-clone-the-tensorflow-repository"></a>
+### Clone the TensorFlow repository
```bash
$ git clone --recurse-submodules https://github.com/tensorflow/tensorflow
@@ -169,9 +169,9 @@ $ git clone --recurse-submodules https://github.com/tensorflow/tensorflow
`--recurse-submodules` is required to fetch the protobuf library that TensorFlow
depends on.
-### Installation for Linux <a class="md-anchor" id="AUTOGENERATED-installation-for-linux"></a>
+### Installation for Linux
-#### Install Bazel <a class="md-anchor" id="AUTOGENERATED-install-bazel"></a>
+#### Install Bazel
Follow instructions [here](http://bazel.io/docs/install.html) to install the
@@ -190,13 +190,13 @@ downloaded the installer.
Finally, follow the instructions in that script to place bazel into your binary
path.
-#### Install other dependencies <a class="md-anchor" id="AUTOGENERATED-install-other-dependencies"></a>
+#### Install other dependencies
```bash
$ sudo apt-get install python-numpy swig python-dev
```
-#### Optional: Install CUDA (GPUs on Linux) <a class="md-anchor" id="install_cuda"></a>
+#### Optional: Install CUDA (GPUs on Linux) {#install_cuda}
In order to build or run TensorFlow with GPU support, both Cuda Toolkit 7.0 and
CUDNN 6.5 V2 from NVIDIA need to be installed.
@@ -208,13 +208,13 @@ TensorFlow GPU support requires having a GPU card with NVidia Compute Capability
* NVidia K20
* NVidia K40
-##### Download and install Cuda Toolkit 7.0 <a class="md-anchor" id="AUTOGENERATED-download-and-install-cuda-toolkit-7.0"></a>
+##### Download and install Cuda Toolkit 7.0
https://developer.nvidia.com/cuda-toolkit-70
Install the toolkit into e.g. `/usr/local/cuda`
-##### Download and install CUDNN Toolkit 6.5 <a class="md-anchor" id="AUTOGENERATED-download-and-install-cudnn-toolkit-6.5"></a>
+##### Download and install CUDNN Toolkit 6.5
https://developer.nvidia.com/rdp/cudnn-archive
@@ -227,7 +227,7 @@ sudo cp cudnn-6.5-linux-x64-v2/cudnn.h /usr/local/cuda/include
sudo cp cudnn-6.5-linux-x64-v2/libcudnn* /usr/local/cuda/lib64
```
-##### Configure TensorFlow's canonical view of Cuda libraries <a class="md-anchor" id="AUTOGENERATED-configure-tensorflow-s-canonical-view-of-cuda-libraries"></a>
+##### Configure TensorFlow's canonical view of Cuda libraries
From the root of your source tree, run:
``` bash
@@ -252,7 +252,7 @@ This creates a canonical set of symbolic links to the Cuda libraries on your sys
Every time you change the Cuda library paths you need to run this step again before
you invoke the bazel build command.
-##### Build your target with GPU support. <a class="md-anchor" id="AUTOGENERATED-build-your-target-with-gpu-support."></a>
+##### Build your target with GPU support.
From the root of your source tree, run:
```bash
@@ -268,7 +268,7 @@ $ bazel-bin/tensorflow/cc/tutorials_example_trainer --use_gpu
Note that "--config=cuda" is needed to enable the GPU support.
-##### Enabling Cuda 3.0. <a class="md-anchor" id="AUTOGENERATED-enabling-cuda-3.0."></a>
+##### Enabling Cuda 3.0.
TensorFlow officially supports Cuda devices with 3.5 and 5.2 compute
capabilities. In order to enable earlier Cuda devices such as Grid K520, you
need to target Cuda 3.0. This can be done through TensorFlow unofficial
@@ -296,7 +296,7 @@ Setting up Cuda nvvm
Configuration finished
```
-##### Known issues <a class="md-anchor" id="AUTOGENERATED-known-issues"></a>
+##### Known issues
* Although it is possible to build both Cuda and non-Cuda configs under the same
source tree, we recommend to run "bazel clean" when switching between these two
@@ -307,30 +307,30 @@ will fail with a clear error message. In the future, we might consider making
this more conveninent by including the configure step in our build process,
given necessary bazel new feature support.
-### Installation for Mac OS X <a class="md-anchor" id="AUTOGENERATED-installation-for-mac-os-x"></a>
+### Installation for Mac OS X
-Mac needs the same set of dependencies as Linux, however their installing those
+Mac needs the same set of dependencies as Linux, however installing those
dependencies is different. Here is a set of useful links to help with installing
the dependencies on Mac OS X :
-#### Bazel <a class="md-anchor" id="AUTOGENERATED-bazel"></a>
+#### Bazel
Look for installation instructions for Mac OS X on
[this](http://bazel.io/docs/install.html) page.
-#### SWIG <a class="md-anchor" id="AUTOGENERATED-swig"></a>
+#### SWIG
[Mac OS X installation](http://www.swig.org/Doc3.0/Preface.html#Preface_osx_installation).
Notes : You need to install
[PCRE](ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/) and *NOT* PCRE2.
-#### Numpy <a class="md-anchor" id="AUTOGENERATED-numpy"></a>
+#### Numpy
Follow installation instructions [here](http://docs.scipy.org/doc/numpy/user/install.html).
-### Create the pip package and install <a class="md-anchor" id="create-pip"></a>
+### Create the pip package and install {#create-pip}
```bash
$ bazel build -c opt //tensorflow/tools/pip_package:build_pip_package
@@ -344,7 +344,7 @@ $ bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
$ pip install /tmp/tensorflow_pkg/tensorflow-0.5.0-cp27-none-linux_x86_64.whl
```
-## Train your first TensorFlow neural net model <a class="md-anchor" id="AUTOGENERATED-train-your-first-tensorflow-neural-net-model"></a>
+## Train your first TensorFlow neural net model
Starting from the root of your source tree, run:
@@ -372,9 +372,9 @@ Validation error: 7.0%
...
```
-## Common Problems <a class="md-anchor" id="common_install_problems"></a>
+## Common Problems {#common_install_problems}
-### GPU-related issues <a class="md-anchor" id="AUTOGENERATED-gpu-related-issues"></a>
+### GPU-related issues
If you encounter the following when trying to run a TensorFlow program:
@@ -384,9 +384,9 @@ ImportError: libcudart.so.7.0: cannot open shared object file: No such file or d
Make sure you followed the the GPU installation [instructions](#install_cuda).
-### Pip installation issues <a class="md-anchor" id="AUTOGENERATED-pip-installation-issues"></a>
+### Pip installation issues
-#### Can't find setup.py <a class="md-anchor" id="AUTOGENERATED-can-t-find-setup.py"></a>
+#### Can't find setup.py
If, during `pip install`, you encounter an error like:
@@ -403,7 +403,7 @@ pip install --upgrade pip
This may require `sudo`, depending on how `pip` is installed.
-#### SSLError: SSL_VERIFY_FAILED <a class="md-anchor" id="AUTOGENERATED-sslerror--ssl_verify_failed"></a>
+#### SSLError: SSL_VERIFY_FAILED
If, during pip install from a URL, you encounter an error like:
@@ -414,7 +414,7 @@ SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed
Solution: Download the wheel manually via curl or wget, and pip install locally.
-### On Linux <a class="md-anchor" id="AUTOGENERATED-on-linux"></a>
+### On Linux
If you encounter:
@@ -427,7 +427,7 @@ SyntaxError: invalid syntax
Solution: make sure you are using Python 2.7.
-### On MacOSX <a class="md-anchor" id="AUTOGENERATED-on-macosx"></a>
+### On MacOSX
If you encounter:
diff --git a/tensorflow/g3doc/how_tos/adding_an_op/index.md b/tensorflow/g3doc/how_tos/adding_an_op/index.md
index 9dd2456e0b..a73b4da98d 100644
--- a/tensorflow/g3doc/how_tos/adding_an_op/index.md
+++ b/tensorflow/g3doc/how_tos/adding_an_op/index.md
@@ -1,4 +1,4 @@
-# Adding a New Op <a class="md-anchor" id="AUTOGENERATED-adding-a-new-op"></a>
+# Adding a New Op
PREREQUISITES:
@@ -24,30 +24,9 @@ to:
for the Op. This allows shape inference to work with your Op.
* Test the Op, typically in Python.
-<!-- TOC-BEGIN This section is generated by neural network: DO NOT EDIT! -->
-## Contents
-### [Adding a New Op](#AUTOGENERATED-adding-a-new-op)
-* [Define the Op's interface](#define_interface)
-* [Implement the kernel for the Op](#AUTOGENERATED-implement-the-kernel-for-the-op)
-* [Generate the client wrapper](#AUTOGENERATED-generate-the-client-wrapper)
- * [The Python Op wrapper](#AUTOGENERATED-the-python-op-wrapper)
- * [The C++ Op wrapper](#AUTOGENERATED-the-c---op-wrapper)
-* [Verify it works](#AUTOGENERATED-verify-it-works)
-* [Validation](#Validation)
-* [Op registration](#AUTOGENERATED-op-registration)
- * [Attrs](#Attrs)
- * [Attr types](#AUTOGENERATED-attr-types)
- * [Polymorphism](#Polymorphism)
- * [Inputs and Outputs](#AUTOGENERATED-inputs-and-outputs)
- * [Backwards compatibility](#AUTOGENERATED-backwards-compatibility)
-* [GPU Support](#mult-archs)
-* [Implement the gradient in Python](#AUTOGENERATED-implement-the-gradient-in-python)
-* [Implement a shape function in Python](#AUTOGENERATED-implement-a-shape-function-in-python)
-
-
-<!-- TOC-END This section was generated by neural network, THANKS FOR READING! -->
-
-## Define the Op's interface <a class="md-anchor" id="define_interface"></a>
+[TOC]
+
+## Define the Op's interface {#define_interface}
You define the interface of an Op by registering it with the TensorFlow system.
In the registration, you specify the name of your Op, its inputs (types and
@@ -73,7 +52,7 @@ outputs a tensor `zeroed` of 32-bit integers.
> A note on naming: The name of the Op should be unique and CamelCase. Names
> starting with an underscore (`_`) are reserved for internal use.
-## Implement the kernel for the Op <a class="md-anchor" id="AUTOGENERATED-implement-the-kernel-for-the-op"></a>
+## Implement the kernel for the Op
After you define the interface, provide one or more implementations of the Op.
To create one of these kernels, create a class that extends `OpKernel` and
@@ -131,8 +110,8 @@ Once you
[build and reinstall TensorFlow](../../get_started/os_setup.md#create-pip), the
Tensorflow system can reference and use the Op when requested.
-## Generate the client wrapper <a class="md-anchor" id="AUTOGENERATED-generate-the-client-wrapper"></a>
-### The Python Op wrapper <a class="md-anchor" id="AUTOGENERATED-the-python-op-wrapper"></a>
+## Generate the client wrapper
+### The Python Op wrapper
Python op wrappers are created automatically in
`bazel-genfiles/tensorflow/python/ops/gen_user_ops.py` for all ops placed in the
@@ -176,7 +155,7 @@ def my_fact():
return gen_user_ops._fact()
```
-### The C++ Op wrapper <a class="md-anchor" id="AUTOGENERATED-the-c---op-wrapper"></a>
+### The C++ Op wrapper
C++ op wrappers are created automatically for all ops placed in the
[`tensorflow/core/user_ops`][user_ops] directory, when you build Tensorflow. For
@@ -191,7 +170,7 @@ statement
#include "tensorflow/cc/ops/user_ops.h"
```
-## Verify it works <a class="md-anchor" id="AUTOGENERATED-verify-it-works"></a>
+## Verify it works
A good way to verify that you've successfully implemented your Op is to write a
test for it. Create the file
@@ -214,7 +193,7 @@ Then run your test:
$ bazel test tensorflow/python:zero_out_op_test
```
-## Validation <a class="md-anchor" id="Validation"></a>
+## Validation {#Validation}
The example above assumed that the Op applied to a tensor of any shape. What
if it only applied to vectors? That means adding a check to the above OpKernel
@@ -253,9 +232,9 @@ function is an error, and if so return it, use
[`OP_REQUIRES_OK`][validation-macros]. Both of these macros return from the
function on error.
-## Op registration <a class="md-anchor" id="AUTOGENERATED-op-registration"></a>
+## Op registration
-### Attrs <a class="md-anchor" id="Attrs"></a>
+### Attrs {#Attrs}
Ops can have attrs, whose values are set when the Op is added to a graph. These
are used to configure the Op, and their values can be accessed both within the
@@ -339,7 +318,7 @@ which can then be used in the `Compute` method:
> .Output("zeroed: int32");
> </pre></code>
-### Attr types <a class="md-anchor" id="AUTOGENERATED-attr-types"></a>
+### Attr types
The following types are supported in an attr:
@@ -355,7 +334,7 @@ The following types are supported in an attr:
See also: [`op_def_builder.cc:FinalizeAttr`][FinalizeAttr] for a definitive list.
-#### Default values & constraints <a class="md-anchor" id="AUTOGENERATED-default-values---constraints"></a>
+#### Default values & constraints
Attrs may have default values, and some types of attrs can have constraints. To
define an attr with constraints, you can use the following `<attr-type-expr>`s:
@@ -456,8 +435,8 @@ REGISTER_OP("AttrDefaultExampleForAllTypes")
Note in particular that the values of type `type` use [the `DT_*` names
for the types](../../resources/dims_types.md#data-types).
-### Polymorphism <a class="md-anchor" id="Polymorphism"></a>
-#### Type Polymorphism <a class="md-anchor" id="type-polymorphism"></a>
+### Polymorphism {#Polymorphism}
+#### Type Polymorphism {#type-polymorphism}
For ops that can take different types as input or produce different output
types, you can specify [an attr](#attrs) in
@@ -685,7 +664,7 @@ TF_CALL_REAL_NUMBER_TYPES(REGISTER_KERNEL);
#undef REGISTER_KERNEL
```
-#### List Inputs and Outputs <a class="md-anchor" id="list-input-output"></a>
+#### List Inputs and Outputs {#list-input-output}
In addition to being able to accept or produce different types, ops can consume
or produce a variable number of tensors.
@@ -760,7 +739,7 @@ REGISTER_OP("MinimumLengthPolymorphicListExample")
.Output("out: T");
```
-### Inputs and Outputs <a class="md-anchor" id="AUTOGENERATED-inputs-and-outputs"></a>
+### Inputs and Outputs
To summarize the above, an Op registration can have multiple inputs and outputs:
@@ -861,7 +840,7 @@ expressions:
For more details, see
[`tensorflow/core/framework/op_def_builder.h`][op_def_builder].
-### Backwards compatibility <a class="md-anchor" id="AUTOGENERATED-backwards-compatibility"></a>
+### Backwards compatibility
In general, changes to specifications must be backwards-compatible: changing the
specification of an Op must not break prior serialized GraphDefs constructed
@@ -907,7 +886,7 @@ The full list of safe and unsafe changes can be found in
If you cannot make your change to an operation backwards compatible, then create
a new operation with a new name with the new semantics.
-## GPU Support <a class="md-anchor" id="mult-archs"></a>
+## GPU Support {#mult-archs}
You can implement different OpKernels and register one for CPU and another for
GPU, just like you can [register kernels for different types](#Polymorphism).
@@ -935,7 +914,7 @@ kept on the CPU, add a `HostMemory()` call to the kernel registration, e.g.:
PadOp<GPUDevice, T>)
```
-## Implement the gradient in Python <a class="md-anchor" id="AUTOGENERATED-implement-the-gradient-in-python"></a>
+## Implement the gradient in Python
Given a graph of ops, TensorFlow uses automatic differentiation
(backpropagation) to add new ops representing gradients with respect to the
@@ -1012,7 +991,7 @@ Note that at the time the gradient function is called, only the data flow graph
of ops is available, not the tensor data itself. Thus, all computation must be
performed using other tensorflow ops, to be run at graph execution time.
-## Implement a shape function in Python <a class="md-anchor" id="AUTOGENERATED-implement-a-shape-function-in-python"></a>
+## Implement a shape function in Python
The TensorFlow Python API has a feature called "shape inference" that provides
information about the shapes of tensors without having to execute the
diff --git a/tensorflow/g3doc/how_tos/graph_viz/index.md b/tensorflow/g3doc/how_tos/graph_viz/index.md
index bc594e31e0..c2907b8461 100644
--- a/tensorflow/g3doc/how_tos/graph_viz/index.md
+++ b/tensorflow/g3doc/how_tos/graph_viz/index.md
@@ -1,4 +1,4 @@
-# TensorBoard: Graph Visualization <a class="md-anchor" id="AUTOGENERATED-tensorboard--graph-visualization"></a>
+# TensorBoard: Graph Visualization
TensorFlow computation graphs are powerful but complicated. The graph visualization can help you understand and debug them. Here's an example of the visualization at work.
@@ -7,7 +7,7 @@ TensorFlow computation graphs are powerful but complicated. The graph visualizat
To see your own graph, run TensorBoard pointing it to the log directory of the job, click on the graph tab on the top pane and select the appropriate run using the menu at the upper left corner. For in depth information on how to run TensorBoard and make sure you are logging all the necessary information, see [Summaries and TensorBoard](../../how_tos/summaries_and_tensorboard/index.md).
-## Name scoping and nodes <a class="md-anchor" id="AUTOGENERATED-name-scoping-and-nodes"></a>
+## Name scoping and nodes
Typical TensorFlow graphs can have many thousands of nodes--far too many to see
easily all at once, or even to lay out using standard graph tools. To simplify,
@@ -142,7 +142,7 @@ Symbol | Meaning
![Control dependency edge](./control_edge.png "Control dependency edge") | Edge showing the control dependency between operations.
![Reference edge](./reference_edge.png "Reference edge") | A reference edge showing that the outgoing operation node can mutate the incoming tensor.
-## Interaction <a class="md-anchor" id="AUTOGENERATED-interaction"></a>
+## Interaction
Navigate the graph by panning and zooming. Click and drag to pan, and use a
scroll gesture to zoom. Double-click on a node, or click on its `+` button, to
diff --git a/tensorflow/g3doc/how_tos/new_data_formats/index.md b/tensorflow/g3doc/how_tos/new_data_formats/index.md
index 676f78eae9..417c7e0f2e 100644
--- a/tensorflow/g3doc/how_tos/new_data_formats/index.md
+++ b/tensorflow/g3doc/how_tos/new_data_formats/index.md
@@ -1,4 +1,4 @@
-# Custom Data Readers <a class="md-anchor" id="AUTOGENERATED-custom-data-readers"></a>
+# Custom Data Readers
PREREQUISITES:
@@ -20,16 +20,9 @@ For example, to read a
followed by
[an Op that parses CSV data from a line of text](../../api_docs/python/io_ops.md#decode_csv).
-<!-- TOC-BEGIN This section is generated by neural network: DO NOT EDIT! -->
-## Contents
-### [Custom Data Readers](#AUTOGENERATED-custom-data-readers)
-* [Writing a Reader for a file format](#AUTOGENERATED-writing-a-reader-for-a-file-format)
-* [Writing an Op for a record format](#AUTOGENERATED-writing-an-op-for-a-record-format)
+[TOC]
-
-<!-- TOC-END This section was generated by neural network, THANKS FOR READING! -->
-
-## Writing a Reader for a file format <a class="md-anchor" id="AUTOGENERATED-writing-a-reader-for-a-file-format"></a>
+## Writing a Reader for a file format
A `Reader` is something that reads records from a file. There are some examples
of Reader Ops already built into TensorFlow:
@@ -196,7 +189,7 @@ ops.RegisterShape("SomeReader")(common_shapes.scalar_shape)
You can see some examples in
[`tensorflow/python/ops/io_ops.py`](https://tensorflow.googlesource.com/tensorflow/+/master/tensorflow/python/ops/io_ops.py).
-## Writing an Op for a record format <a class="md-anchor" id="AUTOGENERATED-writing-an-op-for-a-record-format"></a>
+## Writing an Op for a record format
Generally this is an ordinary op that takes a scalar string record as input, and
so follow [the instructions to add an Op](../../how_tos/adding_an_op/index.md). You may
diff --git a/tensorflow/g3doc/how_tos/reading_data/index.md b/tensorflow/g3doc/how_tos/reading_data/index.md
index 64209b8bd0..089ee4e34d 100644
--- a/tensorflow/g3doc/how_tos/reading_data/index.md
+++ b/tensorflow/g3doc/how_tos/reading_data/index.md
@@ -1,4 +1,4 @@
-# Reading data <a class="md-anchor" id="AUTOGENERATED-reading-data"></a>
+# Reading data
There are three main methods of getting data into a TensorFlow program:
@@ -8,25 +8,9 @@ There are three main methods of getting data into a TensorFlow program:
* Preloaded data: a constant or variable in the TensorFlow graph holds
all the data (for small data sets).
-<!-- TOC-BEGIN This section is generated by neural network: DO NOT EDIT! -->
-## Contents
-### [Reading data](#AUTOGENERATED-reading-data)
-* [Feeding](#Feeding)
-* [Reading from files](#AUTOGENERATED-reading-from-files)
- * [Filenames, shuffling, and epoch limits](#AUTOGENERATED-filenames--shuffling--and-epoch-limits)
- * [File formats](#AUTOGENERATED-file-formats)
- * [Preprocessing](#AUTOGENERATED-preprocessing)
- * [Batching](#AUTOGENERATED-batching)
- * [Creating threads to prefetch using `QueueRunner` objects](#QueueRunner)
- * [Filtering records or producing multiple examples per record](#AUTOGENERATED-filtering-records-or-producing-multiple-examples-per-record)
- * [Sparse input data](#AUTOGENERATED-sparse-input-data)
-* [Preloaded data](#AUTOGENERATED-preloaded-data)
-* [Multiple input pipelines](#AUTOGENERATED-multiple-input-pipelines)
+[TOC]
-
-<!-- TOC-END This section was generated by neural network, THANKS FOR READING! -->
-
-## Feeding <a class="md-anchor" id="Feeding"></a>
+## Feeding {#Feeding}
TensorFlow's feed mechanism lets you inject data into any Tensor in a
computation graph. A python computation can thus feed data directly into the
@@ -54,7 +38,7 @@ in
[`tensorflow/g3doc/tutorials/mnist/fully_connected_feed.py`](https://tensorflow.googlesource.com/tensorflow/+/master/tensorflow/g3doc/tutorials/mnist/fully_connected_feed.py),
and is described in the [MNIST tutorial](../../tutorials/mnist/tf/index.md).
-## Reading from files <a class="md-anchor" id="AUTOGENERATED-reading-from-files"></a>
+## Reading from files
A typical pipeline for reading records from files has the following stages:
@@ -67,7 +51,7 @@ A typical pipeline for reading records from files has the following stages:
7. *Optional* preprocessing
8. Example queue
-### Filenames, shuffling, and epoch limits <a class="md-anchor" id="AUTOGENERATED-filenames--shuffling--and-epoch-limits"></a>
+### Filenames, shuffling, and epoch limits
For the list of filenames, use either a constant string Tensor (like
`["file0", "file1"]` or `[("file%d" % i) for i in range(2)]`) or the
@@ -89,7 +73,7 @@ The queue runner works in a thread separate from the reader that pulls
filenames from the queue, so the shuffling and enqueuing process does not
block the reader.
-### File formats <a class="md-anchor" id="AUTOGENERATED-file-formats"></a>
+### File formats
Select the reader that matches your input file format and pass the filename
queue to the reader's read method. The read method outputs a key identifying
@@ -97,7 +81,7 @@ the file and record (useful for debugging if you have some weird records), and
a scalar string value. Use one (or more) of the decoder and conversion ops to
decode this string into the tensors that make up an example.
-#### CSV files <a class="md-anchor" id="AUTOGENERATED-csv-files"></a>
+#### CSV files
To read text files in [comma-separated value (CSV)
format](https://tools.ietf.org/html/rfc4180), use a
@@ -139,7 +123,7 @@ You must call `tf.train.start_queue_runners` to populate the queue before
you call `run` or `eval` to execute the `read`. Otherwise `read` will
block while it waits for filenames from the queue.
-#### Fixed length records <a class="md-anchor" id="AUTOGENERATED-fixed-length-records"></a>
+#### Fixed length records
To read binary files in which each record is a fixed number of bytes, use
[`tf.FixedLengthRecordReader`](../../api_docs/python/io_ops.md#FixedLengthRecordReader)
@@ -155,7 +139,7 @@ needed. For CIFAR-10, you can see how to do the reading and decoding in
and described in
[this tutorial](../../tutorials/deep_cnn/index.md#prepare-the-data).
-#### Standard TensorFlow format <a class="md-anchor" id="AUTOGENERATED-standard-tensorflow-format"></a>
+#### Standard TensorFlow format
Another approach is to convert whatever data you have into a supported format.
This approach makes it easier to mix and match data sets and network
@@ -181,7 +165,7 @@ found in
[`tensorflow/g3doc/how_tos/reading_data/fully_connected_reader.py`](https://tensorflow.googlesource.com/tensorflow/+/master/tensorflow/g3doc/how_tos/reading_data/fully_connected_reader.py),
which you can compare with the `fully_connected_feed` version.
-### Preprocessing <a class="md-anchor" id="AUTOGENERATED-preprocessing"></a>
+### Preprocessing
You can then do any preprocessing of these examples you want. This would be any
processing that doesn't depend on trainable parameters. Examples include
@@ -190,7 +174,7 @@ etc. See
[`tensorflow/models/image/cifar10/cifar10.py`](https://tensorflow.googlesource.com/tensorflow/+/master/tensorflow/models/image/cifar10/cifar10.py)
for an example.
-### Batching <a class="md-anchor" id="AUTOGENERATED-batching"></a>
+### Batching
At the end of the pipeline we use another queue to batch together examples for
training, evaluation, or inference. For this we use a queue that randomizes the
@@ -268,7 +252,7 @@ summary to the graph that indicates how full the example queue is. If you have
enough reading threads, that summary will stay above zero. You can
[view your summaries as training progresses using TensorBoard](../../how_tos/summaries_and_tensorboard/index.md).
-### Creating threads to prefetch using `QueueRunner` objects <a class="md-anchor" id="QueueRunner"></a>
+### Creating threads to prefetch using `QueueRunner` objects {#QueueRunner}
The short version: many of the `tf.train` functions listed above add
[`QueueRunner`](../../api_docs/python/train.md#QueueRunner) objects to your
@@ -312,7 +296,7 @@ coord.join(threads)
sess.close()
```
-#### Aside: What is happening here? <a class="md-anchor" id="AUTOGENERATED-aside--what-is-happening-here-"></a>
+#### Aside: What is happening here?
First we create the graph. It will have a few pipeline stages that are
connected by queues. The first stage will generate filenames to read and enqueue
@@ -357,7 +341,7 @@ exception).
For more about threading, queues, QueueRunners, and Coordinators
[see here](../../how_tos/threading_and_queues/index.md).
-#### Aside: How clean shut-down when limiting epochs works <a class="md-anchor" id="AUTOGENERATED-aside--how-clean-shut-down-when-limiting-epochs-works"></a>
+#### Aside: How clean shut-down when limiting epochs works
Imagine you have a model that has set a limit on the number of epochs to train
on. That means that the thread generating filenames will only run that many
@@ -400,7 +384,7 @@ errors and exiting. Once all the training threads are done,
[`tf.train.Coordinator.join`](../../api_docs/python/train.md#Coordinator.join)
will return and you can exit cleanly.
-### Filtering records or producing multiple examples per record <a class="md-anchor" id="AUTOGENERATED-filtering-records-or-producing-multiple-examples-per-record"></a>
+### Filtering records or producing multiple examples per record
Instead of examples with shapes `[x, y, z]`, you will produce a batch of
examples with shape `[batch, x, y, z]`. The batch size can be 0 if you want to
@@ -409,14 +393,14 @@ are producing multiple examples per record. Then simply set `enqueue_many=True`
when calling one of the batching functions (such as `shuffle_batch` or
`shuffle_batch_join`).
-### Sparse input data <a class="md-anchor" id="AUTOGENERATED-sparse-input-data"></a>
+### Sparse input data
SparseTensors don't play well with queues. If you use SparseTensors you have
to decode the string records using
[`tf.parse_example`](../../api_docs/python/io_ops.md#parse_example) **after**
batching (instead of using `tf.parse_single_example` before batching).
-## Preloaded data <a class="md-anchor" id="AUTOGENERATED-preloaded-data"></a>
+## Preloaded data
This is only used for small data sets that can be loaded entirely in memory.
There are two approaches:
@@ -475,7 +459,7 @@ An MNIST example that preloads the data using constants can be found in
You can compare these with the `fully_connected_feed` and
`fully_connected_reader` versions above.
-## Multiple input pipelines <a class="md-anchor" id="AUTOGENERATED-multiple-input-pipelines"></a>
+## Multiple input pipelines
Commonly you will want to train on one dataset and evaluate (or "eval") on
another. One way to do this is to actually have two separate processes:
diff --git a/tensorflow/g3doc/how_tos/summaries_and_tensorboard/index.md b/tensorflow/g3doc/how_tos/summaries_and_tensorboard/index.md
index e431f4c26d..39108d29b7 100644
--- a/tensorflow/g3doc/how_tos/summaries_and_tensorboard/index.md
+++ b/tensorflow/g3doc/how_tos/summaries_and_tensorboard/index.md
@@ -1,4 +1,4 @@
-# TensorBoard: Visualizing Learning <a class="md-anchor" id="AUTOGENERATED-tensorboard--visualizing-learning"></a>
+# TensorBoard: Visualizing Learning
The computations you'll use TensorBoard for - like training a massive
deep neural network - can be complex and confusing. To make it easier to
@@ -11,7 +11,7 @@ TensorBoard is fully configured, it looks like this:
![MNIST TensorBoard](./mnist_tensorboard.png "MNIST TensorBoard")
-## Serializing the data <a class="md-anchor" id="AUTOGENERATED-serializing-the-data"></a>
+## Serializing the data
TensorBoard operates by reading TensorFlow events files, which contain summary
data that you can generate when running TensorFlow. Here's the general
@@ -79,7 +79,7 @@ while training:
You're now all set to visualize this data using TensorBoard.
-## Launching TensorBoard <a class="md-anchor" id="AUTOGENERATED-launching-tensorboard"></a>
+## Launching TensorBoard
To run TensorBoard, use the command
diff --git a/tensorflow/g3doc/how_tos/threading_and_queues/index.md b/tensorflow/g3doc/how_tos/threading_and_queues/index.md
index bb0d08f53f..6b71310e13 100644
--- a/tensorflow/g3doc/how_tos/threading_and_queues/index.md
+++ b/tensorflow/g3doc/how_tos/threading_and_queues/index.md
@@ -1,4 +1,4 @@
-# Threading and Queues <a class="md-anchor" id="AUTOGENERATED-threading-and-queues"></a>
+# Threading and Queues
Queues are a powerful mechanism for asynchronous computation using TensorFlow.
@@ -24,7 +24,7 @@ API, they are methods of the queue object (eg. `q.enqueue(...)`).
Now that you have a bit of a feel for queues, let's dive into the details...
-## Queue Use Overview <a class="md-anchor" id="AUTOGENERATED-queue-use-overview"></a>
+## Queue Use Overview
Queues, such as `FIFOQueue` and `RandomShuffleQueue`, are important TensorFlow
objects for computing tensors asynchronously in a graph.
@@ -54,7 +54,7 @@ stop together and report exceptions to a program that waits for them to stop.
The `QueueRunner` class is used to create a number of threads cooperating to
enqueue tensors in the same queue.
-## Coordinator <a class="md-anchor" id="AUTOGENERATED-coordinator"></a>
+## Coordinator
The Coordinator class helps multiple threads stop together.
@@ -96,7 +96,7 @@ Obviously, the coordinator can manage threads doing very different things.
They don't have to be all the same as in the example above. The coordinator
also has support to capture and report exceptions. See the [Coordinator class](../../api_docs/python/train.md#Coordinator) documentation for more details.
-## QueueRunner <a class="md-anchor" id="AUTOGENERATED-queuerunner"></a>
+## QueueRunner
The `QueueRunner` class creates a number of threads that repeatedly run an
enqueue op. These threads can use a coordinator to stop together. In
@@ -145,7 +145,7 @@ coord.request_stop()
coord.join(threads)
```
-## Handling Exceptions <a class="md-anchor" id="AUTOGENERATED-handling-exceptions"></a>
+## Handling Exceptions
Threads started by queue runners do more than just run the enqueue ops. They
also catch and handle exceptions generated by queues, including
diff --git a/tensorflow/g3doc/how_tos/using_gpu/index.md b/tensorflow/g3doc/how_tos/using_gpu/index.md
index 8a46c30c95..c0bdc5a7cb 100644
--- a/tensorflow/g3doc/how_tos/using_gpu/index.md
+++ b/tensorflow/g3doc/how_tos/using_gpu/index.md
@@ -1,6 +1,6 @@
-# Using GPUs <a class="md-anchor" id="AUTOGENERATED-using-gpus"></a>
+# Using GPUs
-## Supported devices <a class="md-anchor" id="AUTOGENERATED-supported-devices"></a>
+## Supported devices
On a typical system, there are multiple computing devices. In TensorFlow, the
supported device types are `CPU` and `GPU`. They are represented as
@@ -16,7 +16,7 @@ a device. For example, `matmul` has both CPU and GPU kernels. On a
system with devices `cpu:0` and `gpu:0`, `gpu:0` will be selected to run
`matmul`.
-## Logging Device placement <a class="md-anchor" id="AUTOGENERATED-logging-device-placement"></a>
+## Logging Device placement
To find out which devices your operations and tensors are assigned to, create
the session with `log_device_placement` configuration option set to `True`.
@@ -46,7 +46,7 @@ MatMul: /job:localhost/replica:0/task:0/gpu:0
```
-## Manual device placement <a class="md-anchor" id="AUTOGENERATED-manual-device-placement"></a>
+## Manual device placement
If you would like a particular operation to run on a device of your
choice instead of what's automatically selected for you, you can use
@@ -78,7 +78,7 @@ MatMul: /job:localhost/replica:0/task:0/gpu:0
[ 49. 64.]]
```
-## Using a single GPU on a multi-GPU system <a class="md-anchor" id="AUTOGENERATED-using-a-single-gpu-on-a-multi-gpu-system"></a>
+## Using a single GPU on a multi-GPU system
If you have more than one GPU in your system, the GPU with the lowest ID will be
selected by default. If you would like to run on a different GPU, you will need
@@ -125,7 +125,7 @@ sess = tf.Session(config=tf.ConfigProto(
print sess.run(c)
```
-## Using multiple GPUs <a class="md-anchor" id="AUTOGENERATED-using-multiple-gpus"></a>
+## Using multiple GPUs
If you would like to run TensorFlow on multiple GPUs, you can construct your
model in a multi-tower fashion where each tower is assigned to a different GPU.
diff --git a/tensorflow/g3doc/how_tos/variable_scope/index.md b/tensorflow/g3doc/how_tos/variable_scope/index.md
index f96734ca5b..2b4315aaa8 100644
--- a/tensorflow/g3doc/how_tos/variable_scope/index.md
+++ b/tensorflow/g3doc/how_tos/variable_scope/index.md
@@ -1,4 +1,4 @@
-# Sharing Variables <a class="md-anchor" id="AUTOGENERATED-sharing-variables"></a>
+# Sharing Variables
You can create, initialize, save and load single variables
in the way described in the [Variables HowTo](../../how_tos/variables/index.md).
@@ -7,7 +7,7 @@ variables and you might want to initialize all of them in one place.
This tutorial shows how this can be done using `tf.variable_scope()` and
the `tf.get_variable()`.
-## The Problem <a class="md-anchor" id="AUTOGENERATED-the-problem"></a>
+## The Problem
Imagine you create a simple model for image filters, similar to our
[Convolutional Neural Networks Tutorial](../../tutorials/deep_cnn/index.md)
@@ -88,7 +88,7 @@ For a lighter solution, not involving classes, TensorFlow provides
a *Variable Scope* mechanism that allows to easily share named variables
while constructing a graph.
-## Variable Scope Example <a class="md-anchor" id="AUTOGENERATED-variable-scope-example"></a>
+## Variable Scope Example
Variable Scope mechanism in TensorFlow consists of 2 main functions:
@@ -162,9 +162,9 @@ with tf.variable_scope("image_filters") as scope:
This is a good way to share variables, lightweight and safe.
-## How Does Variable Scope Work? <a class="md-anchor" id="AUTOGENERATED-how-does-variable-scope-work-"></a>
+## How Does Variable Scope Work?
-### Understanding `tf.get_variable()` <a class="md-anchor" id="AUTOGENERATED-understanding--tf.get_variable---"></a>
+### Understanding `tf.get_variable()`
To understand variable scope it is necessary to first
fully understand how `tf.get_variable()` works.
@@ -210,7 +210,7 @@ with tf.variable_scope("foo", reuse=True):
assert v1 == v
```
-### Basics of `tf.variable_scope()` <a class="md-anchor" id="AUTOGENERATED-basics-of--tf.variable_scope---"></a>
+### Basics of `tf.variable_scope()`
Knowing how `tf.get_variable()` works makes it easy to understand variable
scope. The primary function of variable scope is to carry a name that will
@@ -268,7 +268,7 @@ with tf.variable_scope("root"):
assert tf.get_variable_scope().reuse == False
```
-### Capturing variable scope <a class="md-anchor" id="AUTOGENERATED-capturing-variable-scope"></a>
+### Capturing variable scope
In all examples presented above, we shared parameters only because their
names agreed, that is, because we opened a reusing variable scope with
@@ -303,7 +303,7 @@ with tf.variable_scope("bar")
assert foo_scope2.name == "foo" # Not changed.
```
-### Initializers in variable scope <a class="md-anchor" id="AUTOGENERATED-initializers-in-variable-scope"></a>
+### Initializers in variable scope
Using `tf.get_variable()` allows to write functions that create or reuse
variables and can be transparently called from outside. But what if we wanted
@@ -329,7 +329,7 @@ with tf.variable_scope("foo", initializer=tf.constant_initializer(0.4)):
assert v.eval() == 0.2 # Changed default initializer.
```
-### Names of ops in `tf.variable_scope()` <a class="md-anchor" id="AUTOGENERATED-names-of-ops-in--tf.variable_scope---"></a>
+### Names of ops in `tf.variable_scope()`
We discussed how `tf.variable_scope` governs the names of variables.
But how does it influence the names of other ops in the scope?
@@ -359,7 +359,7 @@ When opening a variable scope using a captured object instead of a string,
we do not alter the current name scope for ops.
-## Examples of Use <a class="md-anchor" id="AUTOGENERATED-examples-of-use"></a>
+## Examples of Use
Here are pointers to a few files that make use of variable scope.
In particular, it is heavily used for recurrent neural networks
diff --git a/tensorflow/g3doc/how_tos/variables/index.md b/tensorflow/g3doc/how_tos/variables/index.md
index 9ff47b121a..6c3bce6c0b 100644
--- a/tensorflow/g3doc/how_tos/variables/index.md
+++ b/tensorflow/g3doc/how_tos/variables/index.md
@@ -1,4 +1,4 @@
-# Variables: Creation, Initialization, Saving, and Loading <a class="md-anchor" id="AUTOGENERATED-variables--creation--initialization--saving--and-loading"></a>
+# Variables: Creation, Initialization, Saving, and Loading
When you train a model, you use [variables](../../api_docs/python/state_ops.md)
to hold and update parameters. Variables are in-memory buffers containing
@@ -13,7 +13,7 @@ their reference manual for a complete description of their API:
* The [`tf.train.Saver`](../../api_docs/python/state_ops.md#Saver) class.
-## Creation <a class="md-anchor" id="AUTOGENERATED-creation"></a>
+## Creation
When you create a [Variable](../../api_docs/python/state_ops.md) you pass a
`Tensor` as its initial value to the `Variable()` constructor. TensorFlow
@@ -43,7 +43,7 @@ Calling `tf.Variable()` adds several ops to the graph:
The value returned by `tf.Variable()` value is an instance of the Python class
`tf.Variable`.
-## Initialization <a class="md-anchor" id="AUTOGENERATED-initialization"></a>
+## Initialization
Variable initializers must be run explicitly before other ops in your model can
be run. The easiest way to do that is to add an op that runs all the variable
@@ -74,7 +74,7 @@ with tf.Session() as sess:
...
```
-### Initialization from another Variable <a class="md-anchor" id="AUTOGENERATED-initialization-from-another-variable"></a>
+### Initialization from another Variable
You sometimes need to initialize a variable from the initial value of another
variable. As the op added by `tf.initialize_all_variables()` initializes all
@@ -96,7 +96,7 @@ w2 = tf.Variable(weights.initialized_value(), name="w2")
w_twice = tf.Variable(weights.initialized_value() * 2.0, name="w_twice")
```
-### Custom Initialization <a class="md-anchor" id="AUTOGENERATED-custom-initialization"></a>
+### Custom Initialization
The convenience function `tf.initialize_all_variables()` adds an op to
initialize *all variables* in the model. You can also pass it an explicit list
@@ -104,7 +104,7 @@ of variables to initialize. See the
[Variables Documentation](../../api_docs/python/state_ops.md) for more options,
including checking if variables are initialized.
-## Saving and Restoring <a class="md-anchor" id="AUTOGENERATED-saving-and-restoring"></a>
+## Saving and Restoring
The easiest way to save and restore a model is to use a `tf.train.Saver` object.
The constructor adds `save` and `restore` ops to the graph for all, or a
@@ -112,7 +112,7 @@ specified list, of the variables in the graph. The saver object provides
methods to run these ops, specifying paths for the checkpoint files to write to
or read from.
-### Checkpoint Files <a class="md-anchor" id="AUTOGENERATED-checkpoint-files"></a>
+### Checkpoint Files
Variables are saved in binary files that, roughly, contain a map from variable
names to tensor values.
@@ -122,7 +122,7 @@ variables in the checkpoint files. By default, it uses the value of the
[`Variable.name`](../../api_docs/python/state_ops.md#Variable.name) property for
each variable.
-### Saving Variables <a class="md-anchor" id="AUTOGENERATED-saving-variables"></a>
+### Saving Variables
Create a `Saver` with `tf.train.Saver()` to manage all variables in
the model.
@@ -149,7 +149,7 @@ with tf.Session() as sess:
print "Model saved in file: ", save_path
```
-### Restoring Variables <a class="md-anchor" id="AUTOGENERATED-restoring-variables"></a>
+### Restoring Variables
The same `Saver` object is used to restore variables. Note that when you
restore variables from a file you do not have to initialize them beforehand.
@@ -172,7 +172,7 @@ with tf.Session() as sess:
...
```
-### Choosing which Variables to Save and Restore <a class="md-anchor" id="AUTOGENERATED-choosing-which-variables-to-save-and-restore"></a>
+### Choosing which Variables to Save and Restore
If you do not pass any argument to `tf.train.Saver()` the saver handles all
variables in the graph. Each one of them is saved under the name that was
diff --git a/tensorflow/g3doc/index.md b/tensorflow/g3doc/index.md
index f213dc4073..dabc083ca8 100644
--- a/tensorflow/g3doc/index.md
+++ b/tensorflow/g3doc/index.md
@@ -1,8 +1,8 @@
-# TensorFlow <a class="md-anchor" id="AUTOGENERATED-tensorflow"></a>
+# TensorFlow
<!-- Note: This file is ignored in building the external site tensorflow.org -->
-## Introduction <a class="md-anchor" id="AUTOGENERATED-introduction"></a>
+## Introduction
TensorFlow&#8482; is an open source software library for numerical computation
using data flow graphs. Nodes in the graph represent mathematical operations,
@@ -16,6 +16,6 @@ neural networks research. The system is general enough to be applicable in a
wide variety of other domains as well. The following documents show you how
to set up and use the TensorFlow system.
-## Table of Contents <a class="md-anchor" id="AUTOGENERATED-table-of-contents"></a>
+## Table of Contents
<!--#include virtual="sitemap.md" -->
diff --git a/tensorflow/g3doc/resources/bib.md b/tensorflow/g3doc/resources/bib.md
index ea5dd53ba0..8a787919da 100644
--- a/tensorflow/g3doc/resources/bib.md
+++ b/tensorflow/g3doc/resources/bib.md
@@ -1,4 +1,4 @@
-# BibTex Citation <a class="md-anchor" id="AUTOGENERATED-bibtex-citation"></a>
+# BibTex Citation
If you use TensorFlow in your research and would like to cite the TensorFlow
system, we suggest you cite the following whitepaper:
diff --git a/tensorflow/g3doc/resources/dims_types.md b/tensorflow/g3doc/resources/dims_types.md
index 8468768a0b..768b2e7c14 100644
--- a/tensorflow/g3doc/resources/dims_types.md
+++ b/tensorflow/g3doc/resources/dims_types.md
@@ -1,11 +1,11 @@
-# Tensor Ranks, Shapes, and Types <a class="md-anchor" id="AUTOGENERATED-tensor-ranks--shapes--and-types"></a>
+# Tensor Ranks, Shapes, and Types
TensorFlow programs use a tensor data structure to represent all data. You can
think of a TensorFlow tensor as an n-dimensional array or list.
A tensor has a static type and dynamic dimensions. Only tensors may be passed
between nodes in the computation graph.
-## Rank <a class="md-anchor" id="AUTOGENERATED-rank"></a>
+## Rank
In the TensorFlow system, tensors are described by a unit of dimensionality
known as *rank*. Tensor rank is not the same as matrix rank. Tensor rank
@@ -28,7 +28,7 @@ Rank | Math entity | Python example
3 | 3-Tensor (cube of numbers) | `t = [[[2], [4], [6]], [[8], [10], [12]], [[14], [16], [18]]]`
n | n-Tensor (you get the idea) | `....`
-## Shape <a class="md-anchor" id="AUTOGENERATED-shape"></a>
+## Shape
The TensorFlow documentation uses three notational conventions to describe
tensor dimensionality: rank, shape, and dimension number. The following table
@@ -45,7 +45,7 @@ n | [D0, D1, ... Dn] | n-D | A tensor with shape [D0, D1, ... Dn].
Shapes can be represented via Python lists / tuples of ints, or with the
[`TensorShape` class](../api_docs/python/framework.md#TensorShape).
-## Data types <a class="md-anchor" id="AUTOGENERATED-data-types"></a>
+## Data types
In addition to dimensionality, Tensors have a data type. You can assign any one
of the following data types to a tensor:
diff --git a/tensorflow/g3doc/resources/faq.md b/tensorflow/g3doc/resources/faq.md
index 5efcc577ed..171697c69e 100644
--- a/tensorflow/g3doc/resources/faq.md
+++ b/tensorflow/g3doc/resources/faq.md
@@ -1,29 +1,17 @@
-# Frequently Asked Questions <a class="md-anchor" id="AUTOGENERATED-frequently-asked-questions"></a>
+# Frequently Asked Questions
This document provides answers to some of the frequently asked questions about
TensorFlow. If you have a question that is not covered here, you might find an
answer on one of the TensorFlow [community resources](../resources/index.md).
-<!-- TOC-BEGIN This section is generated by neural network: DO NOT EDIT! -->
-## Contents
-### [Frequently Asked Questions](#AUTOGENERATED-frequently-asked-questions)
-* [Building a TensorFlow graph](#AUTOGENERATED-building-a-tensorflow-graph)
-* [Running a TensorFlow computation](#AUTOGENERATED-running-a-tensorflow-computation)
-* [Variables](#AUTOGENERATED-variables)
-* [Tensor shapes](#AUTOGENERATED-tensor-shapes)
-* [TensorBoard](#AUTOGENERATED-tensorboard)
-* [Extending TensorFlow](#AUTOGENERATED-extending-tensorflow)
-* [Miscellaneous](#AUTOGENERATED-miscellaneous)
+[TOC]
-
-<!-- TOC-END This section was generated by neural network, THANKS FOR READING! -->
-
-## Building a TensorFlow graph <a class="md-anchor" id="AUTOGENERATED-building-a-tensorflow-graph"></a>
+## Building a TensorFlow graph
See also the
[API documentation on building graphs](../api_docs/python/framework.md).
-#### Why does `c = tf.matmul(a, b)` not execute the matrix multiplication immediately? <a class="md-anchor" id="AUTOGENERATED-why-does--c---tf.matmul-a--b---not-execute-the-matrix-multiplication-immediately-"></a>
+#### Why does `c = tf.matmul(a, b)` not execute the matrix multiplication immediately?
In the TensorFlow Python API, `a`, `b`, and `c` are
[`Tensor`](../api_docs/python/framework.md#Tensor) objects. A `Tensor` object is
@@ -36,12 +24,12 @@ a dataflow graph. You then offload the computation of the entire dataflow graph
whole computation much more efficiently than executing the operations
one-by-one.
-#### How are devices named? <a class="md-anchor" id="AUTOGENERATED-how-are-devices-named-"></a>
+#### How are devices named?
The supported device names are `"/device:CPU:0"` (or `"/cpu:0"`) for the CPU
device, and `"/device:GPU:i"` (or `"/gpu:i"`) for the *i*th GPU device.
-#### How do I place operations on a particular device? <a class="md-anchor" id="AUTOGENERATED-how-do-i-place-operations-on-a-particular-device-"></a>
+#### How do I place operations on a particular device?
To place a group of operations on a device, create them within a
[`with tf.device(name):`](../api_docs/python/framework.md#device) context. See
@@ -51,17 +39,17 @@ TensorFlow assigns operations to devices, and the
[CIFAR-10 tutorial](../tutorials/deep_cnn/index.md) for an example model that
uses multiple GPUs.
-#### What are the different types of tensors that are available? <a class="md-anchor" id="AUTOGENERATED-what-are-the-different-types-of-tensors-that-are-available-"></a>
+#### What are the different types of tensors that are available?
TensorFlow supports a variety of different data types and tensor shapes. See the
[ranks, shapes, and types reference](../resources/dims_types.md) for more details.
-## Running a TensorFlow computation <a class="md-anchor" id="AUTOGENERATED-running-a-tensorflow-computation"></a>
+## Running a TensorFlow computation
See also the
[API documentation on running graphs](../api_docs/python/client.md).
-#### What's the deal with feeding and placeholders? <a class="md-anchor" id="AUTOGENERATED-what-s-the-deal-with-feeding-and-placeholders-"></a>
+#### What's the deal with feeding and placeholders?
Feeding is a mechanism in the TensorFlow Session API that allows you to
substitute different values for one or more tensors at run time. The `feed_dict`
@@ -78,7 +66,7 @@ their shape as well. See the
example of how placeholders and feeding can be used to provide the training data
for a neural network.
-#### What is the difference between `Session.run()` and `Tensor.eval()`? <a class="md-anchor" id="AUTOGENERATED-what-is-the-difference-between--session.run----and--tensor.eval----"></a>
+#### What is the difference between `Session.run()` and `Tensor.eval()`?
If `t` is a [`Tensor`](../api_docs/python/framework.md#Tensor) object,
[`t.eval()`](../api_docs/python/framework.md#Tensor.eval) is shorthand for
@@ -105,7 +93,7 @@ the `with` block. The context manager approach can lead to more concise code for
simple use cases (like unit tests); if your code deals with multiple graphs and
sessions, it may be more straightforward to explicit calls to `Session.run()`.
-#### Do Sessions have a lifetime? What about intermediate tensors? <a class="md-anchor" id="AUTOGENERATED-do-sessions-have-a-lifetime--what-about-intermediate-tensors-"></a>
+#### Do Sessions have a lifetime? What about intermediate tensors?
Sessions can own resources, such
[variables](../api_docs/python/state_ops.md#Variable),
@@ -119,13 +107,13 @@ The intermediate tensors that are created as part of a call to
[`Session.run()`](../api_docs/python/client.md) will be freed at or before the
end of the call.
-#### Can I run distributed training on multiple computers? <a class="md-anchor" id="AUTOGENERATED-can-i-run-distributed-training-on-multiple-computers-"></a>
+#### Can I run distributed training on multiple computers?
The initial open-source release of TensorFlow supports multiple devices (CPUs
and GPUs) in a single computer. We are working on a distributed version as well:
if you are interested, please let us know so we can prioritize accordingly.
-#### Does the runtime parallelize parts of graph execution? <a class="md-anchor" id="AUTOGENERATED-does-the-runtime-parallelize-parts-of-graph-execution-"></a>
+#### Does the runtime parallelize parts of graph execution?
The TensorFlow runtime parallelizes graph execution across many different
dimensions:
@@ -140,7 +128,7 @@ dimensions:
enables the runtime to get higher throughput, if a single step does not use
all of the resources in your computer.
-#### Which client languages are supported in TensorFlow? <a class="md-anchor" id="AUTOGENERATED-which-client-languages-are-supported-in-tensorflow-"></a>
+#### Which client languages are supported in TensorFlow?
TensorFlow is designed to support multiple client languages. Currently, the
best-supported client language is [Python](../api_docs/python/index.md). The
@@ -154,7 +142,7 @@ interest. TensorFlow has a
that makes it easy to build a client in many different languages. We invite
contributions of new language bindings.
-#### Does TensorFlow make use of all the devices (GPUs and CPUs) available on my machine? <a class="md-anchor" id="AUTOGENERATED-does-tensorflow-make-use-of-all-the-devices--gpus-and-cpus--available-on-my-machine-"></a>
+#### Does TensorFlow make use of all the devices (GPUs and CPUs) available on my machine?
TensorFlow supports multiple GPUs and CPUs. See the how-to documentation on
[using GPUs with TensorFlow](../how_tos/using_gpu/index.md) for details of how
@@ -165,7 +153,7 @@ uses multiple GPUs.
Note that TensorFlow only uses GPU devices with a compute capability greater
than 3.5.
-#### Why does `Session.run()` hang when using a reader or a queue? <a class="md-anchor" id="AUTOGENERATED-why-does--session.run----hang-when-using-a-reader-or-a-queue-"></a>
+#### Why does `Session.run()` hang when using a reader or a queue?
The [reader](../api_docs/python/io_ops.md#ReaderBase) and
[queue](../api_docs/python/io_ops.md#QueueBase) classes provide special operations that
@@ -177,20 +165,20 @@ for
[using `QueueRunner` objects to drive queues and readers](../how_tos/reading_data/index.md#QueueRunners)
for more information on how to use them.
-## Variables <a class="md-anchor" id="AUTOGENERATED-variables"></a>
+## Variables
See also the how-to documentation on [variables](../how_tos/variables/index.md)
and [variable scopes](../how_tos/variable_scope/index.md), and
[the API documentation for variables](../api_docs/python/state_ops.md).
-#### What is the lifetime of a variable? <a class="md-anchor" id="AUTOGENERATED-what-is-the-lifetime-of-a-variable-"></a>
+#### What is the lifetime of a variable?
A variable is created when you first run the
[`tf.Variable.initializer`](../api_docs/python/state_ops.md#Variable.initializer)
operation for that variable in a session. It is destroyed when that
[`session is closed`](../api_docs/python/client.md#Session.close).
-#### How do variables behave when they are concurrently accessed? <a class="md-anchor" id="AUTOGENERATED-how-do-variables-behave-when-they-are-concurrently-accessed-"></a>
+#### How do variables behave when they are concurrently accessed?
Variables allow concurrent read and write operations. The value read from a
variable may change it is concurrently updated. By default, concurrent assigment
@@ -198,12 +186,12 @@ operations to a variable are allowed to run with no mutual exclusion. To acquire
a lock when assigning to a variable, pass `use_locking=True` to
[`Variable.assign()`](../api_docs/python/state_ops.md#Variable.assign).
-## Tensor shapes <a class="md-anchor" id="AUTOGENERATED-tensor-shapes"></a>
+## Tensor shapes
See also the
[`TensorShape` API documentation](../api_docs/python/framework.md#TensorShape).
-#### How can I determine the shape of a tensor in Python? <a class="md-anchor" id="AUTOGENERATED-how-can-i-determine-the-shape-of-a-tensor-in-python-"></a>
+#### How can I determine the shape of a tensor in Python?
In TensorFlow, a tensor has both a static (inferred) shape and a dynamic (true)
shape. The static shape can be read using the
@@ -214,7 +202,7 @@ tensor, and may be
shape is not fully defined, the dynamic shape of a `Tensor` `t` can be
determined by evaluating [`tf.shape(t)`](../api_docs/python/array_ops.md#shape).
-#### What is the difference between `x.set_shape()` and `x = tf.reshape(x)`? <a class="md-anchor" id="AUTOGENERATED-what-is-the-difference-between--x.set_shape----and--x---tf.reshape-x---"></a>
+#### What is the difference between `x.set_shape()` and `x = tf.reshape(x)`?
The [`tf.Tensor.set_shape()`](../api_docs/python/framework.md) method updates
the static shape of a `Tensor` object, and it is typically used to provide
@@ -224,7 +212,7 @@ change the dynamic shape of the tensor.
The [`tf.reshape()`](../api_docs/python/array_ops.md#reshape) operation creates
a new tensor with a different dynamic shape.
-#### How do I build a graph that works with variable batch sizes? <a class="md-anchor" id="AUTOGENERATED-how-do-i-build-a-graph-that-works-with-variable-batch-sizes-"></a>
+#### How do I build a graph that works with variable batch sizes?
It is often useful to build a graph that works with variable batch sizes, for
example so that the same code can be used for (mini-)batch training, and
@@ -250,13 +238,13 @@ to encode the batch size as a Python constant, but instead to use a symbolic
[`tf.placeholder(..., shape=[None, ...])`](../api_docs/python/io_ops.md#placeholder). The
`None` element of the shape corresponds to a variable-sized dimension.
-## TensorBoard <a class="md-anchor" id="AUTOGENERATED-tensorboard"></a>
+## TensorBoard
-#### How can I visualize a TensorFlow graph? <a class="md-anchor" id="AUTOGENERATED-how-can-i-visualize-a-tensorflow-graph-"></a>
+#### How can I visualize a TensorFlow graph?
See the [graph visualization tutorial](../how_tos/graph_viz/index.md).
-#### What is the simplest way to send data to TensorBoard? <a class="md-anchor" id="AUTOGENERATED-what-is-the-simplest-way-to-send-data-to-tensorboard-"></a>
+#### What is the simplest way to send data to TensorBoard?
Add summary ops to your TensorFlow graph, and use a
[`SummaryWriter`](../api_docs/python/train.md#SummaryWriter) to write
@@ -267,12 +255,12 @@ these summaries to a log directory. Then, start TensorBoard using
For more details, see the [Summaries and TensorBoard tutorial]
(../how_tos/summaries_and_tensorboard/index.md).
-## Extending TensorFlow <a class="md-anchor" id="AUTOGENERATED-extending-tensorflow"></a>
+## Extending TensorFlow
See also the how-to documentation for
[adding a new operation to TensorFlow](../how_tos/adding_an_op/index.md).
-#### My data is in a custom format. How do I read it using TensorFlow? <a class="md-anchor" id="AUTOGENERATED-my-data-is-in-a-custom-format.-how-do-i-read-it-using-tensorflow-"></a>
+#### My data is in a custom format. How do I read it using TensorFlow?
There are two main options for dealing with data in a custom format.
@@ -290,7 +278,7 @@ data format. The
[guide to handling new data formats](../how_tos/new_data_formats/index.md) has
more information about the steps for doing this.
-#### How do I define an operation that takes a variable number of inputs? <a class="md-anchor" id="AUTOGENERATED-how-do-i-define-an-operation-that-takes-a-variable-number-of-inputs-"></a>
+#### How do I define an operation that takes a variable number of inputs?
The TensorFlow op registration mechanism allows you to define inputs that are a
single tensor, a list of tensors with the same type (for example when adding
@@ -300,15 +288,15 @@ how-to documentation for
[adding an op with a list of inputs or outputs](../how_tos/adding_an_op/index.md#list-input-output)
for more details of how to define these different input types.
-## Miscellaneous <a class="md-anchor" id="AUTOGENERATED-miscellaneous"></a>
+## Miscellaneous
-#### Does TensorFlow work with Python 3? <a class="md-anchor" id="AUTOGENERATED-does-tensorflow-work-with-python-3-"></a>
+#### Does TensorFlow work with Python 3?
We have only tested TensorFlow using Python 2.7. We are aware of some changes
that will be required for Python 3 compatibility, and welcome contributions
towards this effort.
-#### What is TensorFlow's coding style convention? <a class="md-anchor" id="AUTOGENERATED-what-is-tensorflow-s-coding-style-convention-"></a>
+#### What is TensorFlow's coding style convention?
The TensorFlow Python API adheres to the
[PEP8](https://www.python.org/dev/peps/pep-0008/) conventions.<sup>*</sup> In
diff --git a/tensorflow/g3doc/resources/glossary.md b/tensorflow/g3doc/resources/glossary.md
index 40683a1a6c..a0ae73d917 100644
--- a/tensorflow/g3doc/resources/glossary.md
+++ b/tensorflow/g3doc/resources/glossary.md
@@ -1,4 +1,4 @@
-# Glossary <a class="md-anchor" id="AUTOGENERATED-glossary"></a>
+# Glossary
**Broadcasting operation**
diff --git a/tensorflow/g3doc/resources/index.md b/tensorflow/g3doc/resources/index.md
index 57c88f4167..3ae4896656 100644
--- a/tensorflow/g3doc/resources/index.md
+++ b/tensorflow/g3doc/resources/index.md
@@ -1,14 +1,14 @@
-# Additional Resources <a class="md-anchor" id="AUTOGENERATED-additional-resources"></a>
+# Additional Resources
-## TensorFlow WhitePaper <a class="md-anchor" id="AUTOGENERATED-tensorflow-whitepaper"></a>
+## TensorFlow WhitePaper
Additional details about the TensorFlow programming model and the underlying
implementation can be found in out white paper:
* [TensorFlow: Large-scale machine learning on heterogeneous systems](http://download.tensorflow.org/paper/whitepaper2015.pdf)
-### Citation <a class="md-anchor" id="AUTOGENERATED-citation"></a>
+### Citation
If you use TensorFlow in your research and would like to cite the TensorFlow
system, we suggest you cite the paper above.
@@ -21,9 +21,9 @@ endorsed by or otherwise affiliated with Google. When referring to our marks,
please include the following attribution statement: "TensorFlow, the TensorFlow
logo and any related marks are trademarks of Google Inc."
-## Community <a class="md-anchor" id="AUTOGENERATED-community"></a>
+## Community
-### Development <a class="md-anchor" id="AUTOGENERATED-development"></a>
+### Development
The source is hosted on GitHub: <https://github.com/tensorflow/tensorflow>.
@@ -31,14 +31,14 @@ If you are interested in contributing to TensorFlow please
[review the contributing guide](
https://github.com/tensorflow/tensorflow/blob/master/CONTRIBUTING.md).
-### Help / Support / How do I? <a class="md-anchor" id="AUTOGENERATED-help---support---how-do-i-"></a>
+### Help / Support / How do I?
For help and support, technical or algorithmic questions, please submit
your questions to Stack Overflow:
<https://stackoverflow.com/questions/tagged/tensorflow>.
Please do not use the mailing list or issue tracker for support.
-### Discussions <a class="md-anchor" id="AUTOGENERATED-discussions"></a>
+### Discussions
For general discussions, please join the [TensorFlow discuss mailing list](
https://groups.google.com/a/tensorflow.org/d/forum/discuss).
@@ -47,7 +47,7 @@ directions, not as a help forum. Instead, direct your questions to
[Stack Overflow](https://stackoverflow.com/questions/tagged/tensorflow), and
report issues on [GitHub](https://github.com/tensorflow/tensorflow/issues).
-### Report Issues <a class="md-anchor" id="AUTOGENERATED-report-issues"></a>
+### Report Issues
Please report bugs, feature requests and installation / compatibility issues on
the [TensorFlow issues tracker](
diff --git a/tensorflow/g3doc/resources/uses.md b/tensorflow/g3doc/resources/uses.md
index 08417f0ab0..b47307d020 100644
--- a/tensorflow/g3doc/resources/uses.md
+++ b/tensorflow/g3doc/resources/uses.md
@@ -1,4 +1,4 @@
-# Example Uses <a class="md-anchor" id="AUTOGENERATED-example-uses"></a>
+# Example Uses
This page describes some of the current uses of the TensorFlow system.
diff --git a/tensorflow/g3doc/tutorials/deep_cnn/index.md b/tensorflow/g3doc/tutorials/deep_cnn/index.md
index be20066f39..5198930549 100644
--- a/tensorflow/g3doc/tutorials/deep_cnn/index.md
+++ b/tensorflow/g3doc/tutorials/deep_cnn/index.md
@@ -1,9 +1,9 @@
-# Convolutional Neural Networks <a class="md-anchor" id="AUTOGENERATED-convolutional-neural-networks"></a>
+# Convolutional Neural Networks
> **NOTE:** This tutorial is intended for *advanced* users of TensorFlow
and assumes expertise and experience in machine learning.
-## Overview <a class="md-anchor" id="AUTOGENERATED-overview"></a>
+## Overview
CIFAR-10 classification is a common benchmark problem in machine learning. The
problem is to classify RGB 32x32 pixel images across 10 categories:
@@ -15,7 +15,7 @@ For more details refer to the [CIFAR-10 page](http://www.cs.toronto.edu/~kriz/ci
and a [Tech Report](http://www.cs.toronto.edu/~kriz/learning-features-2009-TR.pdf)
by Alex Krizhevsky.
-### Goals <a class="md-anchor" id="AUTOGENERATED-goals"></a>
+### Goals
The goal of this tutorial is to build a relatively small convolutional neural
network (CNN) for recognizing images. In the process, this tutorial:
@@ -29,7 +29,7 @@ much of TensorFlow's ability to scale to large models. At the same time,
the model is small enough to train fast, which is ideal for trying out
new ideas and experimenting with new techniques.
-### Highlights of the Tutorial <a class="md-anchor" id="AUTOGENERATED-highlights-of-the-tutorial"></a>
+### Highlights of the Tutorial
The CIFAR-10 tutorial demonstrates several important constructs for
designing larger and more sophisticated models in TensorFlow:
@@ -60,7 +60,7 @@ We also provide a multi-GPU version of the model which demonstrates:
We hope that this tutorial provides a launch point for building larger CNNs for
vision tasks on TensorFlow.
-### Model Architecture <a class="md-anchor" id="AUTOGENERATED-model-architecture"></a>
+### Model Architecture
The model in this CIFAR-10 tutorial is a multi-layer architecture consisting of
alternating convolutions and nonlinearities. These layers are followed by fully
@@ -74,7 +74,7 @@ of training time on a GPU. Please see [below](#evaluating-a-model) and the code
for details. It consists of 1,068,298 learnable parameters and requires about
19.5M multiply-add operations to compute inference on a single image.
-## Code Organization <a class="md-anchor" id="AUTOGENERATED-code-organization"></a>
+## Code Organization
The code for this tutorial resides in
[`tensorflow/models/image/cifar10/`](https://tensorflow.googlesource.com/tensorflow/+/master/tensorflow/models/image/cifar10/).
@@ -88,7 +88,7 @@ File | Purpose
[`cifar10_eval.py`](https://tensorflow.googlesource.com/tensorflow/+/master/tensorflow/models/image/cifar10/cifar10_eval.py) | Evaluates the predictive performance of a CIFAR-10 model.
-## CIFAR-10 Model <a class="md-anchor" id="AUTOGENERATED-cifar-10-model"></a>
+## CIFAR-10 Model
The CIFAR-10 network is largely contained in
[`cifar10.py`](https://tensorflow.googlesource.com/tensorflow/+/master/tensorflow/models/image/cifar10/cifar10.py).
@@ -105,7 +105,7 @@ adds operations that perform inference, i.e. classification, on supplied images.
add operations that compute the loss,
gradients, variable updates and visualization summaries.
-### Model Inputs <a class="md-anchor" id="model-inputs"></a>
+### Model Inputs {#model-inputs}
The input part of the model is built by the functions `inputs()` and
`distorted_inputs()` which read images from the CIFAR-10 binary data files.
@@ -143,7 +143,7 @@ processing time. To prevent these operations from slowing down training, we run
them inside 16 separate threads which continuously fill a TensorFlow
[queue](../../api_docs/python/io_ops.md#shuffle_batch).
-### Model Prediction <a class="md-anchor" id="model-prediction"></a>
+### Model Prediction {#model-prediction}
The prediction part of the model is constructed by the `inference()` function
which adds operations to compute the *logits* of the predictions. That part of
@@ -182,7 +182,7 @@ layers of Alex's original model are locally connected and not fully connected.
Try editing the architecture to exactly reproduce the locally connected
architecture in the top layer.
-### Model Training <a class="md-anchor" id="model-training"></a>
+### Model Training {#model-training}
The usual method for training a network to perform N-way classification is
[multinomial logistic regression](https://en.wikipedia.org/wiki/Multinomial_logistic_regression),
@@ -216,7 +216,7 @@ calculating the gradient and updating the learned variables (see
for details). It returns an operation that executes all the calculations
needed to train and update the model for one batch of images.
-## Launching and Training the Model <a class="md-anchor" id="AUTOGENERATED-launching-and-training-the-model"></a>
+## Launching and Training the Model
We have built the model, let's now launch it and run the training operation with
the script `cifar10_train.py`.
@@ -301,7 +301,7 @@ values. See how the scripts use
[`ExponentialMovingAverage`](../../api_docs/python/train.md#ExponentialMovingAverage)
for this purpose.
-## Evaluating a Model <a class="md-anchor" id="evaluating-a-model"></a>
+## Evaluating a Model {#evaluating-a-model}
Let us now evaluate how well the trained model performs on a hold-out data set.
The model is evaluated by the script `cifar10_eval.py`. It constructs the model
@@ -345,7 +345,7 @@ the averaged parameters for the model and verify that the predictive performance
drops.
-## Training a Model Using Multiple GPU Cards <a class="md-anchor" id="AUTOGENERATED-training-a-model-using-multiple-gpu-cards"></a>
+## Training a Model Using Multiple GPU Cards
Modern workstations may contain multiple GPUs for scientific computation.
TensorFlow can leverage this environment to run the training operation
@@ -389,7 +389,7 @@ The GPUs are synchronized in operation. All gradients are accumulated from
the GPUs and averaged (see green box). The model parameters are updated with
the gradients averaged across all model replicas.
-### Placing Variables and Operations on Devices <a class="md-anchor" id="AUTOGENERATED-placing-variables-and-operations-on-devices"></a>
+### Placing Variables and Operations on Devices
Placing operations and variables on devices requires some special
abstractions.
@@ -413,7 +413,7 @@ All variables are pinned to the CPU and accessed via
in order to share them in a multi-GPU version.
See how-to on [Sharing Variables](../../how_tos/variable_scope/index.md).
-### Launching and Training the Model on Multiple GPU cards <a class="md-anchor" id="AUTOGENERATED-launching-and-training-the-model-on-multiple-gpu-cards"></a>
+### Launching and Training the Model on Multiple GPU cards
If you have several GPU cards installed on your machine you can use them to
train the model faster with the `cifar10_multi_gpu_train.py` script. This
@@ -444,7 +444,7 @@ you ask for more.
run on a batch size of 128. Try running `cifar10_multi_gpu_train.py` on 2 GPUs
with a batch size of 64 and compare the training speed.
-## Next Steps <a class="md-anchor" id="AUTOGENERATED-next-steps"></a>
+## Next Steps
[Congratulations!](https://www.youtube.com/watch?v=9bZkp7q19f0) You have
completed the CIFAR-10 tutorial.
diff --git a/tensorflow/g3doc/tutorials/mandelbrot/index.md b/tensorflow/g3doc/tutorials/mandelbrot/index.md
index f1ce882a3e..ee8a95d12b 100755
--- a/tensorflow/g3doc/tutorials/mandelbrot/index.md
+++ b/tensorflow/g3doc/tutorials/mandelbrot/index.md
@@ -1,4 +1,4 @@
-# Mandelbrot Set <a class="md-anchor" id="AUTOGENERATED-mandelbrot-set"></a>
+# Mandelbrot Set
Visualizing the Mandelbrot set doesn't have anything to do with machine
learning, but it makes for a fun example of how one can use TensorFlow for
@@ -8,7 +8,7 @@ elaborate implementation down the line to produce more truly beautiful images.)
Note: This tutorial was originally prepared as an IPython notebook.
-## Basic Setup <a class="md-anchor" id="AUTOGENERATED-basic-setup"></a>
+## Basic Setup
We'll need a few imports to get started.
@@ -43,7 +43,7 @@ def DisplayFractal(a, fmt='jpeg'):
display(Image(data=f.getvalue()))
```
-## Session and Variable Initialization <a class="md-anchor" id="AUTOGENERATED-session-and-variable-initialization"></a>
+## Session and Variable Initialization
For playing around like this, we often use an interactive session, but a regular
session would work as well.
@@ -75,7 +75,7 @@ TensorFlow requires that you explicitly initialize variables before using them.
tf.initialize_all_variables().run()
```
-## Defining and Running the Computation <a class="md-anchor" id="AUTOGENERATED-defining-and-running-the-computation"></a>
+## Defining and Running the Computation
Now we specify more of the computation...
diff --git a/tensorflow/g3doc/tutorials/mnist/beginners/index.md b/tensorflow/g3doc/tutorials/mnist/beginners/index.md
index 95f52dafcb..fc29a47ceb 100644
--- a/tensorflow/g3doc/tutorials/mnist/beginners/index.md
+++ b/tensorflow/g3doc/tutorials/mnist/beginners/index.md
@@ -1,4 +1,4 @@
-# MNIST For ML Beginners <a class="md-anchor" id="AUTOGENERATED-mnist-for-ml-beginners"></a>
+# MNIST For ML Beginners
*This tutorial is intended for readers who are new to both machine learning and
TensorFlow. If you already
@@ -31,7 +31,7 @@ important to understand the ideas behind it: both how TensorFlow works and the
core machine learning concepts. Because of this, we are going to very carefully
work through the code.
-## The MNIST Data <a class="md-anchor" id="AUTOGENERATED-the-mnist-data"></a>
+## The MNIST Data
The MNIST data is hosted on
[Yann LeCun's website](http://yann.lecun.com/exdb/mnist/). For your
@@ -101,7 +101,7 @@ Consequently, `mnist.train.labels` is a
We're now ready to actually make our model!
-## Softmax Regressions <a class="md-anchor" id="AUTOGENERATED-softmax-regressions"></a>
+## Softmax Regressions
We know that every image in MNIST is a digit, whether it's a zero or a nine. We
want to be able to look at an image and give probabilities for it being each
@@ -196,7 +196,7 @@ More compactly, we can just write:
$$y = \text{softmax}(Wx + b)$$
-## Implementing the Regression <a class="md-anchor" id="AUTOGENERATED-implementing-the-regression"></a>
+## Implementing the Regression
To do efficient numerical computing in Python, we typically use libraries like
@@ -276,7 +276,7 @@ simulations. And once defined, our model can be run on different devices:
your computer's CPU, GPUs, and even phones!
-## Training <a class="md-anchor" id="AUTOGENERATED-training"></a>
+## Training
In order to train our model, we need to define what it means for the model to
be good. Well, actually, in machine learning we typically define what it means
@@ -380,7 +380,7 @@ every time. Doing this is cheap and has much of the same benefit.
-## Evaluating Our Model <a class="md-anchor" id="AUTOGENERATED-evaluating-our-model"></a>
+## Evaluating Our Model
How well does our model do?
diff --git a/tensorflow/g3doc/tutorials/mnist/download/index.md b/tensorflow/g3doc/tutorials/mnist/download/index.md
index 5217b7f531..70e6e37ef6 100644
--- a/tensorflow/g3doc/tutorials/mnist/download/index.md
+++ b/tensorflow/g3doc/tutorials/mnist/download/index.md
@@ -1,11 +1,11 @@
-# MNIST Data Download <a class="md-anchor" id="AUTOGENERATED-mnist-data-download"></a>
+# MNIST Data Download
Code: [tensorflow/g3doc/tutorials/mnist/](https://tensorflow.googlesource.com/tensorflow/+/master/tensorflow/g3doc/tutorials/mnist/)
The goal of this tutorial is to show how to download the dataset files required
for handwritten digit classification using the (classic) MNIST data set.
-## Tutorial Files <a class="md-anchor" id="AUTOGENERATED-tutorial-files"></a>
+## Tutorial Files
This tutorial references the following files:
@@ -13,7 +13,7 @@ File | Purpose
--- | ---
[`input_data.py`](https://tensorflow.googlesource.com/tensorflow/+/master/tensorflow/g3doc/tutorials/mnist/input_data.py) | The code to download the MNIST dataset for training and evaluation.
-## Prepare the Data <a class="md-anchor" id="AUTOGENERATED-prepare-the-data"></a>
+## Prepare the Data
MNIST is a classic problem in machine learning. The problem is to look at
greyscale 28x28 pixel images of handwritten digits and determine which digit
@@ -24,7 +24,7 @@ the image represents, for all the digits from zero to nine.
For more information, refer to [Yann LeCun's MNIST page](http://yann.lecun.com/exdb/mnist/)
or [Chris Olah's visualizations of MNIST](http://colah.github.io/posts/2014-10-Visualizing-MNIST/).
-### Download <a class="md-anchor" id="AUTOGENERATED-download"></a>
+### Download
[Yann LeCun's MNIST page](http://yann.lecun.com/exdb/mnist/)
also hosts the training and test data for download.
@@ -42,7 +42,7 @@ files are downloaded into a local data folder for training.
The folder name is specified in a flag variable at the top of the
`fully_connected_feed.py` file and may be changed to fit your needs.
-### Unpack and Reshape <a class="md-anchor" id="AUTOGENERATED-unpack-and-reshape"></a>
+### Unpack and Reshape
The files themselves are not in any standard image format and are manually
unpacked (following the instructions available at the website) by the
@@ -64,7 +64,7 @@ The label data is extracted into a 1d tensor of: `[image index]`
with the class identifier for each example as the value. For the training set
labels, this would then be of shape `[55000]`.
-### DataSet Object <a class="md-anchor" id="AUTOGENERATED-dataset-object"></a>
+### DataSet Object
The underlying code will download, unpack, and reshape images and labels for
the following datasets:
diff --git a/tensorflow/g3doc/tutorials/mnist/pros/index.md b/tensorflow/g3doc/tutorials/mnist/pros/index.md
index 58cec4c348..6df9e430a3 100644
--- a/tensorflow/g3doc/tutorials/mnist/pros/index.md
+++ b/tensorflow/g3doc/tutorials/mnist/pros/index.md
@@ -1,4 +1,4 @@
-# Deep MNIST for Experts <a class="md-anchor" id="AUTOGENERATED-deep-mnist-for-experts"></a>
+# Deep MNIST for Experts
TensorFlow is a powerful library for doing large-scale numerical computation.
One of the tasks at which it excels is implementing and training deep neural
@@ -11,12 +11,12 @@ dataset. If you don't have
a background with them, check out the
[introduction for beginners](../../../tutorials/mnist/beginners/index.md).*
-## Setup <a class="md-anchor" id="AUTOGENERATED-setup"></a>
+## Setup
Before we create our model, we will first load the MNIST dataset, and start a
TensorFlow session.
-### Load MNIST Data <a class="md-anchor" id="AUTOGENERATED-load-mnist-data"></a>
+### Load MNIST Data
For your convenience, we've included
[a script](https://tensorflow.googlesource.com/tensorflow/+/master/tensorflow/g3doc/tutorials/mnist/input_data.py)
@@ -33,7 +33,7 @@ testing sets as NumPy arrays.
It also provides a function for iterating through data minibatches, which we
will use below.
-### Start TensorFlow InteractiveSession <a class="md-anchor" id="AUTOGENERATED-start-tensorflow-interactivesession"></a>
+### Start TensorFlow InteractiveSession
Tensorflow relies on a highly efficient C++ backend to do its computation. The
connection to this backend is called a session. The common usage for TensorFlow
@@ -56,7 +56,7 @@ import tensorflow as tf
sess = tf.InteractiveSession()
```
-#### Computation Graph <a class="md-anchor" id="AUTOGENERATED-computation-graph"></a>
+#### Computation Graph
To do efficient numerical computing in Python, we typically use libraries like
NumPy that do expensive operations such as matrix multiplication outside Python,
@@ -81,13 +81,13 @@ section of
[Basic Usage](../../../get_started/basic_usage.md)
for more detail.
-## Build a Softmax Regression Model <a class="md-anchor" id="AUTOGENERATED-build-a-softmax-regression-model"></a>
+## Build a Softmax Regression Model
In this section we will build a softmax regression model with a single linear
layer. In the next section, we will extend this to the case of softmax
regression with a multilayer convolutional network.
-### Placeholders <a class="md-anchor" id="AUTOGENERATED-placeholders"></a>
+### Placeholders
We start building the computation graph by creating nodes for the
input images and target output classes.
@@ -111,7 +111,7 @@ which digit class the corresponding MNIST image belongs to.
The `shape` argument to `placeholder` is optional, but it allows TensorFlow
to automatically catch bugs stemming from inconsistent tensor shapes.
-### Variables <a class="md-anchor" id="AUTOGENERATED-variables"></a>
+### Variables
We now define the weights `W` and biases `b` for our model. We could imagine treating
these like additional inputs, but TensorFlow has an even better way to handle
@@ -140,7 +140,7 @@ done for all `Variables` at once.
sess.run(tf.initialize_all_variables())
```
-### Predicted Class and Cost Function <a class="md-anchor" id="AUTOGENERATED-predicted-class-and-cost-function"></a>
+### Predicted Class and Cost Function
We can now implement our regression model. It only takes one line!
We multiply the vectorized input images `x` by the weight matrix `W`, add
@@ -162,7 +162,7 @@ cross_entropy = -tf.reduce_sum(y_*tf.log(y))
Note that `tf.reduce_sum` sums across all images in the minibatch, as well as
all classes. We are computing the cross entropy for the entire minibatch.
-## Train the Model <a class="md-anchor" id="AUTOGENERATED-train-the-model"></a>
+## Train the Model
Now that we have defined our model and training cost function, it is
straightforward to train using TensorFlow.
@@ -199,7 +199,7 @@ Each training iteration we load 50 training examples. We then run the
Note that you can replace any tensor in your computation graph using `feed_dict`
-- it's not restricted to just `placeholder`s.
-### Evaluate the Model <a class="md-anchor" id="AUTOGENERATED-evaluate-the-model"></a>
+### Evaluate the Model
How well did our model do?
@@ -229,14 +229,14 @@ Finally, we can evaluate our accuracy on the test data. This should be about
print accuracy.eval(feed_dict={x: mnist.test.images, y_: mnist.test.labels})
```
-## Build a Multilayer Convolutional Network <a class="md-anchor" id="AUTOGENERATED-build-a-multilayer-convolutional-network"></a>
+## Build a Multilayer Convolutional Network
Getting 91% accuracy on MNIST is bad. It's almost embarrassingly bad. In this
section, we'll fix that, jumping from a very simple model to something
moderately sophisticated: a small convolutional neural network. This will get us
to around 99.2% accuracy -- not state of the art, but respectable.
-### Weight Initialization <a class="md-anchor" id="AUTOGENERATED-weight-initialization"></a>
+### Weight Initialization
To create this model, we're going to need to create a lot of weights and biases.
One should generally initialize weights with a small amount of noise for
@@ -255,7 +255,7 @@ def bias_variable(shape):
return tf.Variable(initial)
```
-### Convolution and Pooling <a class="md-anchor" id="AUTOGENERATED-convolution-and-pooling"></a>
+### Convolution and Pooling
TensorFlow also gives us a lot of flexibility in convolution and pooling
operations. How do we handle the boundaries? What is our stride size?
@@ -274,7 +274,7 @@ def max_pool_2x2(x):
strides=[1, 2, 2, 1], padding='SAME')
```
-### First Convolutional Layer <a class="md-anchor" id="AUTOGENERATED-first-convolutional-layer"></a>
+### First Convolutional Layer
We can now implement our first layer. It will consist of convolution, followed
by max pooling. The convolutional will compute 32 features for each 5x5 patch.
@@ -304,7 +304,7 @@ h_conv1 = tf.nn.relu(conv2d(x_image, W_conv1) + b_conv1)
h_pool1 = max_pool_2x2(h_conv1)
```
-### Second Convolutional Layer <a class="md-anchor" id="AUTOGENERATED-second-convolutional-layer"></a>
+### Second Convolutional Layer
In order to build a deep network, we stack several layers of this type. The
second layer will have 64 features for each 5x5 patch.
@@ -317,7 +317,7 @@ h_conv2 = tf.nn.relu(conv2d(h_pool1, W_conv2) + b_conv2)
h_pool2 = max_pool_2x2(h_conv2)
```
-### Densely Connected Layer <a class="md-anchor" id="AUTOGENERATED-densely-connected-layer"></a>
+### Densely Connected Layer
Now that the image size has been reduced to 7x7, we add a fully-connected layer
with 1024 neurons to allow processing on the entire image. We reshape the tensor
@@ -332,7 +332,7 @@ h_pool2_flat = tf.reshape(h_pool2, [-1, 7*7*64])
h_fc1 = tf.nn.relu(tf.matmul(h_pool2_flat, W_fc1) + b_fc1)
```
-#### Dropout <a class="md-anchor" id="AUTOGENERATED-dropout"></a>
+#### Dropout
To reduce overfitting, we will apply dropout before the readout layer.
We create a `placeholder` for the probability that a neuron's output is kept
@@ -346,7 +346,7 @@ keep_prob = tf.placeholder("float")
h_fc1_drop = tf.nn.dropout(h_fc1, keep_prob)
```
-### Readout Layer <a class="md-anchor" id="AUTOGENERATED-readout-layer"></a>
+### Readout Layer
Finally, we add a softmax layer, just like for the one layer softmax regression
above.
@@ -358,7 +358,7 @@ b_fc2 = bias_variable([10])
y_conv=tf.nn.softmax(tf.matmul(h_fc1_drop, W_fc2) + b_fc2)
```
-### Train and Evaluate the Model <a class="md-anchor" id="AUTOGENERATED-train-and-evaluate-the-model"></a>
+### Train and Evaluate the Model
How well does this model do?
To train and evaluate it we will use code that is nearly identical to that for
diff --git a/tensorflow/g3doc/tutorials/mnist/tf/index.md b/tensorflow/g3doc/tutorials/mnist/tf/index.md
index 98578acce8..f7cd3b527c 100644
--- a/tensorflow/g3doc/tutorials/mnist/tf/index.md
+++ b/tensorflow/g3doc/tutorials/mnist/tf/index.md
@@ -1,4 +1,4 @@
-# TensorFlow Mechanics 101 <a class="md-anchor" id="AUTOGENERATED-tensorflow-mechanics-101"></a>
+# TensorFlow Mechanics 101
Code: [tensorflow/g3doc/tutorials/mnist/](https://tensorflow.googlesource.com/tensorflow/+/master/tensorflow/g3doc/tutorials/mnist/)
@@ -12,7 +12,7 @@ These tutorials are not intended for teaching Machine Learning in general.
Please ensure you have followed the instructions to [install TensorFlow](../../../get_started/os_setup.md).
-## Tutorial Files <a class="md-anchor" id="AUTOGENERATED-tutorial-files"></a>
+## Tutorial Files
This tutorial references the following files:
@@ -25,7 +25,7 @@ Simply run the `fully_connected_feed.py` file directly to start training:
`python fully_connected_feed.py`
-## Prepare the Data <a class="md-anchor" id="AUTOGENERATED-prepare-the-data"></a>
+## Prepare the Data
MNIST is a classic problem in machine learning. The problem is to look at
greyscale 28x28 pixel images of handwritten digits and determine which digit
@@ -36,7 +36,7 @@ the image represents, for all the digits from zero to nine.
For more information, refer to [Yann LeCun's MNIST page](http://yann.lecun.com/exdb/mnist/)
or [Chris Olah's visualizations of MNIST](http://colah.github.io/posts/2014-10-Visualizing-MNIST/).
-### Download <a class="md-anchor" id="AUTOGENERATED-download"></a>
+### Download
At the top of the `run_training()` method, the `input_data.read_data_sets()`
function will ensure that the correct data has been downloaded to your local
@@ -59,7 +59,7 @@ Dataset | Purpose
For more information about the data, please read the [Download](../../../tutorials/mnist/download/index.md)
tutorial.
-### Inputs and Placeholders <a class="md-anchor" id="AUTOGENERATED-inputs-and-placeholders"></a>
+### Inputs and Placeholders
The `placeholder_inputs()` function creates two [`tf.placeholder`](../../../api_docs/python/io_ops.md#placeholder)
ops that define the shape of the inputs, including the `batch_size`, to the
@@ -76,7 +76,7 @@ sliced to fit the `batch_size` for each step, matched with these placeholder
ops, and then passed into the `sess.run()` function using the `feed_dict`
parameter.
-## Build the Graph <a class="md-anchor" id="AUTOGENERATED-build-the-graph"></a>
+## Build the Graph
After creating placeholders for the data, the graph is built from the
`mnist.py` file according to a 3-stage pattern: `inference()`, `loss()`, and
@@ -93,7 +93,7 @@ and apply gradients.
<img style="width:100%" src="./mnist_subgraph.png">
</div>
-### Inference <a class="md-anchor" id="AUTOGENERATED-inference"></a>
+### Inference
The `inference()` function builds the graph as far as needed to
return the tensor that would contain the output predictions.
@@ -162,7 +162,7 @@ logits = tf.matmul(hidden2, weights) + biases
Finally, the `logits` tensor that will contain the output is returned.
-### Loss <a class="md-anchor" id="AUTOGENERATED-loss"></a>
+### Loss
The `loss()` function further builds the graph by adding the required loss
ops.
@@ -205,7 +205,7 @@ And the tensor that will then contain the loss value is returned.
> given what is actually true. For more information, read the blog post Visual
> Information Theory (http://colah.github.io/posts/2015-09-Visual-Information/)
-### Training <a class="md-anchor" id="AUTOGENERATED-training"></a>
+### Training
The `training()` function adds the operations needed to minimize the loss via
gradient descent.
@@ -241,12 +241,12 @@ train_op = optimizer.minimize(loss, global_step=global_step)
The tensor containing the outputs of the training op is returned.
-## Train the Model <a class="md-anchor" id="AUTOGENERATED-train-the-model"></a>
+## Train the Model
Once the graph is built, it can be iteratively trained and evaluated in a loop
controlled by the user code in `fully_connected_feed.py`.
-### The Graph <a class="md-anchor" id="AUTOGENERATED-the-graph"></a>
+### The Graph
At the top of the `run_training()` function is a python `with` command that
indicates all of the built ops are to be associated with the default
@@ -263,7 +263,7 @@ Most TensorFlow uses will only need to rely on the single default graph.
More complicated uses with multiple graphs are possible, but beyond the scope of
this simple tutorial.
-### The Session <a class="md-anchor" id="AUTOGENERATED-the-session"></a>
+### The Session
Once all of the build preparation has been completed and all of the necessary
ops generated, a [`tf.Session`](../../../api_docs/python/client.md#Session)
@@ -298,7 +298,7 @@ op is a [`tf.group`](../../../api_docs/python/control_flow_ops.md#group)
that contains only the initializers for the variables. None of the rest of the
graph is run here; that happens in the training loop below.
-### Train Loop <a class="md-anchor" id="AUTOGENERATED-train-loop"></a>
+### Train Loop
After initializing the variables with the session, training may begin.
@@ -313,7 +313,7 @@ for step in xrange(max_steps):
However, this tutorial is slightly more complicated in that it must also slice
up the input data for each step to match the previously generated placeholders.
-#### Feed the Graph <a class="md-anchor" id="AUTOGENERATED-feed-the-graph"></a>
+#### Feed the Graph
For each step, the code will generate a feed dictionary that will contain the
set of examples on which to train for the step, keyed by the placeholder
@@ -340,7 +340,7 @@ feed_dict = {
This is passed into the `sess.run()` function's `feed_dict` parameter to provide
the input examples for this step of training.
-#### Check the Status <a class="md-anchor" id="AUTOGENERATED-check-the-status"></a>
+#### Check the Status
The code specifies two values to fetch in its run call: `[train_op, loss]`.
@@ -370,7 +370,7 @@ if step % 100 == 0:
print 'Step %d: loss = %.2f (%.3f sec)' % (step, loss_value, duration)
```
-#### Visualize the Status <a class="md-anchor" id="AUTOGENERATED-visualize-the-status"></a>
+#### Visualize the Status
In order to emit the events files used by [TensorBoard](../../../how_tos/summaries_and_tensorboard/index.md),
all of the summaries (in this case, only one) are collected into a single op
@@ -405,7 +405,7 @@ folder to display the values from the summaries.
**NOTE**: For more info about how to build and run Tensorboard, please see the accompanying tutorial [Tensorboard: Visualizing Your Training](../../../how_tos/summaries_and_tensorboard/index.md).
-#### Save a Checkpoint <a class="md-anchor" id="AUTOGENERATED-save-a-checkpoint"></a>
+#### Save a Checkpoint
In order to emit a checkpoint file that may be used to later restore a model
for further training or evaluation, we instantiate a
@@ -431,7 +431,7 @@ method to reload the model parameters.
saver.restore(sess, FLAGS.train_dir)
```
-## Evaluate the Model <a class="md-anchor" id="AUTOGENERATED-evaluate-the-model"></a>
+## Evaluate the Model
Every thousand steps, the code will attempt to evaluate the model against both
the training and test datasets. The `do_eval()` function is called thrice, for
@@ -463,7 +463,7 @@ do_eval(sess,
> the sake of a simple little MNIST problem, however, we evaluate against all of
> the data.
-### Build the Eval Graph <a class="md-anchor" id="AUTOGENERATED-build-the-eval-graph"></a>
+### Build the Eval Graph
Before opening the default Graph, the test data should have been fetched by
calling the `get_data(train=False)` function with the parameter set to grab
@@ -490,7 +490,7 @@ of K to 1 to only consider a prediction correct if it is for the true label.
eval_correct = tf.nn.in_top_k(logits, labels, 1)
```
-### Eval Output <a class="md-anchor" id="AUTOGENERATED-eval-output"></a>
+### Eval Output
One can then create a loop for filling a `feed_dict` and calling `sess.run()`
against the `eval_correct` op to evaluate the model on the given dataset.
diff --git a/tensorflow/g3doc/tutorials/pdes/index.md b/tensorflow/g3doc/tutorials/pdes/index.md
index 5dbb758da6..ca6f84985e 100755
--- a/tensorflow/g3doc/tutorials/pdes/index.md
+++ b/tensorflow/g3doc/tutorials/pdes/index.md
@@ -1,4 +1,4 @@
-# Partial Differential Equations <a class="md-anchor" id="AUTOGENERATED-partial-differential-equations"></a>
+# Partial Differential Equations
TensorFlow isn't just for machine learning. Here we give a (somewhat
pedestrian) example of using TensorFlow for simulating the behavior of a
@@ -7,7 +7,7 @@ few raindrops land on it.
Note: This tutorial was originally prepared as an IPython notebook.
-## Basic Setup <a class="md-anchor" id="AUTOGENERATED-basic-setup"></a>
+## Basic Setup
A few imports we'll need.
@@ -42,7 +42,7 @@ executable .py file.
sess = tf.InteractiveSession()
```
-## Computational Convenience Functions <a class="md-anchor" id="AUTOGENERATED-computational-convenience-functions"></a>
+## Computational Convenience Functions
```python
@@ -66,7 +66,7 @@ def laplace(x):
return simple_conv(x, laplace_k)
```
-## Define the PDE <a class="md-anchor" id="AUTOGENERATED-define-the-pde"></a>
+## Define the PDE
Our pond is a perfect 500 x 500 square, as is the case for most ponds found in
nature.
@@ -119,7 +119,7 @@ step = tf.group(
Ut.assign(Ut_))
```
-## Run The Simulation <a class="md-anchor" id="AUTOGENERATED-run-the-simulation"></a>
+## Run The Simulation
This is where it gets fun -- running time forward with a simple for loop.
diff --git a/tensorflow/g3doc/tutorials/recurrent/index.md b/tensorflow/g3doc/tutorials/recurrent/index.md
index 510ecd5d66..dfba27a03f 100644
--- a/tensorflow/g3doc/tutorials/recurrent/index.md
+++ b/tensorflow/g3doc/tutorials/recurrent/index.md
@@ -1,12 +1,12 @@
-# Recurrent Neural Networks <a class="md-anchor" id="AUTOGENERATED-recurrent-neural-networks"></a>
+# Recurrent Neural Networks
-## Introduction <a class="md-anchor" id="AUTOGENERATED-introduction"></a>
+## Introduction
Take a look at [this great article]
(http://colah.github.io/posts/2015-08-Understanding-LSTMs/)
for an introduction to recurrent neural networks and LSTMs in particular.
-## Language Modeling <a class="md-anchor" id="AUTOGENERATED-language-modeling"></a>
+## Language Modeling
In this tutorial we will show how to train a recurrent neural network on
a challenging task of language modeling. The goal of the problem is to fit a
@@ -24,7 +24,7 @@ For the purpose of this tutorial, we will reproduce the results from
[Zaremba et al., 2014] (http://arxiv.org/abs/1409.2329), which achieves very
good results on the PTB dataset.
-## Tutorial Files <a class="md-anchor" id="AUTOGENERATED-tutorial-files"></a>
+## Tutorial Files
This tutorial references the following files from `models/rnn/ptb`:
@@ -33,7 +33,7 @@ File | Purpose
`ptb_word_lm.py` | The code to train a language model on the PTB dataset.
`reader.py` | The code to read the dataset.
-## Download and Prepare the Data <a class="md-anchor" id="AUTOGENERATED-download-and-prepare-the-data"></a>
+## Download and Prepare the Data
The data required for this tutorial is in the data/ directory of the
PTB dataset from Tomas Mikolov's webpage:
@@ -44,9 +44,9 @@ including the end-of-sentence marker and a special symbol (\<unk\>) for rare
words. We convert all of them in the `reader.py` to unique integer identifiers
to make it easy for the neural network to process.
-## The Model <a class="md-anchor" id="AUTOGENERATED-the-model"></a>
+## The Model
-### LSTM <a class="md-anchor" id="AUTOGENERATED-lstm"></a>
+### LSTM
The core of the model consists of an LSTM cell that processes one word at the
time and computes probabilities of the possible continuations of the sentence.
@@ -72,7 +72,7 @@ for current_batch_of_words in words_in_dataset:
loss += loss_function(probabilities, target_words)
```
-### Truncated Backpropagation <a class="md-anchor" id="AUTOGENERATED-truncated-backpropagation"></a>
+### Truncated Backpropagation
In order to make the learning process tractable, it is a common practice to
truncate the gradients for backpropagation to a fixed number (`num_steps`)
@@ -114,7 +114,7 @@ for current_batch_of_words in words_in_dataset:
total_loss += current_loss
```
-### Inputs <a class="md-anchor" id="AUTOGENERATED-inputs"></a>
+### Inputs
The word IDs will be embedded into a dense representation (see the
[Vector Representations Tutorial](../../tutorials/word2vec/index.md)) before feeding to
@@ -129,7 +129,7 @@ word_embeddings = tf.nn.embedding_lookup(embedding_matrix, word_ids)
The embedding matrix will be initialized randomly and the model will learn to
differentiate the meaning of words just by looking at the data.
-### Loss Fuction <a class="md-anchor" id="AUTOGENERATED-loss-fuction"></a>
+### Loss Fuction
We want to minimize the average negative log probability of the target words:
@@ -145,7 +145,7 @@ $$e^{-\frac{1}{N}\sum_{i=1}^{N} \ln p_{\text{target}_i}} = e^{\text{loss}} $$
and we will monitor its value throughout the training process.
-### Stacking multiple LSTMs <a class="md-anchor" id="AUTOGENERATED-stacking-multiple-lstms"></a>
+### Stacking multiple LSTMs
To give the model more expressive power, we can add multiple layers of LSTMs
to process the data. The output of the first layer will become the input of
@@ -168,7 +168,7 @@ for i in range(len(num_steps)):
final_state = state
```
-## Compile and Run the Code <a class="md-anchor" id="AUTOGENERATED-compile-and-run-the-code"></a>
+## Compile and Run the Code
First, the library needs to be built. To compile it on CPU:
@@ -197,7 +197,7 @@ The larger the model, the better results it should get. The `small` model should
be able to reach perplexity below 120 on the test set and the `large` one below
80, though it might take several hours to train.
-## What Next? <a class="md-anchor" id="AUTOGENERATED-what-next-"></a>
+## What Next?
There are several tricks that we haven't mentioned that make the model better,
including:
diff --git a/tensorflow/g3doc/tutorials/seq2seq/index.md b/tensorflow/g3doc/tutorials/seq2seq/index.md
index 66c653e1f8..6cbbf6a3bd 100644
--- a/tensorflow/g3doc/tutorials/seq2seq/index.md
+++ b/tensorflow/g3doc/tutorials/seq2seq/index.md
@@ -1,4 +1,4 @@
-# Sequence-to-Sequence Models <a class="md-anchor" id="AUTOGENERATED-sequence-to-sequence-models"></a>
+# Sequence-to-Sequence Models
Recurrent neural networks can learn to model language, as already discussed
in the [RNN Tutorial](../../tutorials/recurrent/index.md)
@@ -32,7 +32,7 @@ File | What's in it?
`translate/translate.py` | Binary that trains and runs the translation model.
-## Sequence-to-Sequence Basics <a class="md-anchor" id="AUTOGENERATED-sequence-to-sequence-basics"></a>
+## Sequence-to-Sequence Basics
A basic sequence-to-sequence model, as introduced in
[Cho et al., 2014](http://arxiv.org/pdf/1406.1078v3.pdf),
@@ -64,7 +64,7 @@ attention mechanism in the decoder looks like this.
<img style="width:100%" src="attention_seq2seq.png" />
</div>
-## TensorFlow seq2seq Library <a class="md-anchor" id="AUTOGENERATED-tensorflow-seq2seq-library"></a>
+## TensorFlow seq2seq Library
As you can see above, there are many different sequence-to-sequence
models. Each of these models can use different RNN cells, but all
@@ -141,14 +141,14 @@ more sequence-to-sequence models in `seq2seq.py`, take a look there. They all
have similar interfaces, so we will not describe them in detail. We will use
`embedding_attention_seq2seq` for our translation model below.
-## Neural Translation Model <a class="md-anchor" id="AUTOGENERATED-neural-translation-model"></a>
+## Neural Translation Model
While the core of the sequence-to-sequence model is constructed by
the functions in `models/rnn/seq2seq.py`, there are still a few tricks
that are worth mentioning that are used in our translation model in
`models/rnn/translate/seq2seq_model.py`.
-### Sampled softmax and output projection <a class="md-anchor" id="AUTOGENERATED-sampled-softmax-and-output-projection"></a>
+### Sampled softmax and output projection
For one, as already mentioned above, we want to use sampled softmax to
handle large output vocabulary. To decode from it, we need to keep track
@@ -184,7 +184,7 @@ if output_projection is not None:
output_projection[1] for ...]
```
-### Bucketing and padding <a class="md-anchor" id="AUTOGENERATED-bucketing-and-padding"></a>
+### Bucketing and padding
In addition to sampled softmax, our translation model also makes use
of *bucketing*, which is a method to efficiently handle sentences of
@@ -230,7 +230,7 @@ with encoder inputs representing `[PAD PAD "." "go" "I"]` and decoder
inputs `[GO "Je" "vais" "." EOS PAD PAD PAD PAD PAD]`.
-## Let's Run It <a class="md-anchor" id="run_it"></a>
+## Let's Run It {#run_it}
To train the model described above, we need to a large English-French corpus.
We will use the *10^9-French-English corpus* from the
@@ -304,7 +304,7 @@ Reading model parameters from /tmp/translate.ckpt-340000
Qui est le président des États-Unis ?
```
-## What Next? <a class="md-anchor" id="AUTOGENERATED-what-next-"></a>
+## What Next?
The example above shows how you can build your own English-to-French
translator, end-to-end. Run it and see how the model performs for yourself.
diff --git a/tensorflow/g3doc/tutorials/word2vec/index.md b/tensorflow/g3doc/tutorials/word2vec/index.md
index a8916d6f6a..c4425bdbef 100644
--- a/tensorflow/g3doc/tutorials/word2vec/index.md
+++ b/tensorflow/g3doc/tutorials/word2vec/index.md
@@ -1,11 +1,11 @@
-# Vector Representations of Words <a class="md-anchor" id="AUTOGENERATED-vector-representations-of-words"></a>
+# Vector Representations of Words
In this tutorial we look at the word2vec model by
[Mikolov et al.](http://papers.nips.cc/paper/5021-distributed-representations-of-words-and-phrases-and-their-compositionality.pdf)
This model is used for learning vector representations of words, called "word
embeddings".
-## Highlights <a class="md-anchor" id="AUTOGENERATED-highlights"></a>
+## Highlights
This tutorial is meant to highlight the interesting, substantive parts of
building a word2vec model in TensorFlow.
@@ -32,7 +32,7 @@ But first, let's look at why we would want to learn word embeddings in the first
place. Feel free to skip this section if you're an Embedding Pro and you'd just
like to get your hands dirty with the details.
-## Motivation: Why Learn Word Embeddings? <a class="md-anchor" id="AUTOGENERATED-motivation--why-learn-word-embeddings-"></a>
+## Motivation: Why Learn Word Embeddings?
Image and audio processing systems work with rich, high-dimensional datasets
encoded as vectors of the individual raw pixel-intensities for image data, or
@@ -90,7 +90,7 @@ pair as a new observation, and this tends to do better when we have larger
datasets. We will focus on the skip-gram model in the rest of this tutorial.
-## Scaling up with Noise-Contrastive Training <a class="md-anchor" id="AUTOGENERATED-scaling-up-with-noise-contrastive-training"></a>
+## Scaling up with Noise-Contrastive Training
Neural probabilistic language models are traditionally trained using the
[maximum likelihood](https://en.wikipedia.org/wiki/Maximum_likelihood) (ML)
@@ -166,7 +166,7 @@ loss, for which TensorFlow has a handy helper function `tf.nn.nce_loss()`.
Let's get an intuitive feel for how this would work in practice!
-## The Skip-gram Model <a class="md-anchor" id="AUTOGENERATED-the-skip-gram-model"></a>
+## The Skip-gram Model
As an example, let's consider the dataset
@@ -243,7 +243,7 @@ NLP prediction tasks, such as part-of-speech tagging or named entity recognition
But for now, let's just use them to draw pretty pictures!
-## Building the Graph <a class="md-anchor" id="AUTOGENERATED-building-the-graph"></a>
+## Building the Graph
This is all about embeddings, so let's define our embedding matrix.
This is just a big random matrix to start. We'll initialize the values to be
@@ -307,7 +307,7 @@ gradient descent, and TensorFlow has handy helpers to make this easy as well.
optimizer = tf.train.GradientDescentOptimizer(learning_rate=1.0).minimize(loss)
```
-## Training the Model <a class="md-anchor" id="AUTOGENERATED-training-the-model"></a>
+## Training the Model
Training the model is then as simple as using a `feed_dict` to push data into
the placeholders and calling
@@ -323,7 +323,7 @@ for inputs, labels in generate_batch(...):
See the full example code in
[tensorflow/g3doc/tutorials/word2vec/word2vec_basic.py](./word2vec_basic.py).
-## Visualizing the Learned Embeddings <a class="md-anchor" id="AUTOGENERATED-visualizing-the-learned-embeddings"></a>
+## Visualizing the Learned Embeddings
After training has finished we can visualize the learned embeddings using
t-SNE.
@@ -337,7 +337,7 @@ other. For a more heavyweight implementation of word2vec that showcases more of
the advanced features of TensorFlow, see the implementation in
[tensorflow/models/embedding/word2vec.py](https://tensorflow.googlesource.com/tensorflow/+/master/tensorflow/models/embedding/word2vec.py).
-## Evaluating Embeddings: Analogical Reasoning <a class="md-anchor" id="AUTOGENERATED-evaluating-embeddings--analogical-reasoning"></a>
+## Evaluating Embeddings: Analogical Reasoning
Embeddings are useful for a wide variety of prediction tasks in NLP. Short of
training a full-blown part-of-speech model or named-entity model, one simple way
@@ -358,7 +358,7 @@ very large dataset, carefully tuning the hyperparameters and making use of
tricks like subsampling the data, which is out of the scope of this tutorial.
-## Optimizing the Implementation <a class="md-anchor" id="AUTOGENERATED-optimizing-the-implementation"></a>
+## Optimizing the Implementation
Our vanilla implementation showcases the flexibility of TensorFlow. For
example, changing the training objective is as simple as swapping out the call
@@ -388,7 +388,7 @@ example of this for the Skip-Gram case
Feel free to benchmark these against each other to measure performance
improvements at each stage.
-## Conclusion <a class="md-anchor" id="AUTOGENERATED-conclusion"></a>
+## Conclusion
In this tutorial we covered the word2vec model, a computationally efficient
model for learning word embeddings. We motivated why embeddings are useful,
diff --git a/tensorflow/python/kernel_tests/control_flow_ops_py_test.py b/tensorflow/python/kernel_tests/control_flow_ops_py_test.py
index e293dea581..37491a2c72 100644
--- a/tensorflow/python/kernel_tests/control_flow_ops_py_test.py
+++ b/tensorflow/python/kernel_tests/control_flow_ops_py_test.py
@@ -687,6 +687,29 @@ class ControlFlowTest(tf.test.TestCase):
self._testWhile_Gpu_1(use_gpu=False)
self._testWhile_Gpu_1(use_gpu=True)
+ def _testWhileNested_1(self, use_gpu):
+ with self.test_session(use_gpu=use_gpu):
+ n = tf.constant(0)
+ def cpu_sum(s):
+ c = lambda i, s: tf.less(i, 10)
+ def b(i, s):
+ i1 = tf.add(i, 1)
+ with tf.device("/cpu:0"):
+ s1 = tf.add(i, s)
+ return i1, s1
+ _, r_s = control_flow_ops.While(c, b, [n, s])
+ return r_s
+ c = lambda x: tf.less(x, 200)
+ b = lambda x: tf.add(x, cpu_sum(n))
+ r = control_flow_ops.While(c, b, [n])
+
+ result = r.eval()
+ self.assertEqual(225, result)
+
+ def testWhileNested_1(self):
+ self._testWhileNested_1(use_gpu=False)
+ self._testWhileNested_1(use_gpu=True)
+
def testWhileWithControl_1(self):
with self.test_session():
n = tf.constant(0)
diff --git a/tensorflow/python/kernel_tests/in_topk_op_test.py b/tensorflow/python/kernel_tests/in_topk_op_test.py
index c27cfd34f8..a0c5194eb0 100644
--- a/tensorflow/python/kernel_tests/in_topk_op_test.py
+++ b/tensorflow/python/kernel_tests/in_topk_op_test.py
@@ -35,6 +35,11 @@ class InTopKTest(tf.test.TestCase):
target = [2, 3]
self._validateInTopK(predictions, target, 2, [True, True])
+ def testInTop2_int64Target(self):
+ predictions = [[0.1, 0.3, 0.2, 0.4], [0.1, 0.2, 0.3, 0.4]]
+ target = np.asarray([0, 2]).astype(np.int64)
+ self._validateInTopK(predictions, target, 2, [False, True])
+
if __name__ == "__main__":
tf.test.main()
diff --git a/tensorflow/python/kernel_tests/linalg_grad_test.py b/tensorflow/python/kernel_tests/linalg_grad_test.py
index 2ec3ebe938..b085ea98d1 100644
--- a/tensorflow/python/kernel_tests/linalg_grad_test.py
+++ b/tensorflow/python/kernel_tests/linalg_grad_test.py
@@ -14,33 +14,76 @@ from tensorflow.python.kernel_tests import gradient_checker as gc
class MatrixInverseGradientTest(tf.test.TestCase):
pass # Filled in below
-def _GetMatrixInverseGradientTest(dtype, shape):
+
+def _GetMatrixInverseGradientTest(dtype_, shape_):
+
def Test(self):
with self.test_session():
np.random.seed(1)
- m = np.random.uniform(low=1.0, high=100.0, size=np.prod(shape)).reshape(
- shape).astype(dtype)
+ m = np.random.uniform(low=1.0,
+ high=100.0,
+ size=np.prod(shape_)).reshape(shape_).astype(dtype_)
a = tf.constant(m)
- epsilon = np.finfo(dtype).eps
+ epsilon = np.finfo(dtype_).eps
# Optimal stepsize for central difference is O(epsilon^{1/3}).
- delta = epsilon ** (1.0 / 3.0)
+ delta = epsilon**(1.0 / 3.0)
tol = 1e-3
- if len(shape) == 2:
+ if len(shape_) == 2:
ainv = tf.matrix_inverse(a)
else:
ainv = tf.batch_matrix_inverse(a)
- theoretical, numerical = gc.ComputeGradient(a, shape, ainv, shape,
+ theoretical, numerical = gc.ComputeGradient(a,
+ shape_,
+ ainv,
+ shape_,
delta=delta)
self.assertAllClose(theoretical, numerical, atol=tol, rtol=tol)
+
return Test
-if __name__ == "__main__":
+class MatrixDeterminantGradientTest(tf.test.TestCase):
+ pass # Filled in below
+
+
+def _GetMatrixDeterminantGradientTest(dtype_, shape_):
+
+ def Test(self):
+ with self.test_session():
+ np.random.seed(1)
+ m = np.random.uniform(low=1.0,
+ high=100.0,
+ size=np.prod(shape_)).reshape(shape_).astype(dtype_)
+ a = tf.constant(m)
+ epsilon = np.finfo(dtype_).eps
+ # Optimal stepsize for central difference is O(epsilon^{1/3}).
+ delta = epsilon**(1.0 / 3.0)
+
+ # tolerance obtained by looking at actual differences using
+ # np.linalg.norm(theoretical-numerical, np.inf) on -mavx build
+
+ tol = 1e-3
+
+ if len(shape_) == 2:
+ c = tf.matrix_determinant(a)
+ else:
+ c = tf.batch_matrix_determinant(a)
+
+ out_shape = shape_[:-2] # last two dimensions hold matrices
+ theoretical, numerical = gc.ComputeGradient(a, shape_, c, out_shape,
+ delta=delta)
+
+ self.assertAllClose(theoretical, numerical, atol=tol, rtol=tol)
+
+ return Test
+
+
+if __name__ == '__main__':
# TODO(rmlarsen,irving): Reenable float32 once tolerances are fixed
# The test used to loop over (np.float, np.double), both of which are float64.
- for dtype in np.float64,:
+ for dtype in (np.float64,):
for size in 2, 3, 5, 10:
# We skip the rank 4, size 10 case: it is slow and conceptually covered
# by the other cases.
@@ -49,4 +92,14 @@ if __name__ == "__main__":
name = '%s_%s' % (dtype.__name__, '_'.join(map(str, shape)))
setattr(MatrixInverseGradientTest, 'testMatrixInverseGradient_' + name,
_GetMatrixInverseGradientTest(dtype, shape))
+
+ for dtype in (np.float64,):
+ for size in 2, 5, 10:
+ # increase this list to check batch version
+ for extra in [()]:
+ shape = extra+(size, size)
+ name = '%s_%s' % (dtype.__name__, '_'.join(map(str, shape)))
+ setattr(MatrixDeterminantGradientTest,
+ 'testMatrixDeterminantGradient_' + name,
+ _GetMatrixDeterminantGradientTest(dtype, shape))
tf.test.main()
diff --git a/tensorflow/python/ops/control_flow_ops.py b/tensorflow/python/ops/control_flow_ops.py
index fe7c73bd31..2c1c0c85e7 100644
--- a/tensorflow/python/ops/control_flow_ops.py
+++ b/tensorflow/python/ops/control_flow_ops.py
@@ -47,6 +47,7 @@ debug your graph.
@@Assert
@@Print
"""
+# pylint: disable=g-bad-name
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
@@ -342,26 +343,18 @@ class ControlFlowOpWrapper(object):
return self._op.device
@property
- def output_types(self):
- return self._op.output_types
-
- @property
- def input_types(self):
- return self._op._input_types
-
- @property
def type(self):
"""Returns the type of the op."""
return self._op.type
@property
def graph(self):
- """Returns the parent graph."""
+ """The `Graph` that contains this operation."""
return self._op.graph
- def GetAttr(self, attr_name):
- """Returns the value of attribute 'attr_name' of NodeDef."""
- return self._op.get_attr(attr_name)
+ def get_attr(self, name):
+ """Returns the value of the attr of this op with the given `name`."""
+ return self._op.get_attr(name)
def _get_control_flow_context(self):
return self._op._get_control_flow_context()
@@ -625,7 +618,7 @@ def cond(pred, fn1, fn2, name=None):
# r is set to f1()
```
"""
- with ops.op_scope([pred], name, "Cond") as name:
+ with ops.op_scope([pred], name, "cond") as name:
if not callable(fn1):
raise TypeError("fn1 must be callable.")
if not callable(fn2):
@@ -1316,7 +1309,7 @@ def fold(fn, elems, elem_shape, name=None):
Raises:
TypeError: if `fn` is not callable.
"""
- with ops.op_scope([elems], name, "Fold") as name:
+ with ops.op_scope([elems], name, "fold") as name:
if not callable(fn):
raise TypeError("fn must be callable.")
@@ -1340,8 +1333,8 @@ def fold(fn, elems, elem_shape, name=None):
return r[1]
-def case(pred_fn_pairs, default, exclusive=False, name="Case"):
- """Create a Case operation.
+def case(pred_fn_pairs, default, exclusive=False, name="case"):
+ """Create a case operation.
The `pred_fn_pairs` parameter is a dict or list of pairs of size N.
Each pair contains a boolean scalar tensor and a python callable that
@@ -1366,9 +1359,9 @@ def case(pred_fn_pairs, default, exclusive=False, name="Case"):
Expressions:
```
- f1 = lambda: Constant(17)
- f2 = lambda: Constant(23)
- r = Case([(math_ops.less(x, y), f1)], default=f2)
+ f1 = lambda: tf.onstant(17)
+ f2 = lambda: tf.constant(23)
+ r = case([(tf.less(x, y), f1)], default=f2)
```
Example 2:
@@ -1382,10 +1375,10 @@ def case(pred_fn_pairs, default, exclusive=False, name="Case"):
Expressions:
```
- def f1(): return Constant(17)
- def f2(): return Constant(23)
- def f3(): return Constant(-1)
- r = Case({math_ops.less(x, y): f1, math_ops.greater(x, z): f2},
+ def f1(): return tf.constant(17)
+ def f2(): return tf.constant(23)
+ def f3(): return tf.constant(-1)
+ r = case({tf.less(x, y): f1, tf.greater(x, z): f2},
default=f3, exclusive=True)
```
@@ -1428,7 +1421,7 @@ def case(pred_fn_pairs, default, exclusive=False, name="Case"):
raise TypeError("default must be callable.")
preds, fns = map(list, zip(*pfp))
- with ops.op_scope([[f() for f in fns] + preds + [default()]], name, "Case"):
+ with ops.op_scope([[f() for f in fns] + preds + [default()]], name, "case"):
if not preds:
return default()
not_preds = []
@@ -1451,10 +1444,10 @@ def case(pred_fn_pairs, default, exclusive=False, name="Case"):
with ops.name_scope("case_%d" % i):
case_preds.append(math_ops.logical_and(p, and_not_p_prev))
- # case_sequence = [Cond(p3 & ..., f3, default),
- # Cond(p2 & ..., f2, lambda: case_sequence[0]),
+ # case_sequence = [cond(p3 & ..., f3, default),
+ # cond(p2 & ..., f2, lambda: case_sequence[0]),
# ...
- # Cond(p1 & True, f1, lambda: case_sequence[i-1])]
+ # cond(p1 & True, f1, lambda: case_sequence[i-1])]
# and prev_case_seq will loop from case_sequence[0] to case_sequence[-1]
if exclusive:
# TODO(ebrevdo): Add Where() for DT_BOOL, replace with Size(Where(preds))
diff --git a/tensorflow/python/ops/linalg_grad.py b/tensorflow/python/ops/linalg_grad.py
index 90de52887b..18cf83b785 100644
--- a/tensorflow/python/ops/linalg_grad.py
+++ b/tensorflow/python/ops/linalg_grad.py
@@ -1,4 +1,10 @@
-"""Gradients for operators defined in linalg_ops.py."""
+"""Gradients for operators defined in linalg_ops.py.
+
+Useful reference for derivative formulas is
+An extended collection of matrix derivative results for forward and reverse
+mode algorithmic differentiation by Mike Giles:
+http://eprints.maths.ox.ac.uk/1079/1/NA-08-01.pdf
+"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
@@ -10,20 +16,40 @@ from tensorflow.python.ops import constant_op
from tensorflow.python.ops import linalg_ops
from tensorflow.python.ops import math_ops
+
@ops.RegisterGradient("MatrixInverse")
def _MatrixInverseGrad(op, grad):
"""Gradient for MatrixInverse."""
ainv = op.outputs[0]
- return -math_ops.matmul(
- ainv,
- math_ops.matmul(grad, ainv, transpose_b=True),
- transpose_a=True)
+ return -math_ops.matmul(ainv,
+ math_ops.matmul(grad,
+ ainv,
+ transpose_b=True),
+ transpose_a=True)
+
@ops.RegisterGradient("BatchMatrixInverse")
def _BatchMatrixInverseGrad(op, grad):
"""Gradient for BatchMatrixInverse."""
ainv = op.outputs[0]
- return -math_ops.batch_matmul(
- ainv,
- math_ops.batch_matmul(grad, ainv, adj_y=True),
- adj_x=True)
+ return -math_ops.batch_matmul(ainv,
+ math_ops.batch_matmul(grad,
+ ainv,
+ adj_y=True),
+ adj_x=True)
+
+
+@ops.RegisterGradient("MatrixDeterminant")
+def _MatrixDeterminantGrad(op, grad):
+ """Gradient for MatrixDeterminant.
+
+ Returns:
+ gradient
+ Args:
+ op: op
+ grad: grad
+ """
+ a = op.inputs[0]
+ c = op.outputs[0]
+ ainv = linalg_ops.matrix_inverse(a)
+ return grad * c * array_ops.transpose(ainv)
diff --git a/tensorflow/python/ops/summary_ops.py b/tensorflow/python/ops/summary_ops.py
index a2acd80e0d..722424d47b 100644
--- a/tensorflow/python/ops/summary_ops.py
+++ b/tensorflow/python/ops/summary_ops.py
@@ -28,8 +28,8 @@ def histogram_summary(tag, values, collections=None, name=None):
Args:
tag: A `string` `Tensor`. 0-D. Tag to use for the summary value.
- values: A `float32` `Tensor`. Any shape. Values to use to build the
- histogram.
+ values: A `float32` or `float64` `Tensor`. Any shape. Values to use to
+ build the histogram.
collections: Optional list of graph collections keys. The new summary op is
added to these collections. Defaults to `[GraphKeys.SUMMARIES]`.
name: A name for the operation (optional).
diff --git a/tensorflow/python/training/moving_averages.py b/tensorflow/python/training/moving_averages.py
index 50a8f9bbce..b19e9bd86b 100644
--- a/tensorflow/python/training/moving_averages.py
+++ b/tensorflow/python/training/moving_averages.py
@@ -195,13 +195,21 @@ class ExponentialMovingAverage(object):
if var in self._averages:
raise ValueError("Moving average already computed for: %s" % var)
with ops.name_scope(var.op.name + "/" + self._name) as scope:
- with ops.device(var.device):
- if isinstance(var, variables.Variable):
- initial_value = var.initialized_value()
- else:
- initial_value = array_ops.zeros(var.get_shape().as_list())
- avg = variables.Variable(initial_value, name=scope, trainable=False)
- self._averages[var] = avg
+ # For variables: to lower communication bandwidth across devices we keep
+ # the moving averages on the same device as the variables. For other
+ # tensors, we rely on the existing device allocation mechanism.
+ if isinstance(var, variables.Variable):
+ with ops.device(var.device):
+ avg = variables.Variable(var.initialized_value(),
+ name=scope, trainable=False)
+ elif var.op.type == "Variable":
+ with ops.device(var.device):
+ avg = variables.Variable(array_ops.zeros(var.get_shape().as_list()),
+ name=scope, trainable=False)
+ else:
+ avg = variables.Variable(array_ops.zeros(var.get_shape().as_list()),
+ name=scope, trainable=False)
+ self._averages[var] = avg
with ops.name_scope(self._name) as scope:
decay = ops.convert_to_tensor(self._decay, name="decay")
if self._num_updates is not None:
diff --git a/tensorflow/python/training/moving_averages_test.py b/tensorflow/python/training/moving_averages_test.py
index 53d524a325..d5de85febd 100644
--- a/tensorflow/python/training/moving_averages_test.py
+++ b/tensorflow/python/training/moving_averages_test.py
@@ -6,9 +6,11 @@ from __future__ import print_function
import tensorflow.python.platform
from six.moves import xrange # pylint: disable=redefined-builtin
+from tensorflow.python.framework import ops
from tensorflow.python.framework import test_util
from tensorflow.python.framework import types
from tensorflow.python.ops import constant_op
+from tensorflow.python.ops import state_ops
from tensorflow.python.ops import variables
from tensorflow.python.platform import googletest
from tensorflow.python.training import moving_averages
@@ -130,6 +132,19 @@ class ExponentialMovingAverageTest(test_util.TensorFlowTestCase):
self.assertEqual(ema.average_name(v1), ema.average(v1).op.name)
self.assertEqual(ema.average_name(tensor2), ema.average(tensor2).op.name)
+ def testAverageVariablesDeviceAssignment(self):
+ with ops.device("dev_v0"):
+ v0 = variables.Variable(10.0, name="v0")
+ with ops.device("dev_v1"):
+ v1 = state_ops.variable_op(shape=[1], dtype=types.float32, name="v1")
+ tensor2 = v0 + v1
+ ema = moving_averages.ExponentialMovingAverage(0.25, name="foo_avg")
+ with ops.device("default"):
+ ema.apply([v0, v1, tensor2])
+ self.assertEqual("dev_v0", ema.average(v0).device)
+ self.assertEqual("dev_v1", ema.average(v1).device)
+ self.assertEqual("default", ema.average(tensor2).device)
+
if __name__ == "__main__":
googletest.main()
diff --git a/tensorflow/tensorboard/bower.json b/tensorflow/tensorboard/bower.json
index a9419c5140..7d9f033d4d 100644
--- a/tensorflow/tensorboard/bower.json
+++ b/tensorflow/tensorboard/bower.json
@@ -43,7 +43,7 @@
},
"devDependencies": {
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
- "web-component-tester": "*"
+ "web-component-tester": "Polymer/web-component-tester"
},
"resolutions": {
"d3": "3.5.6"
diff --git a/tensorflow/tensorboard/components/tf-graph-common/test/graph-test.ts b/tensorflow/tensorboard/components/tf-graph-common/test/graph-test.ts
new file mode 100644
index 0000000000..25ca079d06
--- /dev/null
+++ b/tensorflow/tensorboard/components/tf-graph-common/test/graph-test.ts
@@ -0,0 +1,10 @@
+suite("graph", () => {
+let assert = chai.assert;
+
+test("graphlib exists", () => {
+ assert.isTrue(graphlib != null);
+});
+
+// TODO(bp): write tests.
+
+});
diff --git a/tensorflow/tensorboard/components/tf-graph-common/test/hierarchy-test.ts b/tensorflow/tensorboard/components/tf-graph-common/test/hierarchy-test.ts
new file mode 100644
index 0000000000..25ca079d06
--- /dev/null
+++ b/tensorflow/tensorboard/components/tf-graph-common/test/hierarchy-test.ts
@@ -0,0 +1,10 @@
+suite("graph", () => {
+let assert = chai.assert;
+
+test("graphlib exists", () => {
+ assert.isTrue(graphlib != null);
+});
+
+// TODO(bp): write tests.
+
+});
diff --git a/tensorflow/tensorboard/components/tf-graph-common/test/index.html b/tensorflow/tensorboard/components/tf-graph-common/test/index.html
new file mode 100644
index 0000000000..fddcb2fde4
--- /dev/null
+++ b/tensorflow/tensorboard/components/tf-graph-common/test/index.html
@@ -0,0 +1,15 @@
+<!doctype html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <script src="../../../bower_components/webcomponentsjs/webcomponents-lite.min.js"></script>
+ <script src="../../../bower_components/web-component-tester/browser.js"></script>
+ <link rel="import" href="../tf-graph-common.html">
+</head>
+<body>
+ <script src="parser-test.js"></script>
+ <script src="graph-test.js"></script>
+ <script src="hierarchy-test.js"></script>
+ <script src="layout-test.js"></script>
+</body>
+</html> \ No newline at end of file
diff --git a/tensorflow/tensorboard/components/tf-graph-common/test/layout-test.ts b/tensorflow/tensorboard/components/tf-graph-common/test/layout-test.ts
new file mode 100644
index 0000000000..5977640038
--- /dev/null
+++ b/tensorflow/tensorboard/components/tf-graph-common/test/layout-test.ts
@@ -0,0 +1,10 @@
+suite("layout", () => {
+let assert = chai.assert;
+
+test("dagre exists", () => {
+ assert.isTrue(dagre != null);
+});
+
+// TODO(bp): write tests.
+
+});
diff --git a/tensorflow/tensorboard/components/tf-graph-common/test/parser-test.ts b/tensorflow/tensorboard/components/tf-graph-common/test/parser-test.ts
new file mode 100644
index 0000000000..cbbb58ddc6
--- /dev/null
+++ b/tensorflow/tensorboard/components/tf-graph-common/test/parser-test.ts
@@ -0,0 +1,30 @@
+suite("parser", () => {
+let assert = chai.assert;
+
+test("simple pbtxt", () => {
+ let pbtxt =
+ `node {
+ name: "Q"
+ op: "Input"
+ }
+ node {
+ name: "W"
+ op: "Input"
+ }
+ node {
+ name: "X"
+ op: "MatMul"
+ input: "Q"
+ input: "W"
+ }`;
+ let result = tf.graph.parser.parsePbtxt(pbtxt);
+ assert.isTrue(result != null);
+});
+
+test("d3 exists", () => {
+ assert.isTrue(d3 != null);
+});
+
+// TODO(bp): write tests.
+
+});
diff --git a/tensorflow/tensorboard/components/tf-graph-loader/test/index.html b/tensorflow/tensorboard/components/tf-graph-loader/test/index.html
new file mode 100644
index 0000000000..ba31e22c5b
--- /dev/null
+++ b/tensorflow/tensorboard/components/tf-graph-loader/test/index.html
@@ -0,0 +1,13 @@
+<!doctype html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <script src="../../../bower_components/webcomponentsjs/webcomponents-lite.min.js"></script>
+ <script src="../../../bower_components/web-component-tester/browser.js"></script>
+ <link rel="import" href="../tf-graph-loader.html">
+</head>
+<body>
+ <tf-graph-loader id="loader"></tf-graph-loader>
+ <script src="loader.js"></script>
+</body>
+</html> \ No newline at end of file
diff --git a/tensorflow/tensorboard/components/tf-graph-loader/test/loader.ts b/tensorflow/tensorboard/components/tf-graph-loader/test/loader.ts
new file mode 100644
index 0000000000..b03413a121
--- /dev/null
+++ b/tensorflow/tensorboard/components/tf-graph-loader/test/loader.ts
@@ -0,0 +1,10 @@
+suite("graph loader", () => {
+let assert = chai.assert;
+
+test("loader exists", () => {
+ assert.isTrue(document.getElementById("loader") != null);
+});
+
+// TODO(bp): write tests.
+
+});
diff --git a/tensorflow/tensorboard/gulpfile.js b/tensorflow/tensorboard/gulpfile.js
index 34b567d62a..60186f88ef 100644
--- a/tensorflow/tensorboard/gulpfile.js
+++ b/tensorflow/tensorboard/gulpfile.js
@@ -1,10 +1,10 @@
// Based on the gulpfile provided by angular team
// (https://github.com/angular/ts2dart/blob/master/gulpfile.js)
var gulp = require('gulp');
+var tester = require('web-component-tester').test;
var ts = require('gulp-typescript');
var typescript = require('typescript');
var gutil = require('gulp-util');
-var mochaPhantomJS = require('gulp-mocha-phantomjs');
var tslint = require('gulp-tslint');
var server = require('gulp-server-livereload');
var concat = require('gulp-concat');
@@ -39,9 +39,8 @@ var onError = function(err) {
gulp.task('compile.all', function() {
hasError = false;
- var isComponent = gulpFilter(['components/**/*.js', '!components/**/test/*']);
+ var isComponent = gulpFilter(['components/**/*.js']);
var isApp = gulpFilter(['app/**/*.js']);
- var isTest = gulpFilter(['test/**/*', 'components/**/test/*']);
var srcs = ['components/**/*.ts', 'test/**/*.ts', 'app/**/*.ts',
'typings/**/*.d.ts', 'bower_components/**/*.d.ts'];
@@ -66,12 +65,6 @@ gulp.task('compile.all', function() {
.pipe(isApp)
.pipe(gulp.dest('.')),
- // Send all test code to build/test.js
- tsResult.js
- .pipe(isTest)
- .pipe(concat('test.js'))
- .pipe(gulp.dest('build')),
-
// Create a unified defintions file at build/all.d.ts
tsResult.dts
.pipe(concat('all.d.ts'))
@@ -79,6 +72,17 @@ gulp.task('compile.all', function() {
]);
});
+gulp.task('test', ['tslint-strict', 'compile.all'], function(done) {
+ tester({plugins: {local: {}, sauce: false}}, function(error) {
+ if (error) {
+ // Pretty error for gulp.
+ error = new Error(error.message || error);
+ error.showStack = false;
+ }
+ done(error);
+ });
+});
+
var tslintTask = function(strict) {
return function(done) {
if (hasError) {
@@ -100,23 +104,12 @@ var tslintTask = function(strict) {
gulp.task('tslint-permissive', [], tslintTask(false));
gulp.task('tslint-strict', [], tslintTask(true));
-
-gulp.task('run-tests', ['compile.all'], function(done) {
- if (hasError) {
- done();
- return;
- }
- return gulp.src('tests.html')
- .pipe(mochaPhantomJS({reporter: 'dot'}));
-});
-
-gulp.task('test', ['run-tests', 'tslint-strict']);
-gulp.task('watch', ['run-tests', 'tslint-permissive'], function() {
+gulp.task('watch', ['compile.all', 'tslint-permissive'], function() {
failOnError = false;
// Avoid watching generated .d.ts in the build (aka output) directory.
return gulp.watch(['test/**/*.ts', 'components/**/*.ts'],
{ignoreInitial: true},
- ['run-tests', 'tslint-permissive']);
+ ['compile.all', 'tslint-permissive']);
});
gulp.task('server', function() {
diff --git a/tensorflow/tensorboard/package.json b/tensorflow/tensorboard/package.json
index 3c78a5831c..068d2f0496 100644
--- a/tensorflow/tensorboard/package.json
+++ b/tensorflow/tensorboard/package.json
@@ -29,6 +29,7 @@
"vulcanize": "~1.14.0",
"gulp-vulcanize": "~6.0.1",
"minimist": "~1.2.0",
- "gulp-replace": "~0.5.4"
+ "gulp-replace": "~0.5.4",
+ "web-component-tester": "~3.3.30"
}
}
diff --git a/tensorflow/tensorboard/test/index.html b/tensorflow/tensorboard/test/index.html
new file mode 100644
index 0000000000..e02aafc668
--- /dev/null
+++ b/tensorflow/tensorboard/test/index.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <script src="../bower_components/webcomponentsjs/webcomponents-lite.min.js"></script>
+ <script src="../bower_components/web-component-tester/browser.js"></script>
+</head>
+<body>
+<script>
+// Run the tests for each main component in tensorboard.
+WCT.loadSuites([
+ '../components/tf-graph-common/test/index.html',
+ '../components/tf-graph-loader/test/index.html'
+]);
+</script>
+</body>
+</html> \ No newline at end of file
diff --git a/tensorflow/tensorflow.bzl b/tensorflow/tensorflow.bzl
index f88f3eb2a6..e1f279f20c 100644
--- a/tensorflow/tensorflow.bzl
+++ b/tensorflow/tensorflow.bzl
@@ -159,11 +159,12 @@ def tf_gen_op_wrapper_py(name, out=None, hidden=[], visibility=None, deps=[],
# Define a bazel macro that creates cc_test for tensorflow.
# TODO(opensource): we need to enable this to work around the hidden symbol
# __cudaRegisterFatBinary error. Need more investigations.
-def tf_cc_test(name, deps, linkstatic=0, tags=[]):
+def tf_cc_test(name, deps, linkstatic=0, tags=[], data=[]):
name = name.replace(".cc", "")
native.cc_test(name="%s" % (name.replace("/", "_")),
srcs=["%s.cc" % (name)],
copts=tf_copts(),
+ data=data,
deps=deps,
linkopts=["-lpthread", "-lm"],
linkstatic=linkstatic,