Skip to content

Commit

Permalink
Silence warnings and patch suggested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mc committed Apr 3, 2020
1 parent 77e9ffb commit 232324a
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 17 deletions.
4 changes: 3 additions & 1 deletion tensorflow/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ config_setting(

config_setting(
name = "emscripten",
values = {"crosstool_top": "//external:android/emscripten"},
values = {
"cpu": "js",
},
visibility = ["//visibility:public"],
)

Expand Down
4 changes: 2 additions & 2 deletions tensorflow/c/tf_tensor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ TF_Tensor* TF_NewTensor(TF_DataType dtype, const int64_t* dims, int num_dims,
if (elem_size > 0 && len < (elem_size * ret.NumElements())) {
return nullptr;
}
return new TF_Tensor{std::make_unique<tensorflow::TensorInterface>(ret)};
return new TF_Tensor{absl::make_unique<tensorflow::TensorInterface>(ret)};
}

TF_Tensor* TF_TensorMaybeMove(TF_Tensor* t) {
Expand Down Expand Up @@ -317,7 +317,7 @@ TF_Tensor* TF_TensorFromTensor(const tensorflow::Tensor& src, Status* status) {
if (!tensor.CopyFrom(src, src.shape())) {
return nullptr;
}
return new TF_Tensor{std::make_unique<tensorflow::TensorInterface>(tensor)};
return new TF_Tensor{absl::make_unique<tensorflow::TensorInterface>(tensor)};
}
// DT_STRING tensors require a copying since TF_Tensor.buffer expects a flatly
// encoded sequence of strings.
Expand Down
7 changes: 5 additions & 2 deletions tensorflow/core/lib/monitoring/percentile_sampler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ namespace monitoring {
void PercentileSamplerCell::Add(double sample) {
uint64 nstime = EnvTime::NowNanos();
mutex_lock l(mu_);
samples_[next_position_] = {nstime, sample};
samples_[next_position_].nstime = nstime;
samples_[next_position_].value = sample;
++next_position_;
if (TF_PREDICT_FALSE(next_position_ >= samples_.size())) {
next_position_ = 0;
Expand Down Expand Up @@ -72,7 +73,9 @@ Percentiles PercentileSamplerCell::value() const {
size_t index = std::min<size_t>(
static_cast<size_t>(percentile * pct_samples.num_samples / 100.0),
pct_samples.num_samples - 1);
PercentilePoint pct = {percentile, samples[index].value};
PercentilePoint pct;
pct.percentile = percentile;
pct.value = samples[index].value;
pct_samples.points.push_back(pct);
}
}
Expand Down
2 changes: 2 additions & 0 deletions tensorflow/lite/build_def.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ def tflite_copts():
"""Defines compile time flags."""
copts = [
"-DFARMHASH_NO_CXX_STRING",
"-Wno-deprecated-declarations",
"-Wno-unused-function",
] + select({
clean_dep("//tensorflow:android_arm"): [
"-mfpu=neon",
Expand Down
3 changes: 3 additions & 0 deletions tensorflow/lite/delegates/nnapi/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ cc_library(
"nnapi_delegate.h",
"nnapi_delegate_kernel.h",
],
copts = [
"-Wno-unused-private-field",
],
deps = [
"//tensorflow/lite:allocation",
"//tensorflow/lite:kernel_api",
Expand Down
15 changes: 8 additions & 7 deletions tensorflow/workspace.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,11 @@ def tf_repositories(path_prefix = "", tf_repo_name = ""):

tf_http_archive(
name = "XNNPACK",
sha256 = "8f29d32a35d5e12aa5f02d0ef9018c80f2c985cd1837493fdfa670d84dfe2e2b",
strip_prefix = "XNNPACK-1498d1d4d0430480dfe5c4538049b4f789d29134",
sha256 = "190e61e50af3497bb46b8d936bd2d2d551a9aeedb02ff66388918408a54e216a",
strip_prefix = "XNNPACK-b18783570f0643560be641b193367d3906955141",
urls = [
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/google/XNNPACK/archive/1498d1d4d0430480dfe5c4538049b4f789d29134.zip",
"https://github.com/google/XNNPACK/archive/1498d1d4d0430480dfe5c4538049b4f789d29134.zip",
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/google/XNNPACK/archive/b18783570f0643560be641b193367d3906955141.zip",
"https://github.com/google/XNNPACK/archive/b18783570f0643560be641b193367d3906955141.zip",
],
)

Expand Down Expand Up @@ -927,10 +927,11 @@ def tf_repositories(path_prefix = "", tf_repo_name = ""):
# https://github.com/bazelbuild/rules_apple/releases
tf_http_archive(
name = "build_bazel_rules_apple",
sha256 = "a045a436b642c70fb0c10ca84ff0fd2dcbd59cc89100d597a61e8374afafb366",
sha256 = "bdc8e66e70b8a75da23b79f1f8c6207356df07d041d96d2189add7ee0780cf4e",
strip_prefix = "rules_apple-b869b0d3868d78a1d4ffd866ccb304fb68aa12c3",
urls = [
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/bazelbuild/rules_apple/releases/download/0.18.0/rules_apple.0.18.0.tar.gz",
"https://github.com/bazelbuild/rules_apple/releases/download/0.18.0/rules_apple.0.18.0.tar.gz",
"https://github.com/bazelbuild/rules_apple/archive/b869b0d3868d78a1d4ffd866ccb304fb68aa12c3.tar.gz",
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/bazelbuild/rules_apple/archive/b869b0d3868d78a1d4ffd866ccb304fb68aa12c3.tar.gz",
],
)

Expand Down
1 change: 0 additions & 1 deletion third_party/cpuinfo/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ ARM_SRCS = [
# Platform-specific sources and headers
LINUX_SRCS = [
"src/linux/cpulist.c",
"src/linux/current.c",
"src/linux/multiline.c",
"src/linux/processors.c",
"src/linux/smallfile.c",
Expand Down
14 changes: 10 additions & 4 deletions third_party/cpuinfo/workspace.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@

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

# Sanitize a dependency so that it works correctly from code that includes
# TensorFlow as a submodule.
def clean_dep(dep):
return str(Label(dep))

def repo():
third_party_http_archive(
name = "cpuinfo",
strip_prefix = "cpuinfo-e39a5790059b6b8274ed91f7b5b5b13641dff267",
sha256 = "e5caa8b7c58f1623eed88f4d5147e3753ff19cde821526bc9aa551b004f751fe",
strip_prefix = "cpuinfo-d6c0f915ee737f961915c9d17f1679b6777af207",
sha256 = "146fc61c3cf63d7d88db963876929a4d373f621fb65568b895efa0857f467770",
urls = [
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/pytorch/cpuinfo/archive/e39a5790059b6b8274ed91f7b5b5b13641dff267.tar.gz",
"https://github.com/pytorch/cpuinfo/archive/e39a5790059b6b8274ed91f7b5b5b13641dff267.tar.gz",
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/pytorch/cpuinfo/archive/d6c0f915ee737f961915c9d17f1679b6777af207.tar.gz",
"https://github.com/pytorch/cpuinfo/archive/d6c0f915ee737f961915c9d17f1679b6777af207.tar.gz",
],
build_file = "//third_party/cpuinfo:BUILD.bazel",
patch_file = clean_dep("//third_party/cpuinfo:cpuinfo.patch"),
)

0 comments on commit 232324a

Please sign in to comment.