MCPcopy Create free account
hub / github.com/FeiYull/TensorRT-Alpha / readBinaryFile

Method readBinaryFile

utils/utils.cpp:12–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10}
11
12std::vector<uint8_t> utils::readBinaryFile(const std::string& file)
13{
14
15 std::ifstream in(file, std::ios::in | std::ios::binary);
16 if (!in.is_open())
17 return {};
18
19 in.seekg(0, std::ios::end);
20 size_t length = in.tellg();
21
22 std::vector<uint8_t> data;
23 if (length > 0) {
24 in.seekg(0, std::ios::beg);
25 data.resize(length);
26
27 in.read((char*)&data[0], length);
28 }
29 in.close();
30 return data;
31}
32
33
34std::vector<unsigned char> utils::loadModel(const std::string& file)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected