MCPcopy Create free account
hub / github.com/dmlc/parameter_server / value

Method value

src/data/slot_reader.h:51–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49};
50
51template<typename V> SArray<V> SlotReader::value(int slot_id) const {
52 SArray<V> val;
53 if (nnzEle(slot_id) == 0) return val;
54 for (int i = 0; i < data_.file_size(); ++i) {
55 string file = cacheName(ithFile(data_, i), slot_id) + ".value";
56 SArray<char> comp; CHECK(comp.readFromFile(file));
57 SArray<float> uncomp; uncomp.uncompressFrom(comp);
58 size_t n = val.size();
59 val.resize(n+uncomp.size());
60 for (size_t i = 0; i < uncomp.size(); ++i) val[n+i] = uncomp[i];
61 }
62 CHECK_EQ(val.size(), nnzEle(slot_id)) << slot_id;
63 return val;
64}
65
66} // namespace PS

Callers 15

TESTFunction · 0.45
TESTFunction · 0.45
updateWeightMethod · 0.45
evaluateMethod · 0.45
preprocessDataMethod · 0.45
computeGradientMethod · 0.45
updateDualMethod · 0.45
runMethod · 0.45
computeGradientMethod · 0.45
evaluateMethod · 0.45
computeMethod · 0.45
computeGradientMethod · 0.45

Calls 6

ithFileFunction · 0.85
file_sizeMethod · 0.80
readFromFileMethod · 0.45
uncompressFromMethod · 0.45
sizeMethod · 0.45
resizeMethod · 0.45

Tested by 2

TESTFunction · 0.36
TESTFunction · 0.36