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

Method SetAllWeights

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

Source from the content-addressed store, hash-verified

143}
144
145void WeightedPicker::SetAllWeights(int32 weight) {
146 // Initialize leaves
147 int32* leaves = level_[num_levels_ - 1];
148 for (int i = 0; i < N_; i++) leaves[i] = weight;
149 for (int i = N_; i < LevelSize(num_levels_ - 1); i++) leaves[i] = 0;
150
151 // Now sum up towards the root
152 RebuildTreeWeights();
153}
154
155void WeightedPicker::SetWeightsFromArray(int N, const int32* weights) {
156 Resize(N);

Callers 2

TESTFunction · 0.80
TestPickerFunction · 0.80

Calls

no outgoing calls

Tested by 2

TESTFunction · 0.64
TestPickerFunction · 0.64