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

Function TEST_F

tensorflow/core/graph/graph_constructor_test.cc:218–235  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

216 });
217
218TEST_F(GraphConstructorTest, InvalidNodeName) {
219 auto expect_invalid_name = [this](const char* name) {
220 ExpectError(strings::StrCat("node { name: '", name, "' op: 'ABC' }"),
221 {"Node name contains invalid characters"});
222 };
223
224 expect_invalid_name("a:b");
225 expect_invalid_name("_abc"); // Can't start with '_'
226 // Name is a\b, but proto text format escapes slashes so we use a\\b here.
227 expect_invalid_name(R"(a\\b)");
228 expect_invalid_name("/a");
229 expect_invalid_name("-a");
230
231 ExpectOK("node { name: 'a-bc_' op: 'ABC' }");
232 ExpectOK("node { name: 'a-B.0/.c_' op: 'ABC' }");
233 ExpectOK("node { name: '0123' op: 'ABC' }");
234 ExpectOK("node { name: '.0123' op: 'ABC' }");
235}
236
237TEST_F(GraphConstructorTest, InvalidSourceNodeName) {
238 ExpectError(

Callers

nothing calls this directly

Calls 15

SafeTensorIdClass · 0.85
NodeDefBuilderClass · 0.85
num_edgesMethod · 0.80
listMethod · 0.80
LookUpOpDefMethod · 0.80
function_nameMethod · 0.80
gradientMethod · 0.80
set_versionsMethod · 0.80
ImportGraphDefFunction · 0.70
TensorIdClass · 0.70

Tested by

no test coverage detected