Support updating serialized tensor shape for shape inference
Signed-off-by: Jerry Ge <jerry.ge@arm.com>
Change-Id: I44b9fd37e8890bfec02c647857a43bcb6800da80
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 @@
{
_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 */