@@ -33,9 +33,7 @@ namespace tensorflow {
3333typedef FunctionDefHelper FDH ;
3434
3535Status GetOpSig (const string& op, const OpDef** sig) {
36- Status s;
37- *sig = OpRegistry::Global ()->LookUp (op, &s);
38- return s;
36+ return OpRegistry::Global ()->LookUpOpDef (op, sig);
3937}
4038
4139REGISTER_OP (" One" )
@@ -643,12 +641,12 @@ TEST(FunctionLibraryDefinitionTest, LookUp) {
643641 *proto.add_function () = test::function::XTimesTwo ();
644642 FunctionLibraryDefinition lib_def (proto);
645643
646- Status s ;
647- EXPECT_EQ ( lib_def.LookUp (" XTimes16" , &s), nullptr );
644+ const OpDef* op_def ;
645+ EXPECT_TRUE (! lib_def.LookUpOpDef (" XTimes16" , &op_def). ok () );
648646
649- auto found = lib_def.LookUp (" XTimesTwo" , &s );
650- ASSERT_NE (found , nullptr );
651- EXPECT_EQ (found ->DebugString (),
647+ TF_EXPECT_OK ( lib_def.LookUpOpDef (" XTimesTwo" , &op_def) );
648+ ASSERT_NE (op_def , nullptr );
649+ EXPECT_EQ (op_def ->DebugString (),
652650 test::function::XTimesTwo ().signature ().DebugString ());
653651}
654652
@@ -662,14 +660,15 @@ TEST(FunctionLibraryDefinitionTest, AddFunctionDef) {
662660 TF_EXPECT_OK (lib_def.AddFunctionDef (test::function::WXPlusB ()));
663661
664662 // Test lookup of first function.
665- Status s ;
666- auto first = lib_def.LookUp (" XTimesTwo" , &s );
663+ const OpDef* first ;
664+ TF_EXPECT_OK ( lib_def.LookUpOpDef (" XTimesTwo" , &first) );
667665 ASSERT_NE (first, nullptr );
668666 EXPECT_EQ (first->DebugString (),
669667 test::function::XTimesTwo ().signature ().DebugString ());
670668
671669 // Test lookup of second function.
672- auto second = lib_def.LookUp (" WXPlusB" , &s);
670+ const OpDef* second;
671+ TF_EXPECT_OK (lib_def.LookUpOpDef (" WXPlusB" , &second));
673672 ASSERT_NE (second, nullptr );
674673 EXPECT_EQ (second->DebugString (),
675674 test::function::WXPlusB ().signature ().DebugString ());
@@ -689,18 +688,14 @@ TEST(FunctionLibraryDefinitionTest, ToProto) {
689688 FunctionLibraryDefinition lib_def2 (proto2);
690689
691690 // Test that the first function exists in both libraries.
692- Status s;
693- auto f1 = lib_def1.LookUp (" XTimesTwo" , &s);
694- TF_EXPECT_OK (s);
695- auto f2 = lib_def1.LookUp (" XTimesTwo" , &s);
696- TF_EXPECT_OK (s);
691+ const OpDef *f1, *f2, *f3, *f4;
692+ TF_EXPECT_OK (lib_def1.LookUpOpDef (" XTimesTwo" , &f1));
693+ TF_EXPECT_OK (lib_def2.LookUpOpDef (" XTimesTwo" , &f2));
697694 EXPECT_EQ (f1->DebugString (), f2->DebugString ());
698695
699696 // Test that the second function exists in both libraries.
700- auto f3 = lib_def1.LookUp (" WXPlusB" , &s);
701- TF_EXPECT_OK (s);
702- auto f4 = lib_def1.LookUp (" WXPlusB" , &s);
703- TF_EXPECT_OK (s);
697+ TF_EXPECT_OK (lib_def1.LookUpOpDef (" WXPlusB" , &f3));
698+ TF_EXPECT_OK (lib_def2.LookUpOpDef (" WXPlusB" , &f4));
704699 EXPECT_EQ (f3->DebugString (), f4->DebugString ());
705700}
706701
0 commit comments