From d0520b9b3a0eaf9dadc6cdb57ed42906e577d32e Mon Sep 17 00:00:00 2001 From: Tai Ly Date: Tue, 19 Sep 2023 21:30:18 +0000 Subject: Add variable_name to tensors Signed-off-by: Tai Ly Change-Id: Ia142c8b1a9e0869daefb3eef71100fd0c2a0effc --- include/tosa_serialization_handler.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'include/tosa_serialization_handler.h') diff --git a/include/tosa_serialization_handler.h b/include/tosa_serialization_handler.h index 814395b..e5448bc 100644 --- a/include/tosa_serialization_handler.h +++ b/include/tosa_serialization_handler.h @@ -150,14 +150,16 @@ public: const flatbuffers::Vector* shape, DType dtype, const flatbuffers::Vector* data, - const bool variable = false, - const bool is_unranked = false); + const bool variable = false, + const bool is_unranked = false, + const flatbuffers::String* variable_name = NULL); TosaSerializationTensor(const std::string& name, const std::vector& shape, DType dtype, const std::vector& data, - const bool variable = false, - const bool is_unranked = false); + const bool variable = false, + const bool is_unranked = false, + const std::string& variable_name = ""); TosaSerializationTensor(); ~TosaSerializationTensor(); @@ -186,6 +188,10 @@ public: { return _is_unranked; } + const std::string GetVariableName() const + { + return _variable_name; + } // modifier void SetDtype(DType dtype) @@ -225,6 +231,7 @@ private: bool _variable; /* is this a variable tensor */ std::vector _data; /* data array */ bool _is_unranked; /* whether this is an unranked tensor */ + std::string _variable_name; /* name for variable tensors */ }; class TosaSerializationOperator -- cgit v1.2.1