Skip to content

Commit 0386a01

Browse files
Dandelion Manétensorflower-gardener
authored andcommitted
Merge changes from github.
Change: 149800363
1 parent e73ceae commit 0386a01

File tree

114 files changed

+1033
-339
lines changed

Some content is hidden

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

114 files changed

+1033
-339
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,20 @@ guidelines](CONTRIBUTING.md).**
2525

2626
**We use [GitHub issues](https://github.com/tensorflow/tensorflow/issues) for
2727
tracking requests and bugs, but please see
28-
[Community](tensorflow/g3doc/resources/index.md#community) for general questions
28+
[Community](tensorflow/docs_src/about/index.md#community) for general questions
2929
and discussion.**
3030

3131
## Installation
32-
*See [Download and Setup](tensorflow/g3doc/get_started/os_setup.md) for instructions on how to install our release binaries or how to build from source.*
32+
*See [Installing TensorFlow](https://www.tensorflow.org/install/) for instructions on how to install our release binaries or how to build from source.*
3333

3434
People who are a little more adventurous can also try our nightly binaries:
3535

36-
* Linux CPU-only: [Python 2](https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-cpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON2,label=cpu-slave/lastSuccessfulBuild/artifact/pip_test/whl/tensorflow-1.0.0-cp27-none-linux_x86_64.whl) ([build history](https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-cpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON2,label=cpu-slave)) / [Python 3.5](https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-cpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON3,label=cpu-slave/lastSuccessfulBuild/artifact/pip_test/whl/tensorflow-1.0.0-cp35-cp35m-linux_x86_64.whl) ([build history](https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-cpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON3,label=cpu-slave))
37-
* Linux GPU: [Python 2](https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-linux-gpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON2,label=gpu-linux/lastSuccessfulBuild/artifact/pip_test/whl/tensorflow_gpu-1.0.0-cp27-none-linux_x86_64.whl) ([build history](https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-linux-gpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON2,label=gpu-linux/)) / [Python 3.5](https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-linux-gpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON3,label=gpu-linux/lastSuccessfulBuild/artifact/pip_test/whl/tensorflow_gpu-1.0.0-cp35-cp35m-linux_x86_64.whl) ([build history](https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-linux-gpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON3,label=gpu-linux/))
38-
* Mac CPU-only: [Python 2](https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-cpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON2,label=mac-slave/lastSuccessfulBuild/artifact/pip_test/whl/tensorflow-1.0.0-py2-none-any.whl) ([build history](https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-cpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON2,label=mac-slave/)) / [Python 3](https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-cpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON3,label=mac-slave/lastSuccessfulBuild/artifact/pip_test/whl/tensorflow-1.0.0-py3-none-any.whl) ([build history](https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-cpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON3,label=mac-slave/))
39-
* Mac GPU: [Python 2](https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-mac-gpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON2,label=gpu-mac/lastSuccessfulBuild/artifact/pip_test/whl/tensorflow_gpu-1.0.0-py2-none-any.whl) ([build history](https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-mac-gpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON2,label=gpu-mac/)) / [Python 3](https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-mac-gpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON3,label=gpu-mac/lastSuccessfulBuild/artifact/pip_test/whl/tensorflow_gpu-1.0.0-py3-none-any.whl) ([build history](https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-mac-gpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON3,label=gpu-mac/))
40-
* Windows CPU-only: [Python 3.5 64-bit](https://ci.tensorflow.org/view/Nightly/job/nightly-win/DEVICE=cpu,OS=windows/lastSuccessfulBuild/artifact/cmake_build/tf_python/dist/tensorflow-1.0.0-cp35-cp35m-win_amd64.whl) ([build history](https://ci.tensorflow.org/view/Nightly/job/nightly-win/DEVICE=cpu,OS=windows/))
41-
* Windows GPU: [Python 3.5 64-bit](https://ci.tensorflow.org/view/Nightly/job/nightly-win/DEVICE=gpu,OS=windows/lastSuccessfulBuild/artifact/cmake_build/tf_python/dist/tensorflow_gpu-1.0.0-cp35-cp35m-win_amd64.whl) ([build history](https://ci.tensorflow.org/view/Nightly/job/nightly-win/DEVICE=gpu,OS=windows/))
36+
* Linux CPU-only: [Python 2](https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-cpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON2,label=cpu-slave/lastSuccessfulBuild/artifact/pip_test/whl/tensorflow-1.0.1-cp27-none-linux_x86_64.whl) ([build history](https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-cpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON2,label=cpu-slave)) / [Python 3.4](https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-cpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON3,label=cpu-slave/lastSuccessfulBuild/artifact/pip_test/whl/tensorflow-1.0.1-cp34-cp34m-linux_x86_64.whl) ([build history](https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-cpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON3,label=cpu-slave/)) / [Python 3.5](https://ci.tensorflow.org/view/Nightly/job/nightly-python35-linux-cpu/lastSuccessfulBuild/artifact/pip_test/whl/tensorflow-1.0.1-cp35-cp35m-linux_x86_64.whl) ([build history](https://ci.tensorflow.org/view/Nightly/job/nightly-python35-linux-cpu/))
37+
* Linux GPU: [Python 2](https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-linux-gpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON2,label=gpu-linux/lastSuccessfulBuild/artifact/pip_test/whl/tensorflow_gpu-1.0.1-cp27-none-linux_x86_64.whl) ([build history](https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-linux-gpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON2,label=gpu-linux/)) / [Python 3.4](https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-linux-gpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON3,label=gpu-linux/lastSuccessfulBuild/artifact/pip_test/whl/tensorflow_gpu-1.0.1-cp34-cp34m-linux_x86_64.whl) ([build history](https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-linux-gpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON3,label=gpu-linux/)) / [Python 3.5](https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-linux-gpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON3.5,label=gpu-linux/lastSuccessfulBuild/artifact/pip_test/whl/tensorflow_gpu-1.0.1-cp35-cp35m-linux_x86_64.whl) ([build history](https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-linux-gpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON3.5,label=gpu-linux/))
38+
* Mac CPU-only: [Python 2](https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-cpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON2,label=mac-slave/lastSuccessfulBuild/artifact/pip_test/whl/tensorflow-1.0.1-py2-none-any.whl) ([build history](https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-cpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON2,label=mac-slave/)) / [Python 3](https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-cpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON3,label=mac-slave/lastSuccessfulBuild/artifact/pip_test/whl/tensorflow-1.0.1-py3-none-any.whl) ([build history](https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-cpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON3,label=mac-slave/))
39+
* Mac GPU: [Python 2](https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-mac-gpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON2,label=gpu-mac/lastSuccessfulBuild/artifact/pip_test/whl/tensorflow_gpu-1.0.1-py2-none-any.whl) ([build history](https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-mac-gpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON2,label=gpu-mac/)) / [Python 3](https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-mac-gpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON3,label=gpu-mac/lastSuccessfulBuild/artifact/pip_test/whl/tensorflow_gpu-1.0.1-py3-none-any.whl) ([build history](https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-mac-gpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON3,label=gpu-mac/))
40+
* Windows CPU-only: [Python 3.5 64-bit](https://ci.tensorflow.org/view/Nightly/job/nightly-win/DEVICE=cpu,OS=windows/lastSuccessfulBuild/artifact/cmake_build/tf_python/dist/tensorflow-1.0.1-cp35-cp35m-win_amd64.whl) ([build history](https://ci.tensorflow.org/view/Nightly/job/nightly-win/DEVICE=cpu,OS=windows/))
41+
* Windows GPU: [Python 3.5 64-bit](https://ci.tensorflow.org/view/Nightly/job/nightly-win/DEVICE=gpu,OS=windows/lastSuccessfulBuild/artifact/cmake_build/tf_python/dist/tensorflow_gpu-1.0.1-cp35-cp35m-win_amd64.whl) ([build history](https://ci.tensorflow.org/view/Nightly/job/nightly-win/DEVICE=gpu,OS=windows/))
4242
* Android: [demo APK](https://ci.tensorflow.org/view/Nightly/job/nightly-android/lastSuccessfulBuild/artifact/out/tensorflow_demo.apk), [native libs](http://ci.tensorflow.org/view/Nightly/job/nightly-android/lastSuccessfulBuild/artifact/out/native/)
4343
([build history](https://ci.tensorflow.org/view/Nightly/job/nightly-android/))
4444

RELEASE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ To help you upgrade your existing TensorFlow Python code to match the API change
8787
* In the C++ API (in tensorflow/cc), Input, Output, etc. have moved
8888
from the tensorflow::ops namespace to tensorflow.
8989
* Change arg order for `{softmax,sparse_softmax,sigmoid}_cross_entropy_with_logits` to be (labels, predictions), and force use of named args.
90+
* tf.nn.rnn_cell.* and most functions in tf.nn.rnn.* (with the exception of dynamic_rnn and raw_rnn) are temporarily in tf.contrib.rnn. They will be moved back into core for TF 1.1.
9091

9192
## Bug Fixes and Other Changes
9293
* Numerous C++ API updates.

configure

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ function bazel_clean_and_fetch() {
4545
-//tensorflow/examples/android/..."
4646
}
4747

48+
function sed_hyphen_i() {
49+
if is_macos; then
50+
sed -i '' "$@"
51+
else
52+
sed -i "$@"
53+
fi
54+
}
55+
4856
# Delete any leftover BUILD files from the Makefile build, which would interfere
4957
# with Bazel parsing.
5058
MAKEFILE_DOWNLOAD_DIR=tensorflow/contrib/makefile/downloads
@@ -173,9 +181,9 @@ else
173181
fi
174182

175183
if [ "$TF_NEED_JEMALLOC" == "1" ]; then
176-
sed -i -e "s/WITH_JEMALLOC = False/WITH_JEMALLOC = True/" tensorflow/core/platform/default/build_config.bzl
184+
sed_hyphen_i -e "s/WITH_JEMALLOC = False/WITH_JEMALLOC = True/" tensorflow/core/platform/default/build_config.bzl
177185
else
178-
sed -i -e "s/WITH_JEMALLOC = True/WITH_JEMALLOC = False/" tensorflow/core/platform/default/build_config.bzl
186+
sed_hyphen_i -e "s/WITH_JEMALLOC = True/WITH_JEMALLOC = False/" tensorflow/core/platform/default/build_config.bzl
179187
fi
180188

181189
while [ "$TF_NEED_GCP" == "" ]; do
@@ -202,10 +210,10 @@ if [ "$TF_NEED_GCP" == "1" ]; then
202210
fi
203211

204212
# Update Bazel build configuration.
205-
sed -i -e "s/WITH_GCP_SUPPORT = False/WITH_GCP_SUPPORT = True/" tensorflow/core/platform/default/build_config.bzl
213+
sed_hyphen_i -e "s/WITH_GCP_SUPPORT = False/WITH_GCP_SUPPORT = True/" tensorflow/core/platform/default/build_config.bzl
206214
else
207215
# Update Bazel build configuration.
208-
sed -i -e "s/WITH_GCP_SUPPORT = True/WITH_GCP_SUPPORT = False/" tensorflow/core/platform/default/build_config.bzl
216+
sed_hyphen_i -e "s/WITH_GCP_SUPPORT = True/WITH_GCP_SUPPORT = False/" tensorflow/core/platform/default/build_config.bzl
209217
fi
210218

211219
while [ "$TF_NEED_HDFS" == "" ]; do
@@ -224,10 +232,10 @@ done
224232

225233
if [ "$TF_NEED_HDFS" == "1" ]; then
226234
# Update Bazel build configuration.
227-
sed -i -e "s/WITH_HDFS_SUPPORT = False/WITH_HDFS_SUPPORT = True/" tensorflow/core/platform/default/build_config.bzl
235+
sed_hyphen_i -e "s/WITH_HDFS_SUPPORT = False/WITH_HDFS_SUPPORT = True/" tensorflow/core/platform/default/build_config.bzl
228236
else
229237
# Update Bazel build configuration.
230-
sed -i -e "s/WITH_HDFS_SUPPORT = True/WITH_HDFS_SUPPORT = False/" tensorflow/core/platform/default/build_config.bzl
238+
sed_hyphen_i -e "s/WITH_HDFS_SUPPORT = True/WITH_HDFS_SUPPORT = False/" tensorflow/core/platform/default/build_config.bzl
231239
fi
232240

233241
## Enable XLA.
@@ -243,10 +251,10 @@ done
243251

244252
if [ "$TF_ENABLE_XLA" == "1" ]; then
245253
# Update Bazel build configuration.
246-
sed -i -e "s/^WITH_XLA_SUPPORT = [FT].*/WITH_XLA_SUPPORT = True/" tensorflow/core/platform/default/build_config_root.bzl
254+
sed_hyphen_i -e "s/^WITH_XLA_SUPPORT = [FT].*/WITH_XLA_SUPPORT = True/" tensorflow/core/platform/default/build_config_root.bzl
247255
else
248256
# Update Bazel build configuration.
249-
sed -i -e "s/^WITH_XLA_SUPPORT = [FT].*/WITH_XLA_SUPPORT = False/" tensorflow/core/platform/default/build_config_root.bzl
257+
sed_hyphen_i -e "s/^WITH_XLA_SUPPORT = [FT].*/WITH_XLA_SUPPORT = False/" tensorflow/core/platform/default/build_config_root.bzl
250258
fi
251259

252260

tensorflow/c/c_api.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1701,6 +1701,12 @@ void TF_ImportGraphDefOptionsAddInputMapping(TF_ImportGraphDefOptions* opts,
17011701
opts->opts.input_map[TensorId(src_name, src_index)] = ToTensorId(dst);
17021702
}
17031703

1704+
void TF_ImportGraphDefOptionsRemapControlDependency(
1705+
TF_ImportGraphDefOptions* opts, const char* src_name, TF_Operation* dst) {
1706+
opts->opts.input_map[TensorId(src_name, tensorflow::Graph::kControlSlot)] =
1707+
TensorId(dst->node.name(), tensorflow::Graph::kControlSlot);
1708+
}
1709+
17041710
extern void TF_ImportGraphDefOptionsAddControlDependency(
17051711
TF_ImportGraphDefOptions* opts, TF_Operation* oper) {
17061712
opts->opts.control_dependencies.push_back(oper->node.name());

tensorflow/c/c_api.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,13 @@ extern void TF_ImportGraphDefOptionsAddInputMapping(
810810
TF_ImportGraphDefOptions* opts, const char* src_name, int src_index,
811811
TF_Output dst);
812812

813+
// Set any imported nodes with control input `src_name` to have that input
814+
// replaced with `dst`. `src_name` refers to a node in the graph to be imported,
815+
// `dst` references an operation already existing in the graph being imported
816+
// into.
817+
extern void TF_GraphImportGraphDefOptionsRemapControlDependency(
818+
TF_ImportGraphDefOptions* opts, const char* src_name, TF_Operation* dst);
819+
813820
// Cause the imported graph to have a control dependency on `oper`. `oper`
814821
// should exist in the graph being imported into.
815822
extern void TF_ImportGraphDefOptionsAddControlDependency(

tensorflow/compiler/jit/graph_to_functiondef.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ Status GraphToFunctionDef(const Graph& graph, const string& name,
185185
}
186186

187187
// Add regular inputs
188-
for (int i = 0; i < in_edges.size(); ++i) {
188+
for (std::vector<const Edge*>::size_type i = 0; i < in_edges.size(); ++i) {
189189
const Edge* edge = in_edges[i];
190190
if (edge == nullptr) {
191191
return errors::InvalidArgument(

tensorflow/compiler/jit/graphcycles/graphcycles.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ struct GraphCycles::Rep {
7676
GraphCycles::GraphCycles() : rep_(new Rep) {}
7777

7878
GraphCycles::~GraphCycles() {
79-
for (int i = 0; i < rep_->nodes_.size(); i++) {
79+
for (Vec<Node*>::size_type i = 0; i < rep_->nodes_.size(); i++) {
8080
delete rep_->nodes_[i];
8181
}
8282
delete rep_;
@@ -85,7 +85,7 @@ GraphCycles::~GraphCycles() {
8585
bool GraphCycles::CheckInvariants() const {
8686
Rep* r = rep_;
8787
NodeSet ranks; // Set of ranks seen so far.
88-
for (int32 x = 0; x < r->nodes_.size(); x++) {
88+
for (Vec<Node*>::size_type x = 0; x < r->nodes_.size(); x++) {
8989
Node* nx = r->nodes_[x];
9090
if (nx->visited) {
9191
LOG(FATAL) << "Did not clear visited marker on node " << x;
@@ -259,7 +259,7 @@ static void Reorder(GraphCycles::Rep* r) {
259259
r->deltaf_.end(), r->merged_.begin());
260260

261261
// Assign the ranks in order to the collected list.
262-
for (int32 i = 0; i < r->list_.size(); i++) {
262+
for (Vec<int32>::size_type i = 0; i < r->list_.size(); i++) {
263263
r->nodes_[r->list_[i]]->rank = r->merged_[i];
264264
}
265265
}
@@ -277,7 +277,7 @@ static void Sort(const Vec<Node*>& nodes, Vec<int32>* delta) {
277277
}
278278

279279
static void MoveToList(GraphCycles::Rep* r, Vec<int32>* src, Vec<int32>* dst) {
280-
for (int32 i = 0; i < src->size(); i++) {
280+
for (Vec<int32>::size_type i = 0; i < src->size(); i++) {
281281
int32 w = (*src)[i];
282282
(*src)[i] = r->nodes_[w]->rank; // Replace src entry with its rank
283283
r->nodes_[w]->visited = false; // Prepare for future DFS calls
@@ -286,7 +286,7 @@ static void MoveToList(GraphCycles::Rep* r, Vec<int32>* src, Vec<int32>* dst) {
286286
}
287287

288288
static void ClearVisitedBits(GraphCycles::Rep* r, const Vec<int32>& nodes) {
289-
for (int32 i = 0; i < nodes.size(); i++) {
289+
for (Vec<int32>::size_type i = 0; i < nodes.size(); i++) {
290290
r->nodes_[nodes[i]]->visited = false;
291291
}
292292
}

tensorflow/compiler/tf2xla/xla_compiler.cc

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,8 @@ Status BuildArguments(const std::vector<XlaCompiler::Argument>& args,
225225
parameters.reserve(args.size());
226226
variables.reserve(args.size());
227227

228-
for (int i = 0; i < args.size(); ++i) {
228+
for (std::vector<XlaCompiler::Argument>::size_type i = 0; i < args.size();
229+
++i) {
229230
XlaContext::Argument& context_arg = (*context_args)[i];
230231
context_arg.name = args[i].name;
231232
context_arg.value.constant_value = args[i].constant_value;
@@ -262,7 +263,7 @@ Status BuildArguments(const std::vector<XlaCompiler::Argument>& args,
262263

263264
input_shapes->resize(parameters.size());
264265
input_mapping->resize(parameters.size());
265-
for (int i = 0; i < input_shapes->size(); ++i) {
266+
for (std::vector<int>::size_type i = 0; i < input_shapes->size(); ++i) {
266267
const XlaCompiler::Argument& arg = args[parameters[i]];
267268
// Computes the shapes of non-constant arguments.
268269
xla::PrimitiveType type;
@@ -276,12 +277,12 @@ Status BuildArguments(const std::vector<XlaCompiler::Argument>& args,
276277
xla::Shape tuple_shape = xla::ShapeUtil::MakeTupleShape(*input_shapes);
277278
xla::ComputationDataHandle tuple =
278279
builder->Parameter(0, tuple_shape, "arg_tuple");
279-
for (int i = 0; i < input_shapes->size(); ++i) {
280+
for (std::vector<int>::size_type i = 0; i < input_shapes->size(); ++i) {
280281
(*context_args)[parameters[i]].value.handle =
281282
builder->GetTupleElement(tuple, i);
282283
}
283284
} else {
284-
for (int i = 0; i < input_shapes->size(); ++i) {
285+
for (std::vector<int>::size_type i = 0; i < input_shapes->size(); ++i) {
285286
(*context_args)[parameters[i]].value.handle =
286287
builder->Parameter(i, (*input_shapes)[i], strings::StrCat("arg", i));
287288
}
@@ -413,7 +414,8 @@ Status XlaCompiler::CompileGraph(string const& name,
413414
VLOG(2) << "Outputs: total: " << context->retvals().size()
414415
<< " nonconstant: " << num_nonconst_outputs;
415416
result->outputs.resize(context->retvals().size());
416-
for (int i = 0; i < context->retvals().size(); ++i) {
417+
for (std::vector<XlaContext::HandleOrConstant>::size_type i = 0;
418+
i < context->retvals().size(); ++i) {
417419
const XlaContext::HandleOrConstant& retval = context->retvals()[i];
418420
if (retval.is_constant) {
419421
OutputDescription& output = result->outputs[i];
@@ -457,7 +459,8 @@ Status XlaCompiler::CompileGraph(string const& name,
457459

458460
// Converts the output shapes to TensorShapes.
459461
int computation_output = 0;
460-
for (int i = 0; i < context->retvals().size(); ++i) {
462+
for (std::vector<XlaContext::HandleOrConstant>::size_type i = 0;
463+
i < context->retvals().size(); ++i) {
461464
const XlaContext::HandleOrConstant& retval = context->retvals()[i];
462465
if (!retval.is_constant) {
463466
CHECK_LT(computation_output, num_nonconst_outputs);
@@ -474,7 +477,8 @@ Status XlaCompiler::CompileGraph(string const& name,
474477
}
475478
}
476479

477-
for (int i = 0; i < result->variable_updates.size(); ++i) {
480+
for (std::vector<VariableUpdate>::size_type i = 0;
481+
i < result->variable_updates.size(); ++i) {
478482
if (num_computation_outputs > 1) {
479483
result->variable_updates[i].shape =
480484
XLAShapeToTensorShape(xla::ShapeUtil::GetTupleElementShape(

0 commit comments

Comments
 (0)