MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / Write

Method Write

tensorflow/lite/experimental/writer/writer_lib.cc:269–281  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

267}
268
269TfLiteStatus InterpreterWriter::Write(const std::string& filename) {
270 std::unique_ptr<uint8_t[]> buffer;
271 size_t size;
272 TF_LITE_ENSURE_STATUS(GetBuffer(&buffer, &size));
273
274 FILE* fp = fopen(filename.c_str(), "wb");
275 if (!fp) return kTfLiteError;
276
277 if (fwrite(buffer.get(), 1, size, fp) != size) return kTfLiteError;
278 if (fclose(fp)) return kTfLiteError;
279
280 return kTfLiteOk;
281}
282
283TfLiteStatus InterpreterWriter::RegisterCustomWriter(
284 const std::string& custom_name, CustomWriter custom_writer) {

Callers 2

TESTFunction · 0.45
mainFunction · 0.45

Calls 4

GetBufferFunction · 0.85
c_strMethod · 0.80
fopenFunction · 0.50
getMethod · 0.45

Tested by 1

TESTFunction · 0.36