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

Method DecodeFromProto

tensorflow/core/lib/histogram/histogram.cc:71–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71bool Histogram::DecodeFromProto(const HistogramProto& proto) {
72 if ((proto.bucket_size() != proto.bucket_limit_size()) ||
73 (proto.bucket_size() == 0)) {
74 return false;
75 }
76 min_ = proto.min();
77 max_ = proto.max();
78 num_ = proto.num();
79 sum_ = proto.sum();
80 sum_squares_ = proto.sum_squares();
81 custom_bucket_limits_.clear();
82 custom_bucket_limits_.insert(custom_bucket_limits_.end(),
83 proto.bucket_limit().begin(),
84 proto.bucket_limit().end());
85 bucket_limits_ = custom_bucket_limits_;
86 buckets_.clear();
87 buckets_.insert(buckets_.end(), proto.bucket().begin(), proto.bucket().end());
88 return true;
89}
90
91void Histogram::Clear() {
92 min_ = bucket_limits_[bucket_limits_.size() - 1];

Callers 5

ValidateFunction · 0.80
TESTFunction · 0.80
EqHistogramsFunction · 0.80
EqHistogramsFunction · 0.80
TEST_FFunction · 0.80

Calls 9

bucket_sizeMethod · 0.80
numMethod · 0.80
minMethod · 0.45
maxMethod · 0.45
sumMethod · 0.45
clearMethod · 0.45
insertMethod · 0.45
endMethod · 0.45
beginMethod · 0.45

Tested by 5

ValidateFunction · 0.64
TESTFunction · 0.64
EqHistogramsFunction · 0.64
EqHistogramsFunction · 0.64
TEST_FFunction · 0.64