MCPcopy Create free account
hub / github.com/NVIDIA/DALI / SaveToFile

Function SaveToFile

dali/operators/reader/loader/coco_loader.cc:97–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95
96template <typename T>
97void SaveToFile(const std::vector<T> &input, const std::string path) {
98 if (input.empty())
99 return;
100 std::ofstream file(path, std::ios_base::binary | std::ios_base::out);
101 DALI_ENFORCE(file, "CocoReader meta file error while saving: " + path);
102
103 unsigned size = input.size();
104 Write(file, size, path.c_str());
105 Write(file, make_cspan(input), path.c_str());
106 DALI_ENFORCE(file.good(), make_string("Error writing to path: ", path));
107}
108
109template <>
110void SaveToFile(const std::vector<RLEMaskPtr> &input, const std::string path) {

Callers 1

Calls 6

WriteFunction · 0.85
make_cspanFunction · 0.85
make_stringFunction · 0.50
emptyMethod · 0.45
sizeMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected