From: Rob Hughes Date: Wed, 6 Nov 2019 09:36:29 +0000 (+0000) Subject: Escape angle brackets in dot file labels X-Git-Tag: submit/tizen/20200316.035456~71 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=362e03214ceceb95ec30d530ff84e8d9efc198d7;p=platform%2Fupstream%2Farmnn.git Escape angle brackets in dot file labels This was a bug that meant invalid dot files were produced due to MemCopy layers having a name including "->". Change-Id: If9f5b13d433f6a7328bf0ad8c7ec89cdce2462b0 Signed-off-by: Rob Hughes --- diff --git a/src/armnnUtils/DotSerializer.cpp b/src/armnnUtils/DotSerializer.cpp index b3d3d10..1f36cf7 100644 --- a/src/armnnUtils/DotSerializer.cpp +++ b/src/armnnUtils/DotSerializer.cpp @@ -6,6 +6,7 @@ #include "DotSerializer.hpp" #include +#include #include #include @@ -23,6 +24,14 @@ std::string Indent(int numSpaces) } return ss.str(); } + +std::string Escape(std::string s) +{ + boost::replace_all(s, "<", "\\<"); + boost::replace_all(s, ">", "\\>"); + return s; +} + } //namespace @@ -151,7 +160,7 @@ NodeContent::~NodeContent() } for (auto & content : m_Contents) { - ss << content; + ss << Escape(content); ss << "\\l"; } ss << "}\"";