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

Method writeToFile

src/util/shared_array_inl.h:214–223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

212
213template <typename V>
214bool SArray<V>::writeToFile(SizeR range, const string& file_name) const {
215 if (range.empty()) return true;
216 CHECK(range.valid());
217 CHECK_LE(range.end(), size_);
218
219 File* file = File::open(file_name, "w");
220 size_t length = range.size() * sizeof(V);
221 return (file->write(ptr_.get(), length) == length
222 && file->flush() && file->close());
223}
224
225template <typename V>
226void SArray<V>::uncompressFrom(const char* src, size_t src_size) {

Callers 4

TESTFunction · 0.45
saveModelMethod · 0.45
writeToBinFileMethod · 0.45
writeToBinFileMethod · 0.45

Calls 8

validMethod · 0.80
writeMethod · 0.80
flushMethod · 0.80
closeMethod · 0.80
emptyMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45
getMethod · 0.45

Tested by 1

TESTFunction · 0.36