aboutsummaryrefslogtreecommitdiff
path: root/Utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Utils.cpp')
-rw-r--r--Utils.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/Utils.cpp b/Utils.cpp
index 6fd1a785..873dce4a 100644
--- a/Utils.cpp
+++ b/Utils.cpp
@@ -408,7 +408,18 @@ void DumpTensor(const std::string& dumpDir,
const unsigned int numDimensions = tensor.GetNumDimensions();
const armnn::TensorShape shape = tensor.GetShape();
+ if (!shape.AreAllDimensionsSpecified())
+ {
+ fileStream << "Cannot dump tensor elements: not all dimensions are specified" << std::endl;
+ return;
+ }
fileStream << "# Number of elements " << tensor.GetNumElements() << std::endl;
+
+ if (numDimensions == 0)
+ {
+ fileStream << "# Shape []" << std::endl;
+ return;
+ }
fileStream << "# Shape [" << shape[0];
for (unsigned int d = 1; d < numDimensions; ++d)
{