aboutsummaryrefslogtreecommitdiff
path: root/reference_model/src/tensor.h
diff options
context:
space:
mode:
authorMatthew Sloyan <matthew.sloyan@arm.com>2022-09-26 13:31:43 +0100
committerMatthew Sloyan <matthew.sloyan@arm.com>2022-10-07 16:02:07 +0100
commitba5fad356a926d5e1c6e0fe6b546a310230cc5a8 (patch)
tree10e3e127c091da90d591253fd55e8566c0b61e7a /reference_model/src/tensor.h
parenta0848c6edbf37034e280a670bdd2f990fdf796da (diff)
downloadreference_model-ba5fad356a926d5e1c6e0fe6b546a310230cc5a8.tar.gz
Add IModelRunner interface to TOSA Reference Model
* Added IModelRunner interface using pimpl idiom, which allows a user to initialize, configure and run the model. * Added unit tests for IModelRunner. * Added doctest as third-party submodule. * Added user options to specify paths for dependencies. * Moved general func_config functions to separate utility, which removes cxxopts dependency. Signed-off-by: Matthew Sloyan <matthew.sloyan@arm.com> Change-Id: If42f1f82cd6dadf18911a48dcd5fa579b719aff2
Diffstat (limited to 'reference_model/src/tensor.h')
-rw-r--r--reference_model/src/tensor.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/reference_model/src/tensor.h b/reference_model/src/tensor.h
index ede42a9..6b7d5f1 100644
--- a/reference_model/src/tensor.h
+++ b/reference_model/src/tensor.h
@@ -228,6 +228,16 @@ public:
virtual int writeToNpyFile(const char* filename) const;
virtual int copyValueFrom(Tensor* tensor) = 0;
+ virtual int readfromVector(const std::vector<float>& vals);
+ virtual int readfromVector(const std::vector<int32_t>& vals);
+ virtual int readfromVector(const std::vector<int64_t>& vals);
+ virtual int readfromVector(const std::vector<unsigned char>& vals);
+
+ virtual int writeToVector(std::vector<float>& vals);
+ virtual int writeToVector(std::vector<int32_t>& vals);
+ virtual int writeToVector(std::vector<int64_t>& vals);
+ virtual int writeToVector(std::vector<unsigned char>& vals);
+
const char* bool_to_str(bool in) const
{
static const char* true_str = "true";