diff options
author | Jerry Ge <jerry.ge@arm.com> | 2024-04-01 17:05:10 +0000 |
---|---|---|
committer | Jerry Ge <jerry.ge@arm.com> | 2024-04-02 21:39:09 +0000 |
commit | 12159fc6fb776908f48fbda9c74cf34980540e4f (patch) | |
tree | 54408e7a10502a347fc7afa25b665c60d696b4d1 /reference_model/src/tensor.h | |
parent | 9a97eb6cd6aab5eb58eb7860faa9fea305e37c07 (diff) | |
download | reference_model-12159fc6fb776908f48fbda9c74cf34980540e4f.tar.gz |
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
Diffstat (limited to 'reference_model/src/tensor.h')
-rw-r--r-- | reference_model/src/tensor.h | 26 |
1 files changed, 26 insertions, 0 deletions
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 @@ public: 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 @@ protected: const std::string tensorName; const DType serializationDtype; std::vector<int> shape; + std::vector<int> shapeValue; const TOSA_REF_TYPE tensorDtype; bool isValid; bool isSubgraphInput; |