aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Hughes <robert.hughes@arm.com>2019-11-06 09:36:29 +0000
committerMatteo Martincigh <matteo.martincigh@arm.com>2019-11-07 09:34:48 +0000
commit362e03214ceceb95ec30d530ff84e8d9efc198d7 (patch)
treea803126df42d2f06749c9793d88bbec39d7f8f31
parent5dc816e7d027170992e45d22ae11ae3000de9244 (diff)
downloadarmnn-362e03214ceceb95ec30d530ff84e8d9efc198d7.tar.gz
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 <robert.hughes@arm.com>
-rw-r--r--src/armnnUtils/DotSerializer.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/armnnUtils/DotSerializer.cpp b/src/armnnUtils/DotSerializer.cpp
index b3d3d103af..1f36cf73ae 100644
--- a/src/armnnUtils/DotSerializer.cpp
+++ b/src/armnnUtils/DotSerializer.cpp
@@ -6,6 +6,7 @@
#include "DotSerializer.hpp"
#include <boost/assert.hpp>
+#include <boost/algorithm/string/replace.hpp>
#include <sstream>
#include <cstring>
@@ -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 << "}\"";