From 50d13bb34a53752ea3b605e428bd1cba727d8b0d Mon Sep 17 00:00:00 2001 From: Johan Gunnarsson Date: Fri, 21 Feb 2025 11:28:04 +0100 Subject: [PATCH] MLBEDSW-10430: RawWriter: Adjust ReadOnly tensor assert IsConstant will return false when the size is 0. This will trigger the assert for networks without weights, such as networks with only pool ops. Signed-off-by: Johan Gunnarsson Change-Id: Iaadeffd654a3817ccf8ada796f76300ee319e957 --- ethosu/regor/compiler/raw_writer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ethosu/regor/compiler/raw_writer.cpp b/ethosu/regor/compiler/raw_writer.cpp index dc39d61a..b2a85013 100644 --- a/ethosu/regor/compiler/raw_writer.cpp +++ b/ethosu/regor/compiler/raw_writer.cpp @@ -1,5 +1,5 @@ // -// SPDX-FileCopyrightText: Copyright 2024 Arm Limited and/or its affiliates +// SPDX-FileCopyrightText: Copyright 2024-2025 Arm Limited and/or its affiliates // // SPDX-License-Identifier: Apache-2.0 // @@ -156,7 +156,7 @@ void RawWriter::SerialiseCommandStreamTensor(const Tensor *tensor) void RawWriter::SerialiseReadOnlyTensor(const Tensor *tensor) { - assert(tensor->IsConstant()); + assert(tensor->View().HasBuffer()); // read_only buffer and buffer size auto blob = tensor->View().Buffer()->Data(); -- GitLab