MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / TEST

Function TEST

tensorflow/compiler/jit/node_matchers_test.cc:49–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49TEST(NodeMatchers, CheckAgainstConstant) {
50 Scope root = Scope::NewRootScope().ExitOnError();
51 Output placeholder =
52 ops::Placeholder(root.WithOpName("placeholder"), DT_FLOAT);
53
54 EXPECT_THAT(placeholder.node(), NodeWith(Op("Placeholder")));
55 EXPECT_THAT(placeholder.node(), NodeWith(Name("placeholder")));
56 EXPECT_THAT(placeholder.node(),
57 NodeWith(Op("Placeholder"), Name("placeholder")));
58 EXPECT_THAT(placeholder.node(),
59 NodeWith(Name("placeholder"), Op("Placeholder")));
60 EXPECT_THAT(placeholder.node(), NodeWith(Inputs()));
61 EXPECT_THAT(placeholder.node(),
62 NodeWith(Op("Placeholder"), Name("placeholder"), Inputs()));
63
64 EXPECT_EQ(Explain(placeholder.node(), NodeWith(Op("Add"))),
65 "\nexpected op Add but found Placeholder");
66 EXPECT_EQ(Explain(placeholder.node(), NodeWith(Name("add"))),
67 "\nexpected name add but found placeholder");
68 EXPECT_EQ(Explain(placeholder.node(), NodeWith(Inputs(Out(NodeWith())))),
69 "\nexpected 1 inputs but node has 0");
70}
71
72TEST(NodeMatchers, CheckAgainstBinary) {
73 Scope root = Scope::NewRootScope().ExitOnError();

Callers

nothing calls this directly

Calls 15

NodeWithFunction · 0.85
CtrlDepsFunction · 0.85
ConstantValueFunction · 0.85
AttrFunction · 0.85
ExitOnErrorMethod · 0.80
WithOpNameMethod · 0.80
OpFunction · 0.70
NameFunction · 0.70
InputsFunction · 0.70
ExplainFunction · 0.70
OutFunction · 0.70
ConstFunction · 0.70

Tested by

no test coverage detected