diff options
author | Jerry Ge <jerry.ge@arm.com> | 2023-04-26 22:31:11 +0000 |
---|---|---|
committer | Jerry Ge <jerry.ge@arm.com> | 2023-05-12 22:20:01 +0000 |
commit | ab8d234bdc64896297ceceb7b97ce74a783ac7ae (patch) | |
tree | 04260fe903e6b5aaba6201168bd8ee325a7cba75 | |
parent | b413a957b5a1bd4270a6d1270ad9a705d96864c8 (diff) | |
download | serialization_lib-ab8d234bdc64896297ceceb7b97ce74a783ac7ae.tar.gz |
Support updating serialized tensor shape for shape inference
Signed-off-by: Jerry Ge <jerry.ge@arm.com>
Change-Id: I44b9fd37e8890bfec02c647857a43bcb6800da80
-rw-r--r-- | include/tosa_serialization_handler.h | 9 |
1 files changed, 9 insertions, 0 deletions
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 */ |