MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle-Lite / SaveToFile

Method SaveToFile

lite/model_parser/naive_buffer/naive_buffer.cc:37–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35}
36
37void BinaryTable::SaveToFile(const std::string &filename) const {
38 FILE *fp = fopen(filename.c_str(), "wb");
39 CHECK(fp) << "Unable to open file: " << filename;
40 if (fwrite(reinterpret_cast<const char *>(data()), 1, size(), fp) != size()) {
41 fclose(fp);
42 LOG(FATAL) << "Write file error: " << filename;
43 }
44 fclose(fp);
45}
46
47void BinaryTable::AppendToFile(const std::string &filename) const {
48 FILE *fp = fopen(filename.c_str(), "ab");

Callers 3

SaveParamNaiveFunction · 0.80
TESTFunction · 0.80
TESTFunction · 0.80

Calls 3

dataFunction · 0.50
sizeFunction · 0.50
c_strMethod · 0.45

Tested by 2

TESTFunction · 0.64
TESTFunction · 0.64