[mlgo][nfc] Set logging level to warning or higher for TFLite
authorMircea Trofin <mtrofin@google.com>
Thu, 8 Sep 2022 19:10:56 +0000 (12:10 -0700)
committerMircea Trofin <mtrofin@google.com>
Thu, 8 Sep 2022 19:10:56 +0000 (12:10 -0700)
llvm/lib/Analysis/TFLiteUtils.cpp

index 96eabb2..9c43193 100644 (file)
@@ -27,6 +27,7 @@
 #include "tensorflow/lite/model.h"
 #include "tensorflow/lite/model_builder.h"
 #include "tensorflow/lite/op_resolver.h"
+#include "tensorflow/lite/logger.h"
 
 #include <cassert>
 #include <numeric>
@@ -100,6 +101,8 @@ TFModelEvaluatorImpl::TFModelEvaluatorImpl(
     function_ref<TensorSpec(size_t)> GetOutputSpecs, size_t OutputSpecsSize,
     const char *Tags = "serve")
     : Input(InputSpecs.size()), Output(OutputSpecsSize) {
+  // INFO and DEBUG messages could be numerous and not particularly interesting
+  tflite::LoggerOptions::SetMinimumLogSeverity(tflite::TFLITE_LOG_WARNING);
   // FIXME: make ErrorReporter a member (may also need subclassing
   // StatefulErrorReporter) to easily get the latest error status, for
   // debugging.