Skip to content

Commit 632c900

Browse files
author
Vijay Vasudevan
committed
TensorFlow: fix more int -> size_t warnings
Change: 113089380
1 parent c5c5d61 commit 632c900

7 files changed

Lines changed: 11 additions & 39 deletions

File tree

tensorflow/core/BUILD

Lines changed: 5 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -630,43 +630,15 @@ filegroup(
630630
visibility = ["//visibility:public"],
631631
)
632632

633-
TENSORFLOW_ANDROID_SRCS = [
634-
"//tensorflow/core:android_core_ops",
635-
"//tensorflow/core:android_extended_ops",
636-
"//tensorflow/core:android_srcs",
637-
]
638-
639-
config_setting(
640-
name = "android_32",
641-
values = {
642-
"crosstool_top": "//android_ndk_repository/toolchains/gcc_4_8:everything",
643-
},
644-
)
645-
646-
config_setting(
647-
name = "android_64",
648-
values = {
649-
"crosstool_top": "//android_ndk_repository/toolchains/gcc_4_9:everything",
650-
},
651-
)
652-
653-
config_setting(
654-
name = "android_bazel",
655-
values = {
656-
"crosstool_top": "//external:android/crosstool",
657-
},
658-
)
659-
660633
# Native library support for Android applications.
661634
# Should be built to target Android with flag --copt=-mfpu=neon.
662635
cc_library(
663636
name = "android_tensorflow_lib",
664-
srcs = select({
665-
":android_32": TENSORFLOW_ANDROID_SRCS,
666-
":android_64": TENSORFLOW_ANDROID_SRCS,
667-
":android_bazel": TENSORFLOW_ANDROID_SRCS,
668-
"//conditions:default": [],
669-
}),
637+
srcs = [
638+
"//tensorflow/core:android_core_ops",
639+
"//tensorflow/core:android_extended_ops",
640+
"//tensorflow/core:android_srcs",
641+
],
670642
hdrs = [
671643
"framework/tensor.h",
672644
"platform/env.h",

tensorflow/core/common_runtime/constant_folding.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ bool DoConstantFolding(const ConstantFoldingOptions& opts, Graph* graph) {
323323
}
324324
// Fetch the constant nodes and replace the corresponding nodes in the
325325
// original graph with those constants.
326-
for (int c = 0; c < fetch_nodes.size(); ++c) {
326+
for (size_t c = 0; c < fetch_nodes.size(); ++c) {
327327
Tensor output;
328328
bool is_dead;
329329
string tensor_name;

tensorflow/core/common_runtime/executor.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ void SetReferencedTensors(NodeExecStats* nt,
166166
const TensorReferenceVector& tensors) {
167167
// be careful not to increment the reference count on any tensor
168168
// while recording the information
169-
for (int i = 0; i < tensors.size(); ++i) {
169+
for (size_t i = 0; i < tensors.size(); ++i) {
170170
AllocationDescription* description = nt->add_referenced_tensor();
171171
tensors.at(i).FillDescription(description);
172172
}

tensorflow/core/framework/function.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ Status BuildInputArgIndex(const OpDef::ArgDef& arg_def,
163163
TF_RETURN_IF_ERROR(AddArgName(name_info, arg_def.name(),
164164
{true, arg_index, 0, is_type_list, dtypes}));
165165
// Creates dtypes.size() nodes in the gdef.
166-
for (int i = 0; i < dtypes.size(); ++i) {
166+
for (size_t i = 0; i < dtypes.size(); ++i) {
167167
TF_RETURN_IF_ERROR(AddArgName(name_info,
168168
strings::StrCat(arg_def.name(), ":", i),
169169
{true, arg_index, 0, false, {dtypes[i]}}));

tensorflow/core/framework/rendezvous.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ string Rendezvous::CreateKey(const string& src_device, uint64 src_incarnation,
5050
// the whole remaining string if "delim" is not found. "*s" is advanced
5151
// past the string returned plus the delimiter (if found).
5252
static StringPiece ConsumeNextPart(StringPiece* s, char delim) {
53-
for (int offset = 0; offset < s->size(); offset++) {
53+
for (size_t offset = 0; offset < s->size(); offset++) {
5454
if ((*s)[offset] == delim) {
5555
StringPiece result(s->data(), offset);
5656
s->remove_prefix(offset + 1); // +1: remove delim, as well

tensorflow/core/kernels/padding_fifo_queue.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ void PaddingFIFOQueue::TryDequeueMany(int num_elements, OpKernelContext* ctx,
179179
attempt->tuple.emplace_back(element);
180180
}
181181

182-
for (int index = 0; index < tuples.size(); ++index) {
182+
for (size_t index = 0; index < tuples.size(); ++index) {
183183
for (int i = 0; i < num_components(); ++i) {
184184
if (dynamic_shape[i]) {
185185
// Slightly slower copy operation

tensorflow/python/lib/core/py_func.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ class PyFuncOp : public AsyncOpKernel {
311311
" values, but expects to see ",
312312
ctx->num_outputs(), " values."),
313313
done);
314-
for (int i = 0; i < call->out.size(); ++i) {
314+
for (size_t i = 0; i < call->out.size(); ++i) {
315315
const auto& t = call->out[i];
316316
OP_REQUIRES_ASYNC(
317317
ctx, t.dtype() == output_type(i),

0 commit comments

Comments
 (0)