MCPcopy Create free account
hub / github.com/antmachineintelligence/mtgbmcode / PartitionLabel

Method PartitionLabel

python-package/compile/src/io/metadata.cpp:127–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125}
126
127void Metadata::PartitionLabel(const std::vector<data_size_t>& used_indices) {
128 if (used_indices.empty()) {
129 return;
130 }
131 auto old_label = label_;
132 num_data_ = static_cast<data_size_t>(used_indices.size());
133 label_ = std::vector<label_t>(num_data_);
134 #pragma omp parallel for schedule(static)
135 for (data_size_t i = 0; i < num_data_; ++i) {
136 label_[i] = old_label[used_indices[i]];
137 }
138 old_label.clear();
139}
140
141void Metadata::CheckOrPartition(data_size_t num_all_data, const std::vector<data_size_t>& used_data_indices) {
142 if (used_data_indices.empty()) {

Callers 1

LoadFromBinFileMethod · 0.45

Calls 3

emptyMethod · 0.45
sizeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected