aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Ge <jerry.ge@arm.com>2023-04-26 22:31:11 +0000
committerJerry Ge <jerry.ge@arm.com>2023-05-12 22:20:01 +0000
commitab8d234bdc64896297ceceb7b97ce74a783ac7ae (patch)
tree04260fe903e6b5aaba6201168bd8ee325a7cba75
parentb413a957b5a1bd4270a6d1270ad9a705d96864c8 (diff)
downloadserialization_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.h9
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 */