From ab8d234bdc64896297ceceb7b97ce74a783ac7ae Mon Sep 17 00:00:00 2001 From: Jerry Ge Date: Wed, 26 Apr 2023 22:31:11 +0000 Subject: Support updating serialized tensor shape for shape inference Signed-off-by: Jerry Ge Change-Id: I44b9fd37e8890bfec02c647857a43bcb6800da80 --- include/tosa_serialization_handler.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/tosa_serialization_handler.h b/include/tosa_serialization_handler.h index 5d39228..04dac52 100644 --- a/include/tosa_serialization_handler.h +++ b/include/tosa_serialization_handler.h @@ -155,6 +155,15 @@ public: { _data = std::move(data); } + void SetDimSize(size_t dim, uint32_t new_size) + { + if (dim < 0 || dim >= _shape.size()) + { + printf("dim is out of bound\n"); + assert(0); + } + _shape[dim] = new_size; + } private: DType _dtype; /* data type enumeration, see tosa_isa_generated.h */ -- cgit v1.2.1