0004-do-not-use-absl-any.patch 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. From c7a885174c0489e6a6a819b4bae23311226e43ee Mon Sep 17 00:00:00 2001
  2. From: Robert Ogden <robertogden@chromium.org>
  3. Date: Wed, 25 May 2022 10:53:34 -0700
  4. Subject: [PATCH 4/9] do not use absl any
  5. ---
  6. .../cc/task/vision/core/frame_buffer.h | 27 -------------------
  7. 1 file changed, 27 deletions(-)
  8. diff --git a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/vision/core/frame_buffer.h b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/vision/core/frame_buffer.h
  9. index c1289673cb82b..1668447393e9e 100644
  10. --- a/third_party/tflite_support/src/tensorflow_lite_support/cc/task/vision/core/frame_buffer.h
  11. +++ b/third_party/tflite_support/src/tensorflow_lite_support/cc/task/vision/core/frame_buffer.h
  12. @@ -27,7 +27,6 @@ limitations under the License.
  13. #include "absl/strings/str_cat.h" // from @com_google_absl
  14. #include "absl/time/clock.h" // from @com_google_absl
  15. #include "absl/time/time.h" // from @com_google_absl
  16. -#include "absl/types/any.h" // from @com_google_absl
  17. #include "absl/types/optional.h" // from @com_google_absl
  18. #include "tensorflow_lite_support/cc/port/integral_types.h"
  19. #include "tensorflow_lite_support/cc/port/statusor.h"
  20. @@ -250,31 +249,6 @@ class FrameBuffer {
  21. return {};
  22. }
  23. - // Returns the tag associated to the tag_key.
  24. - absl::any GetTag(const std::string& tag_key) const {
  25. - auto iter = tags_.find(tag_key);
  26. - if (iter != tags_.end()) {
  27. - return iter->second;
  28. - }
  29. - return absl::any();
  30. - }
  31. -
  32. - // Inserts or updates the tags map with key value pair (tag_key, tag_value).
  33. - void InsertOrUpdateTag(const std::string& tag_key, absl::any tag_value) {
  34. - tags_[tag_key] = std::move(tag_value);
  35. - }
  36. -
  37. - // Inserts the key value pair (tag_key, tag_value) into tags map. If the
  38. - // tag_key already exists, an internal error will return.
  39. - absl::Status InsertTag(const std::string& tag_key, absl::any tag_value) {
  40. - auto iter = tags_.emplace(tag_key, tag_value);
  41. - if (iter.second) {
  42. - return absl::OkStatus();
  43. - }
  44. - return absl::InternalError(absl::StrCat(
  45. - "tag_key already exists in tags.tag_key was not inserted: ", tag_key));
  46. - }
  47. -
  48. // Returns FrameBuffer dimension.
  49. const Dimension dimension() const { return dimension_; }
  50. @@ -289,7 +263,6 @@ class FrameBuffer {
  51. private:
  52. std::vector<Plane> planes_;
  53. - std::map<std::string, absl::any> tags_;
  54. Dimension dimension_;
  55. Format format_;
  56. Orientation orientation_;
  57. --
  58. 2.36.1.124.g0e6072fb45-goog