diff options
author | Tai Ly <tai.ly@arm.com> | 2023-09-07 20:49:09 +0000 |
---|---|---|
committer | Eric Kunze <eric.kunze@arm.com> | 2023-09-15 18:10:01 +0000 |
commit | cf84bc9cccbd5dc2fceae1a81c579e41be3c9a06 (patch) | |
tree | aff6bab02c36c095a62381ac8f68d185bdccbe73 /reference_model/src/tensor.h | |
parent | 00f55bf46fe36bebe44e1365becbeb1e0d9e90c9 (diff) | |
download | reference_model-cf84bc9cccbd5dc2fceae1a81c579e41be3c9a06.tar.gz |
[reference_model] Support StatefulOps and the tests for CallOnceOp
Signed-off-by: Jerry Ge <jerry.ge@arm.com>
Change-Id: I03cb878736ccd7e1f5e1f780d7171949a19a9de2
Diffstat (limited to 'reference_model/src/tensor.h')
-rw-r--r-- | reference_model/src/tensor.h | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/reference_model/src/tensor.h b/reference_model/src/tensor.h index fe7336d..203cfec 100644 --- a/reference_model/src/tensor.h +++ b/reference_model/src/tensor.h @@ -42,21 +42,27 @@ public: int setIsSubgraphOutput(); int setIsParentGraphOutput(); - int getIsParentGraphOutput() const + bool getIsParentGraphOutput() const { return isParentGraphOutput; } + int setIsVariable(); - int getIsSubgraphInput() const + bool getIsSubgraphInput() const { return isSubgraphInput; } - int getIsSubgraphOutput() const + bool getIsSubgraphOutput() const { return isSubgraphOutput; } + bool getIsVariable() const + { + return isVariable; + } + int setProducer(GraphNode* node); int addConsumer(GraphNode* node); @@ -269,18 +275,19 @@ public: return in ? true_str : false_str; } - virtual int allocate() = 0; - virtual int deallocate() = 0; - virtual bool is_allocated() = 0; + virtual int allocate() = 0; + virtual int deallocate() = 0; + virtual bool is_allocated() const = 0; protected: const std::string tensorName; const DType serializationDtype; std::vector<int> shape; const TOSA_REF_TYPE tensorDtype; - int isValid; - int isSubgraphInput; - int isSubgraphOutput; + bool isValid; + bool isSubgraphInput; + bool isSubgraphOutput; + bool isVariable; bool isAllocated; bool isParentGraphOutput; @@ -332,7 +339,7 @@ public: return 0; } - virtual bool is_allocated() + virtual bool is_allocated() const { if (tensor) { |