From 6e15b64b57b043bf221ede95f13a04cb2853d158 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=9C=A4=ED=98=84=EC=8B=9D/On-Device=20Lab=28SR=29/Princip?= =?utf8?q?al=20Engineer/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Wed, 7 Aug 2019 15:39:22 +0900 Subject: [PATCH] [tf2tflite] driver can takes customop.conf as param (#6272) * [tf2tflite] driver can takes customop.conf as param This commit enable Driver to take customop.conf as the 5th param. Signed-off-by: Hyun Sik Yoon * optional param: '--customop ' * remove strcmp, parse conf before calling import * nyi error --- compiler/tf2tflite/src/Driver.cpp | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/compiler/tf2tflite/src/Driver.cpp b/compiler/tf2tflite/src/Driver.cpp index a6dba61..8174b44 100644 --- a/compiler/tf2tflite/src/Driver.cpp +++ b/compiler/tf2tflite/src/Driver.cpp @@ -74,6 +74,12 @@ struct LoggingContext } }; +void print_help() +{ + std::cerr << "Usage: tf2tflite " << std::endl + << "Options: --customop " << std::endl; +} + } // namespace #define LOGGER(name) \ @@ -85,9 +91,10 @@ int main(int argc, char **argv) { LOGGER(l); - if (argc != 4) + // TODO We need better args parsing in future + if (!(argc == 4 or argc == 6)) { - std::cerr << "ERROR: tf2tflite " << std::endl; + print_help(); return 255; } @@ -117,6 +124,20 @@ int main(int argc, char **argv) } } + if (argc == 6) // optional parameter: path of customop.conf + { + if (std::string{argv[4]} == "--customop") + { + // TODO fill info from customop.conf + throw std::runtime_error("Not yet implemented"); + } + else + { + print_help(); + return 255; + } + } + std::cout << "Read '" << info_path << "' - Done" << std::endl; std::cout << "Import from '" << tf_path << "'" << std::endl; -- 2.7.4