Add variable_name to tensors
Signed-off-by: Tai Ly <tai.ly@arm.com>
Change-Id: Ia142c8b1a9e0869daefb3eef71100fd0c2a0effc
diff --git a/include/tosa_serialization_handler.h b/include/tosa_serialization_handler.h
index 875c9d1..e89ad0d 100644
--- a/include/tosa_serialization_handler.h
+++ b/include/tosa_serialization_handler.h
@@ -150,14 +150,16 @@
const flatbuffers::Vector<int32_t>* shape,
DType dtype,
const flatbuffers::Vector<uint8_t>* 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<int32_t>& shape,
DType dtype,
const std::vector<uint8_t>& 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 @@
{
return _is_unranked;
}
+ const std::string GetVariableName() const
+ {
+ return _variable_name;
+ }
// modifier
void SetDtype(DType dtype)
@@ -225,6 +231,7 @@
bool _variable; /* is this a variable tensor */
std::vector<uint8_t> _data; /* data array */
bool _is_unranked; /* whether this is an unranked tensor */
+ std::string _variable_name; /* name for variable tensors */
};
class TosaSerializationOperator