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

Function TEST_F

tensorflow/core/profiler/internal/tfprof_stats_test.cc:83–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81};
82
83TEST_F(TFProfStatsTest, CustomOpType) {
84 Options opts(3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, "name",
85 {kTrainableVarType}, // accout_type_regexes
86 {".*"}, {""}, {".*"}, {""}, false,
87 {"params", "bytes", "micros", "float_ops"}, "", {});
88 const GraphNodeProto& root = tf_stats_->ShowGraphNode("scope", opts);
89
90 GraphNodeProto expected;
91 CHECK(protobuf::TextFormat::ParseFromString(
92 "name: \"_TFProfRoot\"\ntotal_exec_micros: 13\ntotal_requested_bytes: "
93 "2560\ntotal_parameters: 451\nchildren {\n name: \"DW\"\n exec_micros: "
94 "2\n requested_bytes: 1280\n parameters: 162\n total_exec_micros: 2\n "
95 " total_requested_bytes: 1280\n total_parameters: 162\n devices: "
96 "\"/job:localhost/replica:0/task:0/gpu:0\"\n cpu_exec_micros: 2\n "
97 "total_cpu_exec_micros: 2\n run_count: 1\n total_run_count: 1\n "
98 "total_definition_count: 1\n peak_bytes: 1280\n residual_bytes: 1280\n "
99 " output_bytes: 1280\n total_peak_bytes: 1280\n total_residual_bytes: "
100 "1280\n total_output_bytes: 1280\n}\nchildren {\n name: \"DW2\"\n "
101 "exec_micros: 11\n requested_bytes: 1280\n parameters: 288\n "
102 "total_exec_micros: 11\n total_requested_bytes: 1280\n "
103 "total_parameters: 288\n devices: "
104 "\"/job:localhost/replica:0/task:0/gpu:0\"\n cpu_exec_micros: 11\n "
105 "total_cpu_exec_micros: 11\n run_count: 1\n total_run_count: 1\n "
106 "total_definition_count: 1\n peak_bytes: 1280\n residual_bytes: 1280\n "
107 " output_bytes: 1280\n total_peak_bytes: 1280\n total_residual_bytes: "
108 "1280\n total_output_bytes: 1280\n}\nchildren {\n name: \"ScalarW\"\n "
109 "parameters: 1\n total_parameters: 1\n total_definition_count: "
110 "1\n}\ntotal_cpu_exec_micros: 13\ntotal_run_count: "
111 "2\ntotal_definition_count: 3\ntotal_peak_bytes: "
112 "2560\ntotal_residual_bytes: 2560\ntotal_output_bytes: 2560\n",
113 &expected));
114 EXPECT_EQ(expected.DebugString(), root.DebugString());
115
116 EXPECT_EQ(root.DebugString(), TestToFromProto("scope", opts));
117}
118
119TEST_F(TFProfStatsTest, CheckPointOpType) {
120 Options opts(3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, "name",

Callers

nothing calls this directly

Calls 1

DebugStringMethod · 0.45

Tested by

no test coverage detected