[TFLite] add the datatype according to meson option
authorHyoungJoo Ahn <hello.ahn@samsung.com>
Fri, 21 Feb 2020 08:28:21 +0000 (17:28 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Sun, 23 Feb 2020 10:05:05 +0000 (02:05 -0800)
with the new version of TFLite, the new data types have been added. Since it's not supported and we cannot check the version of tensorflow at the build time, we have to set the datatype before building this package. I'd like to suggest adding a field at meson_option and allow user to set it.

Signed-off-by: HyoungJoo Ahn <hello.ahn@samsung.com>
meson.build
meson_options.txt

index ddc7dba..c5b5a2b 100644 (file)
@@ -170,6 +170,13 @@ if get_option('enable-tensorflow-lite')
   else
     error('Cannot find tensorflow-lite')
   endif
+
+  tflite_datatype_arr = get_option('enable-additional-tflite-types')
+  foreach tflite_data_type : tflite_datatype_arr
+    message('data type [@0@] is added for TFLite'.format(tflite_data_type))
+    add_project_arguments('-DTFLITE_@0@=1'.format(tflite_data_type), language: ['c', 'cpp'])
+  endforeach
+
 endif
 
 # PyTorch
index d9b7210..d45504d 100644 (file)
@@ -25,3 +25,4 @@ option('enable-tizen-sensor', type: 'boolean', value: false)
 option('enable-edgetpu', type: 'boolean', value: false)
 option('enable-armnn', type: 'boolean', value: false)
 option('enable-openvino', type: 'boolean', value: false)
+option('enable-additional-tflite-types', type : 'array', choices : ['INT16','COMPLEX64','INT8','FLOAT16'], value : ['INT16','COMPLEX64','INT8'])