summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author박세희/On-Device Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>2020-04-01 11:20:16 +0900
committerGitHub Enterprise <noreply-CODE@samsung.com>2020-04-01 11:20:16 +0900
commit6b29fdb927fb328d3d1201c2f9c0b815706eff08 (patch)
treee94fd1c13cf52a485b8fd7ef561d88eacc2fa9fc
parent6fb8d3d19c4526deff3d8bc590ab8e17d04ec922 (diff)
downloadnnfw-6b29fdb927fb328d3d1201c2f9c0b815706eff08.tar.gz
nnfw-6b29fdb927fb328d3d1201c2f9c0b815706eff08.tar.bz2
nnfw-6b29fdb927fb328d3d1201c2f9c0b815706eff08.zip
[tfldum] Show Model and OpCode version (#10809)
This will show Model and OpCode version numbers Signed-off-by: SaeHie Park <saehie.park@samsung.com>
-rw-r--r--compiler/tfldump/src/Dump.cpp8
-rw-r--r--compiler/tfldump/src/Read.cpp1
-rw-r--r--compiler/tfldump/src/Read.h4
3 files changed, 12 insertions, 1 deletions
diff --git a/compiler/tfldump/src/Dump.cpp b/compiler/tfldump/src/Dump.cpp
index e3618f227..dc61852bd 100644
--- a/compiler/tfldump/src/Dump.cpp
+++ b/compiler/tfldump/src/Dump.cpp
@@ -116,6 +116,10 @@ void dump_model(std::ostream &os, const tflite::Model *model)
auto tensors = reader.tensors();
auto operators = reader.operators();
+ // dump model version
+ os << "Model version: " << reader.version() << std::endl;
+ os << std::endl;
+
// dump operator_codes
os << "Operator Codes: [order] OpCodeName (OpCode Enum)" << std::endl;
int32_t opcode_index = 0;
@@ -123,8 +127,10 @@ void dump_model(std::ostream &os, const tflite::Model *model)
{
tflite::BuiltinOperator op_code = opcode->builtin_code();
auto op_name = tflread::opcode_name(opcode);
+ auto op_version = opcode->version();
- os << "[" << opcode_index << "] " << op_name << " (code: " << op_code << ")" << std::endl;
+ os << "[" << opcode_index << "] " << op_name << " (code: " << op_code
+ << ", version: " << op_version << ")" << std::endl;
opcode_index++;
}
diff --git a/compiler/tfldump/src/Read.cpp b/compiler/tfldump/src/Read.cpp
index 7dfce2701..2844839be 100644
--- a/compiler/tfldump/src/Read.cpp
+++ b/compiler/tfldump/src/Read.cpp
@@ -78,6 +78,7 @@ const char *tensor_name(const tflite::Tensor *tensor)
Reader::Reader(const tflite::Model *model)
{
+ _version = model->version();
_subgraphs = model->subgraphs();
_buffers = model->buffers();
diff --git a/compiler/tfldump/src/Read.h b/compiler/tfldump/src/Read.h
index 3c344e3d0..804f2c162 100644
--- a/compiler/tfldump/src/Read.h
+++ b/compiler/tfldump/src/Read.h
@@ -59,6 +59,8 @@ public:
Reader() = delete;
public:
+ uint32_t version() const { return _version; }
+
const std::vector<const tflite::OperatorCode *> &opcodes() { return _op_codes; }
const TFliteBuffers_t *buffers() { return _buffers; }
const TFliteTensors_t *tensors() { return _tensors; }
@@ -76,6 +78,8 @@ public:
bool select_subgraph(uint32_t subgraph);
private:
+ uint32_t _version;
+
const TFliteSubGraphs_t *_subgraphs{nullptr};
const TFliteBuffers_t *_buffers{nullptr};
const TFliteTensors_t *_tensors{nullptr};