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

Function Validate

tensorflow/core/lib/histogram/histogram_test.cc:25–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23namespace histogram {
24
25static void Validate(const Histogram& h) {
26 string s1 = h.ToString();
27 LOG(ERROR) << s1;
28
29 HistogramProto proto_with_zeroes;
30 h.EncodeToProto(&proto_with_zeroes, true);
31 Histogram h2;
32 EXPECT_TRUE(h2.DecodeFromProto(proto_with_zeroes));
33 string s2 = h2.ToString();
34 LOG(ERROR) << s2;
35
36 EXPECT_EQ(s1, s2);
37
38 HistogramProto proto_no_zeroes;
39 h.EncodeToProto(&proto_no_zeroes, false);
40 LOG(ERROR) << proto_no_zeroes.DebugString();
41 Histogram h3;
42 EXPECT_TRUE(h3.DecodeFromProto(proto_no_zeroes));
43 string s3 = h3.ToString();
44 LOG(ERROR) << s3;
45
46 EXPECT_EQ(s1, s3);
47}
48
49TEST(Histogram, Empty) {
50 Histogram h;

Callers 11

RunAndValidateMethod · 0.85
RunAndValidateMethod · 0.85
tfprof_stats.ccFile · 0.85
TESTFunction · 0.85
TEST_PFunction · 0.85
DoTestMethod · 0.85
DoTestForStringsMethod · 0.85
DoTestMethod · 0.85
DoTestForStringsMethod · 0.85
ProcessStepStatsMethod · 0.85

Calls 4

DecodeFromProtoMethod · 0.80
ToStringMethod · 0.45
EncodeToProtoMethod · 0.45
DebugStringMethod · 0.45

Tested by

no test coverage detected