Skip to content

Commit 232324a

Browse files
author
mc
committed
Silence warnings and patch suggested changes
1 parent 77e9ffb commit 232324a

File tree

8 files changed

+33
-17
lines changed

8 files changed

+33
-17
lines changed

tensorflow/BUILD

+3-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ config_setting(
111111

112112
config_setting(
113113
name = "emscripten",
114-
values = {"crosstool_top": "//external:android/emscripten"},
114+
values = {
115+
"cpu": "js",
116+
},
115117
visibility = ["//visibility:public"],
116118
)
117119

tensorflow/c/tf_tensor.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ TF_Tensor* TF_NewTensor(TF_DataType dtype, const int64_t* dims, int num_dims,
114114
if (elem_size > 0 && len < (elem_size * ret.NumElements())) {
115115
return nullptr;
116116
}
117-
return new TF_Tensor{std::make_unique<tensorflow::TensorInterface>(ret)};
117+
return new TF_Tensor{absl::make_unique<tensorflow::TensorInterface>(ret)};
118118
}
119119

120120
TF_Tensor* TF_TensorMaybeMove(TF_Tensor* t) {
@@ -317,7 +317,7 @@ TF_Tensor* TF_TensorFromTensor(const tensorflow::Tensor& src, Status* status) {
317317
if (!tensor.CopyFrom(src, src.shape())) {
318318
return nullptr;
319319
}
320-
return new TF_Tensor{std::make_unique<tensorflow::TensorInterface>(tensor)};
320+
return new TF_Tensor{absl::make_unique<tensorflow::TensorInterface>(tensor)};
321321
}
322322
// DT_STRING tensors require a copying since TF_Tensor.buffer expects a flatly
323323
// encoded sequence of strings.

tensorflow/core/lib/monitoring/percentile_sampler.cc

+5-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ namespace monitoring {
2929
void PercentileSamplerCell::Add(double sample) {
3030
uint64 nstime = EnvTime::NowNanos();
3131
mutex_lock l(mu_);
32-
samples_[next_position_] = {nstime, sample};
32+
samples_[next_position_].nstime = nstime;
33+
samples_[next_position_].value = sample;
3334
++next_position_;
3435
if (TF_PREDICT_FALSE(next_position_ >= samples_.size())) {
3536
next_position_ = 0;
@@ -72,7 +73,9 @@ Percentiles PercentileSamplerCell::value() const {
7273
size_t index = std::min<size_t>(
7374
static_cast<size_t>(percentile * pct_samples.num_samples / 100.0),
7475
pct_samples.num_samples - 1);
75-
PercentilePoint pct = {percentile, samples[index].value};
76+
PercentilePoint pct;
77+
pct.percentile = percentile;
78+
pct.value = samples[index].value;
7679
pct_samples.points.push_back(pct);
7780
}
7881
}

tensorflow/lite/build_def.bzl

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ def tflite_copts():
1212
"""Defines compile time flags."""
1313
copts = [
1414
"-DFARMHASH_NO_CXX_STRING",
15+
"-Wno-deprecated-declarations",
16+
"-Wno-unused-function",
1517
] + select({
1618
clean_dep("//tensorflow:android_arm"): [
1719
"-mfpu=neon",

tensorflow/lite/delegates/nnapi/BUILD

+3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ cc_library(
2626
"nnapi_delegate.h",
2727
"nnapi_delegate_kernel.h",
2828
],
29+
copts = [
30+
"-Wno-unused-private-field",
31+
],
2932
deps = [
3033
"//tensorflow/lite:allocation",
3134
"//tensorflow/lite:kernel_api",

tensorflow/workspace.bzl

+8-7
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,11 @@ def tf_repositories(path_prefix = "", tf_repo_name = ""):
144144

145145
tf_http_archive(
146146
name = "XNNPACK",
147-
sha256 = "8f29d32a35d5e12aa5f02d0ef9018c80f2c985cd1837493fdfa670d84dfe2e2b",
148-
strip_prefix = "XNNPACK-1498d1d4d0430480dfe5c4538049b4f789d29134",
147+
sha256 = "190e61e50af3497bb46b8d936bd2d2d551a9aeedb02ff66388918408a54e216a",
148+
strip_prefix = "XNNPACK-b18783570f0643560be641b193367d3906955141",
149149
urls = [
150-
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/google/XNNPACK/archive/1498d1d4d0430480dfe5c4538049b4f789d29134.zip",
151-
"https://github.com/google/XNNPACK/archive/1498d1d4d0430480dfe5c4538049b4f789d29134.zip",
150+
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/google/XNNPACK/archive/b18783570f0643560be641b193367d3906955141.zip",
151+
"https://github.com/google/XNNPACK/archive/b18783570f0643560be641b193367d3906955141.zip",
152152
],
153153
)
154154

@@ -927,10 +927,11 @@ def tf_repositories(path_prefix = "", tf_repo_name = ""):
927927
# https://github.com/bazelbuild/rules_apple/releases
928928
tf_http_archive(
929929
name = "build_bazel_rules_apple",
930-
sha256 = "a045a436b642c70fb0c10ca84ff0fd2dcbd59cc89100d597a61e8374afafb366",
930+
sha256 = "bdc8e66e70b8a75da23b79f1f8c6207356df07d041d96d2189add7ee0780cf4e",
931+
strip_prefix = "rules_apple-b869b0d3868d78a1d4ffd866ccb304fb68aa12c3",
931932
urls = [
932-
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/bazelbuild/rules_apple/releases/download/0.18.0/rules_apple.0.18.0.tar.gz",
933-
"https://github.com/bazelbuild/rules_apple/releases/download/0.18.0/rules_apple.0.18.0.tar.gz",
933+
"https://github.com/bazelbuild/rules_apple/archive/b869b0d3868d78a1d4ffd866ccb304fb68aa12c3.tar.gz",
934+
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/bazelbuild/rules_apple/archive/b869b0d3868d78a1d4ffd866ccb304fb68aa12c3.tar.gz",
934935
],
935936
)
936937

third_party/cpuinfo/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ ARM_SRCS = [
4242
# Platform-specific sources and headers
4343
LINUX_SRCS = [
4444
"src/linux/cpulist.c",
45-
"src/linux/current.c",
4645
"src/linux/multiline.c",
4746
"src/linux/processors.c",
4847
"src/linux/smallfile.c",

third_party/cpuinfo/workspace.bzl

+10-4
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,20 @@
22

33
load("//third_party:repo.bzl", "third_party_http_archive")
44

5+
# Sanitize a dependency so that it works correctly from code that includes
6+
# TensorFlow as a submodule.
7+
def clean_dep(dep):
8+
return str(Label(dep))
9+
510
def repo():
611
third_party_http_archive(
712
name = "cpuinfo",
8-
strip_prefix = "cpuinfo-e39a5790059b6b8274ed91f7b5b5b13641dff267",
9-
sha256 = "e5caa8b7c58f1623eed88f4d5147e3753ff19cde821526bc9aa551b004f751fe",
13+
strip_prefix = "cpuinfo-d6c0f915ee737f961915c9d17f1679b6777af207",
14+
sha256 = "146fc61c3cf63d7d88db963876929a4d373f621fb65568b895efa0857f467770",
1015
urls = [
11-
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/pytorch/cpuinfo/archive/e39a5790059b6b8274ed91f7b5b5b13641dff267.tar.gz",
12-
"https://github.com/pytorch/cpuinfo/archive/e39a5790059b6b8274ed91f7b5b5b13641dff267.tar.gz",
16+
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/pytorch/cpuinfo/archive/d6c0f915ee737f961915c9d17f1679b6777af207.tar.gz",
17+
"https://github.com/pytorch/cpuinfo/archive/d6c0f915ee737f961915c9d17f1679b6777af207.tar.gz",
1318
],
1419
build_file = "//third_party/cpuinfo:BUILD.bazel",
20+
patch_file = clean_dep("//third_party/cpuinfo:cpuinfo.patch"),
1521
)

0 commit comments

Comments
 (0)