This reverts commit 5b2ec7840a
.
This commit is contained in:
parent
949fee3cfc
commit
e7861c7455
@ -5,7 +5,6 @@
|
||||
|
||||
#include <fstream>
|
||||
#include <xml_parse_utils.h>
|
||||
#include <array>
|
||||
|
||||
namespace InferenceEngine {
|
||||
namespace details {
|
||||
@ -20,14 +19,14 @@ inline size_t GetIRVersion(pugi::xml_node& root) {
|
||||
* @return IR version, 0 if model does represent IR
|
||||
*/
|
||||
size_t GetIRVersion(std::istream& model) {
|
||||
std::array<char, 512> header = {};
|
||||
|
||||
model.seekg(0, model.beg);
|
||||
model.read(header.data(), header.size());
|
||||
const int header_size = 128;
|
||||
std::string header(header_size, ' ');
|
||||
model.read(&header[0], header_size);
|
||||
model.seekg(0, model.beg);
|
||||
|
||||
pugi::xml_document doc;
|
||||
auto res = doc.load_buffer(header.data(), header.size(), pugi::parse_default | pugi::parse_fragment, pugi::encoding_utf8);
|
||||
auto res = doc.load_string(header.c_str(), pugi::parse_default | pugi::parse_fragment);
|
||||
|
||||
if (res == pugi::status_ok) {
|
||||
pugi::xml_node root = doc.document_element();
|
||||
|
@ -199,19 +199,10 @@ TEST(NetReaderTest, IRSupportModelDetection) {
|
||||
</net>
|
||||
)V0G0N";
|
||||
|
||||
// For supported model detection the IRReader uses first 512 bytes from model.
|
||||
// These headers shifts the trim place.
|
||||
|
||||
std::string headers[] = {
|
||||
R"()",
|
||||
R"(<!-- <net name="Network" version="10" some_attribute="Test Attribute"> -->)",
|
||||
R"(<!-- <net name="Network" version="10" some_attribute="Test Attribute"> -->
|
||||
<!-- <net name="Network" version="10" some_attribute="Test Attribute"> -->
|
||||
<!-- <net name="Network" version="10" some_attribute="Test Attribute"> -->
|
||||
<!-- <net name="Network" version="10" some_attribute="Test Attribute"> -->
|
||||
<!-- The quick brown fox jumps over the lazy dog -->
|
||||
<!-- The quick brown fox jumps over the lazy dog -->
|
||||
<!-- The quick brown fox jumps over the lazy dog -->)"
|
||||
R"(<!-- <net name="Network" version="100500"> -->)",
|
||||
R"(<!-- <net name="Network" version="10" some_attribute="Test Attribute"> -->)"
|
||||
};
|
||||
|
||||
InferenceEngine::Blob::CPtr weights;
|
||||
|
Loading…
Reference in New Issue
Block a user