MCPcopy Create free account
hub / github.com/Samsung/ONE / TEST

Function TEST

compiler/tfinfo/src/TensorInfoParser.test.cpp:39–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37};
38
39TEST(NNKIT_TF_PARSER, success_case)
40{
41 // clang-format off
42 TensorInfo tc_list[] = {
43 {"input, in/placeholder_1:0, TF_FLOAT, [3, 2] # correct case",
44 ParsedTensor::Kind::Input, "in/placeholder_1:0", TF_FLOAT, 2, {3, 2} },
45
46 {"output, aa/bb.cc:0, TF_FLOAT, []", // empty shape
47 ParsedTensor::Kind::Output, "aa/bb.cc:0", TF_FLOAT, 0, {0, 0} },
48
49 {"output, aa:0, TF_FLOAT, [] # this is a comment", // string with comment
50 ParsedTensor::Kind::Output, "aa:0", TF_FLOAT, 0, {0, 0} },
51
52 {"output, ...:0, TF_FLOAT, [] # this is a comment", // name test. TF works with this name
53 ParsedTensor::Kind::Output, "...:0", TF_FLOAT, 0, {0, 0} },
54 };
55 // clang-format on
56
57 for (auto tc : tc_list)
58 {
59 std::unique_ptr<ParsedTensor> tensor = parse_line(tc.line);
60
61 ASSERT_EQ(tensor->kind(), tc.kind);
62 ASSERT_EQ(tensor->name(), tc.name);
63 ASSERT_EQ(tensor->dtype(), tc.dtype);
64 ASSERT_EQ(tensor->shape().rank(), tc.rank);
65 for (int d = 0; d < tc.rank; d++)
66 ASSERT_EQ(tensor->shape().dim(d), tc.dim[d]);
67 }
68}
69
70TEST(NNKIT_TF_PARSER, failure_case)
71{

Callers

nothing calls this directly

Calls 8

parse_lineFunction · 0.70
kindMethod · 0.45
nameMethod · 0.45
dtypeMethod · 0.45
rankMethod · 0.45
shapeMethod · 0.45
dimMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected