"Fossies" - the Fresh Open Source Software Archive

Member "qt-everywhere-src-6.3.1/qtwebengine/src/3rdparty/chromium/third_party/tflite-support/patches/0001-Fix-signed-comparison-in-base_vision_task_api.h.patch" (8 Jun 2022, 1962 Bytes) of package /linux/misc/qt-everywhere-src-6.3.1.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Diff source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 From c8bdfe3f6b3ce087c36b551d668b97101f620bdc Mon Sep 17 00:00:00 2001
    2 From: Daniel Rubery <drubery@chromium.org>
    3 Date: Thu, 6 May 2021 11:45:48 -0700
    4 Subject: [PATCH] Fix signed comparison in base_vision_task_api.h
    5 
    6 ---
    7  .../cc/task/vision/core/base_vision_task_api.h                | 4 ++--
    8  1 file changed, 2 insertions(+), 2 deletions(-)
    9 
   10 diff --git a/third_party/tflite-support/src/tensorflow_lite_support/cc/task/vision/core/base_vision_task_api.h b/third_party/tflite-support/src/tensorflow_lite_support/cc/task/vision/core/base_vision_task_api.h
   11 index 3d1359685f3f..c787876bec33 100644
   12 --- a/third_party/tflite-support/src/tensorflow_lite_support/cc/task/vision/core/base_vision_task_api.h
   13 +++ b/third_party/tflite-support/src/tensorflow_lite_support/cc/task/vision/core/base_vision_task_api.h
   14 @@ -204,7 +204,7 @@ class BaseVisionTaskApi
   15          if (normalization_options.num_values == 1) {
   16            float mean_value = normalization_options.mean_values[0];
   17            float inv_std_value = (1.0f / normalization_options.std_values[0]);
   18 -          for (int i = 0; i < input_data_byte_size / sizeof(uint8);
   19 +          for (size_t i = 0; i < input_data_byte_size / sizeof(uint8);
   20                 i++, input_data++, normalized_input_data++) {
   21              *normalized_input_data =
   22                  inv_std_value * (static_cast<float>(*input_data) - mean_value);
   23 @@ -214,7 +214,7 @@ class BaseVisionTaskApi
   24                1.0f / normalization_options.std_values[0],
   25                1.0f / normalization_options.std_values[1],
   26                1.0f / normalization_options.std_values[2]};
   27 -          for (int i = 0; i < input_data_byte_size / sizeof(uint8);
   28 +          for (size_t i = 0; i < input_data_byte_size / sizeof(uint8);
   29                 i++, input_data++, normalized_input_data++) {
   30              *normalized_input_data = inv_std_values[i % 3] *
   31                                       (static_cast<float>(*input_data) -
   32 -- 
   33 2.31.1.607.g51e8a6a459-goog
   34