diff --git a/ethosu/regor/tosa/tosa_reader.cpp b/ethosu/regor/tosa/tosa_reader.cpp index 3e403482ab8c6c3f4e404802a0f98a9a4d7f1d8f..4c15079dbbe9e4747de4f8f23d974265fd28a6e2 100644 --- a/ethosu/regor/tosa/tosa_reader.cpp +++ b/ethosu/regor/tosa/tosa_reader.cpp @@ -372,7 +372,13 @@ void TosaReader::LoadGraphs(const tosaFb::TosaGraph *model, std::list *in) -> GraphApi::GraphShape { - GraphApi::GraphShape out; + GraphApi::GraphShape out{}; + // Interpret a missing shape vector as scalar, rank 0 shape. + if ( in == nullptr ) + { + out.count = 0; + return out; + } const auto &buf = SafeDeref(in, "No shape vector"); tosa_assert(buf.size() <= std::size(out.axisNHWC), "Shape rank exceeds maximum allowed"); for ( int i = 0; i < int(buf.size()); i++ )