diff options
Diffstat (limited to 'Utils.cpp')
-rw-r--r-- | Utils.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -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) { |