[llvm] a219a8a - [mlgo][nfc] Set logging level to warning or higher for TFLite

Mircea Trofin via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 8 12:11:52 PDT 2022


Author: Mircea Trofin
Date: 2022-09-08T12:10:56-07:00
New Revision: a219a8a82223f49f12e37bc0e49842e22dc5ad77

URL: https://github.com/llvm/llvm-project/commit/a219a8a82223f49f12e37bc0e49842e22dc5ad77
DIFF: https://github.com/llvm/llvm-project/commit/a219a8a82223f49f12e37bc0e49842e22dc5ad77.diff

LOG: [mlgo][nfc] Set logging level to warning or higher for TFLite

Added: 
    

Modified: 
    llvm/lib/Analysis/TFLiteUtils.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/TFLiteUtils.cpp b/llvm/lib/Analysis/TFLiteUtils.cpp
index 96eabb2b2c384..9c43193476f0c 100644
--- a/llvm/lib/Analysis/TFLiteUtils.cpp
+++ b/llvm/lib/Analysis/TFLiteUtils.cpp
@@ -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.


        


More information about the llvm-commits mailing list