Show actual runtime value of shapeType tensors
* Enable showing actual runtime shapeType tensor value when the
--dump_intermediates=1 flag is on
Signed-off-by: Jerry Ge <jerry.ge@arm.com>
Change-Id: Ibd5aa8aa27505364fbbf9d1addd0bdef0deda885
diff --git a/reference_model/src/tensor.h b/reference_model/src/tensor.h
index 26c6aa7..f13de0e 100644
--- a/reference_model/src/tensor.h
+++ b/reference_model/src/tensor.h
@@ -109,6 +109,31 @@
return;
}
+ void setShapeValue(std::vector<int>& shapeValue)
+ {
+ for (auto dim : shapeValue)
+ {
+ this->shapeValue.push_back(dim);
+ }
+ return;
+ }
+
+ int getShapeValueSize() const
+ {
+ return this->shapeValue.size();
+ }
+
+ std::string getShapeValueAsString() const
+ {
+ std::string shape_str("[");
+ for (auto& dim : shapeValue)
+ {
+ shape_str += (std::to_string(dim) + ", ");
+ }
+ shape_str.append("]");
+ return shape_str;
+ }
+
std::string getShapeAsString() const
{
std::string shape_str("[");
@@ -297,6 +322,7 @@
const std::string tensorName;
const DType serializationDtype;
std::vector<int> shape;
+ std::vector<int> shapeValue;
const TOSA_REF_TYPE tensorDtype;
bool isValid;
bool isSubgraphInput;