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

Function TEST

tensorflow/core/api_def/update_api_def_test.cc:26–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24namespace {
25
26TEST(UpdateApiDefTest, TestRemoveDocSingleOp) {
27 const string op_def_text = R"opdef(
28REGISTER_OP("Op1")
29 .Input("a: T")
30 .Output("output: T")
31 .Attr("b: type")
32 .SetShapeFn(shape_inference::UnchangedShape);
33)opdef";
34
35 const string op_def_text_with_doc = R"opdef(
36REGISTER_OP("Op1")
37 .Input("a: T")
38 .Output("output: T")
39 .Attr("b: type")
40 .SetShapeFn(shape_inference::UnchangedShape)
41 .Doc(R"doc(
42Summary for Op1.
43
44Description
45for Op1.
46
47b : Description for b.
48a: Description for a.
49output: Description for output.
50)doc");
51)opdef";
52
53 const string op_text = R"(
54name: "Op1"
55input_arg {
56 name: "a"
57 description: "Description for a."
58}
59output_arg {
60 name: "output"
61 description: "Description for output."
62}
63attr {
64 name: "b"
65 description: "Description for b."
66}
67summary: "Summary for Op1."
68description: "Description\nfor Op1."
69)";
70 OpDef op;
71 protobuf::TextFormat::ParseFromString(op_text, &op); // NOLINT
72
73 EXPECT_EQ(op_def_text,
74 RemoveDoc(op, op_def_text_with_doc, 0 /* start_location */));
75}
76
77TEST(UpdateApiDefTest, TestRemoveDocMultipleOps) {
78 const string op_def_text = R"opdef(

Callers

nothing calls this directly

Calls 3

RemoveDocFunction · 0.85
CreateApiDefFunction · 0.85
findMethod · 0.45

Tested by

no test coverage detected