| 191 | |
| 192 | template<typename V> |
| 193 | bool StreamReader<V>::readMatrices( |
| 194 | uint32 num_examples, MatrixPtrList<V>* matrices, std::vector<Example>* examples) { |
| 195 | num_examples_ = num_examples; |
| 196 | examples_ = examples; if (examples_) examples_->clear(); |
| 197 | matrices_ = matrices; if (matrices_) matrices_->clear(); |
| 198 | vslots_.resize(data_.ignore_feature_group() ? 2 : kSlotIDmax); |
| 199 | bool ret = false; |
| 200 | if (data_.format() == DataConfig::TEXT) { |
| 201 | ret = readMatricesFromText(); |
| 202 | } else if (data_.format() == DataConfig::PROTO) { |
| 203 | ret = readMatricesFromProto(); |
| 204 | } else { |
| 205 | LL << "unknonw data format: " << data_.DebugString(); |
| 206 | } |
| 207 | vslots_.clear(); |
| 208 | return ret; |
| 209 | } |
| 210 | |
| 211 | |
| 212 | } // namespace PS |
no test coverage detected