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

Method loadModel

utils/utils.cpp:34–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32
33
34std::vector<unsigned char> utils::loadModel(const std::string& file)
35{
36 std::ifstream in(file, std::ios::in | std::ios::binary);
37 if (!in.is_open())
38 {
39 return {};
40 }
41 in.seekg(0, std::ios::end);
42 size_t length = in.tellg();
43
44 std::vector<uint8_t> data;
45 if (length > 0)
46 {
47 in.seekg(0, std::ios::beg);
48 data.resize(length);
49 in.read((char*)&data[0], length);
50 }
51 in.close();
52 return data;
53}
54
55std::string utils::getSystemTimeStr()
56{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected