diff --git a/tensorflow/core/common_runtime/device_mgr.cc b/tensorflow/core/common_runtime/device_mgr.cc index 1f7d7c46998..26602a45be8 100644 --- a/tensorflow/core/common_runtime/device_mgr.cc +++ b/tensorflow/core/common_runtime/device_mgr.cc @@ -95,7 +95,6 @@ string DeviceMgr::DeviceMappingString() const { } Status DeviceMgr::LookupDevice(StringPiece name, Device** device) const { - Status s; auto iter = device_map_.find(name); if (iter == device_map_.end()) { std::vector device_names; diff --git a/tensorflow/core/common_runtime/device_resolver_local_test.cc b/tensorflow/core/common_runtime/device_resolver_local_test.cc index 62e82bcc5a3..b8dac8e0dd9 100644 --- a/tensorflow/core/common_runtime/device_resolver_local_test.cc +++ b/tensorflow/core/common_runtime/device_resolver_local_test.cc @@ -31,7 +31,6 @@ namespace { class DeviceResolverLocalTest : public ::testing::Test { protected: DeviceResolverLocalTest() { - ConfigProto cp; SessionOptions options; string task_name = "/job:localhost/replica:0/task:0"; auto* device_count = options.config.mutable_device_count(); diff --git a/tensorflow/core/common_runtime/function.cc b/tensorflow/core/common_runtime/function.cc index 99841588dcc..9fa6f717b92 100644 --- a/tensorflow/core/common_runtime/function.cc +++ b/tensorflow/core/common_runtime/function.cc @@ -684,7 +684,6 @@ Status FunctionLibraryRuntimeImpl::Instantiate( } } - Status s; const FunctionLibraryDefinition* lib_def = options.overlay_lib ? options.overlay_lib : base_lib_def_; FunctionBody* fbody = nullptr; diff --git a/tensorflow/core/distributed_runtime/collective_param_resolver_distributed_test.cc b/tensorflow/core/distributed_runtime/collective_param_resolver_distributed_test.cc index 823d7d5eb98..5cd75a3100e 100644 --- a/tensorflow/core/distributed_runtime/collective_param_resolver_distributed_test.cc +++ b/tensorflow/core/distributed_runtime/collective_param_resolver_distributed_test.cc @@ -107,7 +107,6 @@ class FakeCache : public TestWorkerCache { WorkerInterface* wi = it->second; GetStatusRequest req; GetStatusResponse resp; - Notification note; Status status = wi->GetStatus(&req, &resp); if (!status.ok()) { done(status); diff --git a/tensorflow/core/distributed_runtime/collective_rma_distributed_test.cc b/tensorflow/core/distributed_runtime/collective_rma_distributed_test.cc index 26f722a6bd4..cac17ab51ab 100644 --- a/tensorflow/core/distributed_runtime/collective_rma_distributed_test.cc +++ b/tensorflow/core/distributed_runtime/collective_rma_distributed_test.cc @@ -147,7 +147,6 @@ class FakeCache : public TestWorkerCache { WorkerInterface* wi = it->second; GetStatusRequest req; GetStatusResponse resp; - Notification note; Status status = wi->GetStatus(&req, &resp); if (!status.ok()) { done(status); @@ -271,7 +270,6 @@ TEST_F(CollRMADistTest, ProdFirstOK) { producer_status.Update(s); producer_note.Notify(); }); - Status status; Device* dst_device = nullptr; string dev_name = "CPU:0"; TF_EXPECT_OK(device_mgrs_[0]->LookupDevice(dev_name, &dst_device)); @@ -300,7 +298,6 @@ TEST_F(CollRMADistTest, ConsFirstOK) { Status producer_status; FakeWorker* wi = workers_[1]; const string kBufKey = "fake_buf_key"; - Status status; Device* dst_device = nullptr; string dev_name = "CPU:0"; TF_EXPECT_OK(device_mgrs_[0]->LookupDevice(dev_name, &dst_device)); @@ -333,7 +330,6 @@ TEST_F(CollRMADistTest, ConsFirstAbort) { Notification consumer_note; Status consumer_status; const string kBufKey = "fake_buf_key"; - Status status; Device* dst_device = nullptr; string dev_name = "CPU:0"; TF_EXPECT_OK(device_mgrs_[0]->LookupDevice(dev_name, &dst_device)); diff --git a/tensorflow/core/distributed_runtime/device_resolver_distributed_test.cc b/tensorflow/core/distributed_runtime/device_resolver_distributed_test.cc index 842a2b3b058..0bc370c93b5 100644 --- a/tensorflow/core/distributed_runtime/device_resolver_distributed_test.cc +++ b/tensorflow/core/distributed_runtime/device_resolver_distributed_test.cc @@ -109,7 +109,6 @@ class FakeCache : public TestWorkerCache { WorkerInterface* wi = it->second; GetStatusRequest req; GetStatusResponse resp; - Notification note; Status status = wi->GetStatus(&req, &resp); if (!status.ok()) { done(status); diff --git a/tensorflow/core/distributed_runtime/session_mgr_test.cc b/tensorflow/core/distributed_runtime/session_mgr_test.cc index 1ab0d20f0b5..edbd7ddbcb2 100644 --- a/tensorflow/core/distributed_runtime/session_mgr_test.cc +++ b/tensorflow/core/distributed_runtime/session_mgr_test.cc @@ -140,7 +140,6 @@ TEST_F(SessionMgrTest, CreateSessionIsolateSessionState) { } TEST_F(SessionMgrTest, LegacySession) { - ServerDef server_def; string session_handle = ""; std::shared_ptr session; TF_EXPECT_OK(mgr_.WorkerSessionForSession(session_handle, &session)); @@ -150,7 +149,6 @@ TEST_F(SessionMgrTest, LegacySession) { } TEST_F(SessionMgrTest, UnknownSessionHandle) { - ServerDef server_def; string session_handle = "unknown_session_handle"; std::shared_ptr session; Status s = mgr_.WorkerSessionForSession(session_handle, &session); diff --git a/tensorflow/core/framework/op_gen_lib.cc b/tensorflow/core/framework/op_gen_lib.cc index 92a7038a404..4a94f97c767 100644 --- a/tensorflow/core/framework/op_gen_lib.cc +++ b/tensorflow/core/framework/op_gen_lib.cc @@ -228,7 +228,6 @@ string PBTxtFromMultiline(StringPiece multiline_pbtxt) { // Add every line to unescaped until we see the "END" string. string unescaped; bool first = true; - string suffix; while (!multiline_pbtxt.empty()) { SplitAt('\n', &multiline_pbtxt, &line); if (str_util::ConsumePrefix(&line, end)) break; diff --git a/tensorflow/core/framework/rendezvous_test.cc b/tensorflow/core/framework/rendezvous_test.cc index 7a777f064c7..8f16c6fd839 100644 --- a/tensorflow/core/framework/rendezvous_test.cc +++ b/tensorflow/core/framework/rendezvous_test.cc @@ -318,7 +318,6 @@ void BM_SendRecv(int iters) { Tensor val(DT_STRING, TensorShape({})); bool is_dead = false; Rendezvous::Args args; - Status s; if (iters > 0) { while (iters--) { TF_CHECK_OK(rendez->Send(KeyFoo(), args, orig, is_dead)); @@ -343,7 +342,6 @@ void BM_PingPong(int iters) { Tensor foo(DT_STRING, TensorShape({})); bool is_dead = false; Rendezvous::Args args; - Status s; for (int i = 0; i < iters; ++i) { TF_CHECK_OK(rendez->Recv(KeyFoo(), args, &foo, &is_dead)); TF_CHECK_OK(rendez->Send(KeyBar(), args, bar, is_dead)); @@ -354,7 +352,6 @@ void BM_PingPong(int iters) { Tensor bar(DT_STRING, TensorShape({})); bool is_dead = false; Rendezvous::Args args; - Status s; for (int i = 0; i < iters; ++i) { TF_CHECK_OK(rendez->Send(KeyFoo(), args, foo, is_dead)); TF_CHECK_OK(rendez->Recv(KeyBar(), args, &bar, &is_dead)); diff --git a/tensorflow/core/framework/tensor_slice.cc b/tensorflow/core/framework/tensor_slice.cc index eb3a7f52c2b..975e1e2e24a 100644 --- a/tensorflow/core/framework/tensor_slice.cc +++ b/tensorflow/core/framework/tensor_slice.cc @@ -128,7 +128,6 @@ string TensorSlice::DebugString() const { if (!first) { buffer.append(":"); } - string s; if (IsFullAt(d)) { buffer.append("-"); } else { diff --git a/tensorflow/core/graph/algorithm_test.cc b/tensorflow/core/graph/algorithm_test.cc index 60a3e66aa15..a62f8f02a0c 100644 --- a/tensorflow/core/graph/algorithm_test.cc +++ b/tensorflow/core/graph/algorithm_test.cc @@ -156,7 +156,6 @@ TEST(AlgorithmTest, ReversePostOrderStable) { TEST(AlgorithmTest, PostOrderWithEdgeFilter) { GraphDefBuilder b(GraphDefBuilder::kFailImmediately); - string error; Node* n0 = ops::SourceOp("TestParams", b.opts().WithName("n0")); Node* n1 = ops::UnaryOp("TestUnary", n0, b.opts().WithName("n1")); Node* n2 = ops::UnaryOp("TestUnary", n1, b.opts().WithName("n2")); diff --git a/tensorflow/core/graph/mkl_layout_pass.cc b/tensorflow/core/graph/mkl_layout_pass.cc index d5dcd16be7f..c66dfe10f55 100644 --- a/tensorflow/core/graph/mkl_layout_pass.cc +++ b/tensorflow/core/graph/mkl_layout_pass.cc @@ -2366,7 +2366,6 @@ void MklLayoutRewritePass::CopyAttrsQuantizedPooling(const Node* orig_node, NodeBuilder* nb, bool change_format) { DataType T; - string data_format; string padding; std::vector ksize, strides; diff --git a/tensorflow/core/grappler/clusters/single_machine.cc b/tensorflow/core/grappler/clusters/single_machine.cc index e7c72b80886..c7827c17dd2 100644 --- a/tensorflow/core/grappler/clusters/single_machine.cc +++ b/tensorflow/core/grappler/clusters/single_machine.cc @@ -455,7 +455,6 @@ Status SingleMachine::ClearAllocatorStats() const { std::vector devices = device_mgr->ListDevices(); for (Device* device : devices) { - AllocatorStats stats; auto* allocator = device->GetAllocator(AllocatorAttributes()); if (!allocator->TracksAllocationSizes()) { return Status(error::INVALID_ARGUMENT, diff --git a/tensorflow/core/kernels/deserialize_sparse_string_op.cc b/tensorflow/core/kernels/deserialize_sparse_string_op.cc index 2c13f24ad6b..d26d8188d51 100644 --- a/tensorflow/core/kernels/deserialize_sparse_string_op.cc +++ b/tensorflow/core/kernels/deserialize_sparse_string_op.cc @@ -204,8 +204,6 @@ class DeserializeSparseOp : public OpKernel { target_shape.vec()(i + ndims - 1) = output.shape().data()[i + 1]; } - Tensor output_indices; - Tensor output_shape; Reshape(context, output.indices(), input_shape, target_shape, 0 /* output indices index */, 2 /* output shape index */); context->set_output(1, output.values()); diff --git a/tensorflow/core/kernels/hexagon/graph_transferer.cc b/tensorflow/core/kernels/hexagon/graph_transferer.cc index 477e729dcb9..df2796f24b4 100644 --- a/tensorflow/core/kernels/hexagon/graph_transferer.cc +++ b/tensorflow/core/kernels/hexagon/graph_transferer.cc @@ -338,7 +338,6 @@ Status GraphTransferer::TransformGraphToAddAggregatedInputNode( shapes.emplace_back(input_node_info_list.at(i).second.shape()); } - NodeDef input_node_def; auto builder = NodeBuilder(AGGREGATED_INPUT_NODE_NAME, "RemoteFusedGraphExecute") .Input(std::vector{}) diff --git a/tensorflow/core/kernels/map_stage_op.cc b/tensorflow/core/kernels/map_stage_op.cc index 27a8696e546..82b1397d243 100644 --- a/tensorflow/core/kernels/map_stage_op.cc +++ b/tensorflow/core/kernels/map_stage_op.cc @@ -582,7 +582,6 @@ class MapUnstageOp : public OpKernel { const Tensor* key_tensor; const Tensor* indices_tensor; - OpInputList values_tensor; OP_REQUIRES_OK(ctx, ctx->input("key", &key_tensor)); OP_REQUIRES_OK(ctx, ctx->input("indices", &indices_tensor)); @@ -644,7 +643,6 @@ class MapPeekOp : public OpKernel { const Tensor* key_tensor; const Tensor* indices_tensor; - OpInputList values_tensor; OP_REQUIRES_OK(ctx, ctx->input("key", &key_tensor)); OP_REQUIRES_OK(ctx, ctx->input("indices", &indices_tensor)); diff --git a/tensorflow/core/kernels/mfcc_dct_test.cc b/tensorflow/core/kernels/mfcc_dct_test.cc index 7526278fe9e..70158648976 100644 --- a/tensorflow/core/kernels/mfcc_dct_test.cc +++ b/tensorflow/core/kernels/mfcc_dct_test.cc @@ -44,11 +44,8 @@ TEST(MfccDctTest, AgreesWithMatlab) { TEST(MfccDctTest, InitializeFailsOnInvalidInput) { MfccDct dct1; EXPECT_FALSE(dct1.Initialize(-50, 1)); - MfccDct dct2; EXPECT_FALSE(dct1.Initialize(10, -4)); - MfccDct dct3; EXPECT_FALSE(dct1.Initialize(-1, -1)); - MfccDct dct4; EXPECT_FALSE(dct1.Initialize(20, 21)); } diff --git a/tensorflow/core/kernels/sparse_reshape_op.cc b/tensorflow/core/kernels/sparse_reshape_op.cc index 939d404aa44..059519a913b 100644 --- a/tensorflow/core/kernels/sparse_reshape_op.cc +++ b/tensorflow/core/kernels/sparse_reshape_op.cc @@ -34,8 +34,6 @@ class SparseReshapeOp : public OpKernel { explicit SparseReshapeOp(OpKernelConstruction* context) : OpKernel(context) {} void Compute(OpKernelContext* context) override { - Tensor output_indices; - Tensor output_shape; Reshape(context, context->input(0), context->input(1), context->input(2), 0 /* output indices index */, 1 /* output shape index */); } diff --git a/tensorflow/core/lib/gtl/map_util_test.cc b/tensorflow/core/lib/gtl/map_util_test.cc index e19459c091e..bcb1a4a6cf8 100644 --- a/tensorflow/core/lib/gtl/map_util_test.cc +++ b/tensorflow/core/lib/gtl/map_util_test.cc @@ -34,7 +34,6 @@ TEST(MapUtil, Find) { m["foo"] = "bar"; EXPECT_EQ("bar", gtl::FindWithDefault(m, "foo", "")); EXPECT_EQ("bar", *gtl::FindOrNull(m, "foo")); - string str; EXPECT_TRUE(m.count("foo") > 0); EXPECT_EQ(m["foo"], "bar"); } diff --git a/tensorflow/core/lib/io/buffered_inputstream_test.cc b/tensorflow/core/lib/io/buffered_inputstream_test.cc index 49b2b1a861a..ad4c8013bc2 100644 --- a/tensorflow/core/lib/io/buffered_inputstream_test.cc +++ b/tensorflow/core/lib/io/buffered_inputstream_test.cc @@ -337,7 +337,6 @@ TEST(BufferedInputStream, ReadAll_Empty) { for (auto buf_size : BufferSizes()) { RandomAccessInputStream input_stream(file.get()); - string read; BufferedInputStream in(&input_stream, buf_size); string contents; TF_ASSERT_OK(in.ReadAll(&contents)); @@ -355,7 +354,6 @@ TEST(BufferedInputStream, ReadAll_Text) { for (auto buf_size : BufferSizes()) { RandomAccessInputStream input_stream(file.get()); - string read; BufferedInputStream in(&input_stream, buf_size); string contents; TF_ASSERT_OK(in.ReadAll(&contents)); diff --git a/tensorflow/core/lib/io/table.cc b/tensorflow/core/lib/io/table.cc index 1ef7bb6ccda..1e68493bfe9 100644 --- a/tensorflow/core/lib/io/table.cc +++ b/tensorflow/core/lib/io/table.cc @@ -133,7 +133,6 @@ Status Table::InternalGet(const StringPiece& k, void* arg, Iterator* iiter = rep_->index_block->NewIterator(); iiter->Seek(k); if (iiter->Valid()) { - BlockHandle handle; Iterator* block_iter = BlockReader(this, iiter->value()); block_iter->Seek(k); if (block_iter->Valid()) { diff --git a/tensorflow/core/lib/strings/ordered_code_test.cc b/tensorflow/core/lib/strings/ordered_code_test.cc index ede9f4d3901..5334394d352 100644 --- a/tensorflow/core/lib/strings/ordered_code_test.cc +++ b/tensorflow/core/lib/strings/ordered_code_test.cc @@ -396,7 +396,6 @@ void BM_WriteNum(int n, T multiplier) { template void BM_ReadNum(int n, T multiplier) { - string x; random::PhiloxRandom philox(301, 17); random::SimplePhilox rnd(&philox); // Use enough distinct values to confuse the branch predictor diff --git a/tensorflow/core/ops/boosted_trees_ops.cc b/tensorflow/core/ops/boosted_trees_ops.cc index 1c854f66193..852b8d326c1 100644 --- a/tensorflow/core/ops/boosted_trees_ops.cc +++ b/tensorflow/core/ops/boosted_trees_ops.cc @@ -400,7 +400,6 @@ REGISTER_OP("BoostedTreesMakeQuantileSummaries") c->WithRank(c->input(num_features), 1, &example_weights_shape)); for (int i = 0; i < num_features; ++i) { ShapeHandle feature_shape; - DimensionHandle unused_dim; TF_RETURN_IF_ERROR(c->WithRank(c->input(i), 1, &feature_shape)); // the columns are value, weight, min_rank, max_rank. c->set_output(i, c->MakeShape({c->UnknownDim(), 4})); diff --git a/tensorflow/core/ops/math_ops_test.cc b/tensorflow/core/ops/math_ops_test.cc index 1e6dbbfb2f5..a1abdb6aed2 100644 --- a/tensorflow/core/ops/math_ops_test.cc +++ b/tensorflow/core/ops/math_ops_test.cc @@ -205,7 +205,6 @@ TEST(MathOpsTest, Select_ShapeFn) { typedef std::vector> ShapeDtypeV; std::vector> handle_data; std::unique_ptr c; - Status run_status; auto run_inference_for_handles = [&]() -> Status { CHECK(op_reg_data->shape_inference_fn != nullptr); c.reset(new shape_inference::InferenceContext( diff --git a/tensorflow/core/ops/sparse_ops.cc b/tensorflow/core/ops/sparse_ops.cc index de08a107845..85186c4a2d8 100644 --- a/tensorflow/core/ops/sparse_ops.cc +++ b/tensorflow/core/ops/sparse_ops.cc @@ -97,7 +97,6 @@ REGISTER_OP("SparseTensorDenseMatMul") ShapeHandle unused; ShapeHandle b; ShapeHandle a_shape; - ShapeHandle a_shape_shape; TF_RETURN_IF_ERROR(c->WithRank(c->input(0), 2, &unused)); // a_indices TF_RETURN_IF_ERROR(c->WithRank(c->input(1), 1, &unused)); // a_values TF_RETURN_IF_ERROR(c->MakeShapeFromShapeTensor(2, &a_shape)); diff --git a/tensorflow/core/profiler/internal/tfprof_tensor_test.cc b/tensorflow/core/profiler/internal/tfprof_tensor_test.cc index 7fa79d23d85..b9eb1a48924 100644 --- a/tensorflow/core/profiler/internal/tfprof_tensor_test.cc +++ b/tensorflow/core/profiler/internal/tfprof_tensor_test.cc @@ -63,7 +63,6 @@ TEST_F(TFProfTensorTest, Basics) { "", {}); const GraphNodeProto& root = tf_stats_->ShowGraphNode("scope", opts); - GraphNodeProto expected; EXPECT_EQ(root.children(0).name(), "DW"); EXPECT_GT(root.children(0).tensor_value().value_double_size(), 10); EXPECT_EQ(root.children(1).name(), "DW2"); diff --git a/tensorflow/core/util/stat_summarizer_test.cc b/tensorflow/core/util/stat_summarizer_test.cc index 1feedf99cbe..4553559e7a9 100644 --- a/tensorflow/core/util/stat_summarizer_test.cc +++ b/tensorflow/core/util/stat_summarizer_test.cc @@ -70,7 +70,6 @@ versions { TF_ASSERT_OK(session->Run(run_options, {}, {"myconstant:0"}, {}, &outputs, &run_metadata)); - StatSummarizerOptions opts; StatSummarizer stats(graph_def); stats.ProcessStepStats(run_metadata.step_stats());