diff options
author | 2018-04-02 14:46:13 -0700 | |
---|---|---|
committer | 2018-04-02 14:48:43 -0700 | |
commit | 8f543ed7e3e2775aedb5c953f7f5cbff2139663a (patch) | |
tree | 06040261b7965ed031a6588eb1a0a15d4ea0e299 /tensorflow/core/profiler | |
parent | 817882c28fd6f0dbbbf35b6ac0764ccbd38430d0 (diff) |
Replaced calls to deprecated tensorflow::StringPiece methods with their
tensorflow::str_util equivalents.
This will allow the deprecated methods to be removed.
PiperOrigin-RevId: 191350894
Diffstat (limited to 'tensorflow/core/profiler')
-rw-r--r-- | tensorflow/core/profiler/internal/advisor/tfprof_advisor_test.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/tensorflow/core/profiler/internal/advisor/tfprof_advisor_test.cc b/tensorflow/core/profiler/internal/advisor/tfprof_advisor_test.cc index e968b9c97e..96b6cc30bd 100644 --- a/tensorflow/core/profiler/internal/advisor/tfprof_advisor_test.cc +++ b/tensorflow/core/profiler/internal/advisor/tfprof_advisor_test.cc @@ -16,6 +16,7 @@ limitations under the License. #include "tensorflow/core/profiler/internal/advisor/tfprof_advisor.h" #include "tensorflow/core/lib/io/path.h" +#include "tensorflow/core/lib/strings/str_util.h" #include "tensorflow/core/platform/env.h" #include "tensorflow/core/platform/test.h" @@ -82,8 +83,8 @@ TEST_F(TFProfAdvisorTest, OperationChecker) { (*options.mutable_checkers())[kCheckers[1]]; AdviceProto advice = advisor_->Advise(options); EXPECT_EQ(advice.checkers().at(kCheckers[1]).reports_size(), 1); - EXPECT_TRUE(StringPiece(advice.checkers().at(kCheckers[1]).reports(0)) - .contains("NCHW")); + EXPECT_TRUE(str_util::StrContains( + advice.checkers().at(kCheckers[1]).reports(0), "NCHW")); } TEST_F(TFProfAdvisorTest, UtilizationChecker) { @@ -91,16 +92,17 @@ TEST_F(TFProfAdvisorTest, UtilizationChecker) { (*options.mutable_checkers())[kCheckers[0]]; AdviceProto advice = advisor_->Advise(options); EXPECT_EQ(advice.checkers().at(kCheckers[0]).reports_size(), 1); - EXPECT_TRUE(StringPiece(advice.checkers().at(kCheckers[0]).reports(0)) - .contains("low utilization")); + EXPECT_TRUE(str_util::StrContains( + advice.checkers().at(kCheckers[0]).reports(0), "low utilization")); } TEST_F(TFProfAdvisorTest, ExpensiveOperationChecker) { AdvisorOptionsProto options; (*options.mutable_checkers())[kCheckers[2]]; AdviceProto advice = advisor_->Advise(options); - EXPECT_TRUE(StringPiece(advice.checkers().at(kCheckers[2]).reports(0)) - .contains("top 1 operation type: Conv2D")); + EXPECT_TRUE( + str_util::StrContains(advice.checkers().at(kCheckers[2]).reports(0), + "top 1 operation type: Conv2D")); } } // namespace tfprof |