From f8423e4087ee81bddc1ecbed36d0a10e8d5df8e4 Mon Sep 17 00:00:00 2001 From: Robert Ogden Date: Wed, 16 Apr 2025 15:49:14 -0700 Subject: [PATCH] fix compiler warnings in mst_solver.h --- .../src/tensorflow_text/core/kernels/mst_solver.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/third_party/tensorflow-text/src/tensorflow_text/core/kernels/mst_solver.h b/third_party/tensorflow-text/src/tensorflow_text/core/kernels/mst_solver.h index d17662607f88f..4b597e0379e1a 100644 --- a/third_party/tensorflow-text/src/tensorflow_text/core/kernels/mst_solver.h +++ b/third_party/tensorflow-text/src/tensorflow_text/core/kernels/mst_solver.h @@ -503,9 +503,9 @@ void MstSolver::ContractCycle(Index node) { for (const auto &node_and_arc : cycle_) { // Set the |score_offset| to the cost of breaking the cycle by replacing the // arc currently directed into the |cycle_node|. - const Index cycle_node = node_and_arc.first; + const Index local_cycle_node = node_and_arc.first; const Score score_offset = -node_and_arc.second->score; - MergeInboundArcs(cycle_node, score_offset, contracted_node); + MergeInboundArcs(local_cycle_node, score_offset, contracted_node); } } @@ -585,7 +585,6 @@ absl::Status MstSolver::ExpansionPhase(absl::Span argmax) { argmax[target] = arc.source - 1; } } - DCHECK_GE(num_roots, 1); // Even when |forest_| is false, |num_roots| can still be more than 1. While // the root score penalty discourages structures with multiple root arcs, it -- 2.49.0.805.g082f7c87e0-goog