Fix empty shaped serialized tensor

Signed-off-by: Jerry Ge <jerry.ge@arm.com>
Change-Id: I512181cca1a3b1ed5d9a5435dbf11d7efcdbc2a5
diff --git a/src/tosa_serialization_handler.cpp b/src/tosa_serialization_handler.cpp
index d782213..25ac5df 100644
--- a/src/tosa_serialization_handler.cpp
+++ b/src/tosa_serialization_handler.cpp
@@ -26,7 +26,10 @@
 {
     _dtype = dtype;
 
-    std::copy(shape->begin(), shape->end(), std::back_inserter(_shape));
+    if (shape)
+    {
+        std::copy(shape->begin(), shape->end(), std::back_inserter(_shape));
+    }
 
     assert(name);
     _name = name->str();