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

Method RebuildTreeWeights

tensorflow/core/lib/random/weighted_picker.cc:167–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165}
166
167void WeightedPicker::RebuildTreeWeights() {
168 for (int l = num_levels_ - 2; l >= 0; l--) {
169 int32* level = level_[l];
170 int32* children = level_[l + 1];
171 for (int i = 0; i < LevelSize(l); i++) {
172 level[i] = children[2 * i] + children[2 * i + 1];
173 }
174 }
175}
176
177void WeightedPicker::Append(int32 weight) {
178 Resize(num_elements() + 1);

Callers 1

ResizeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected