Skip to content

Commit

Permalink
fix: replace forbidden assert() with TF_LITE_ASSERT()
Browse files Browse the repository at this point in the history
  • Loading branch information
rkuester committed Aug 2, 2024
1 parent df9852a commit 4784ada
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions tensorflow/lite/micro/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,9 @@ cc_library(
name = "static_vector",
hdrs = ["static_vector.h"],
copts = micro_copts(),
deps = [
"//tensorflow/lite/kernels:op_macros",
],
)

cc_library(
Expand Down
4 changes: 3 additions & 1 deletion tensorflow/lite/micro/static_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#include <cassert>
#include <cstddef>

#include "tensorflow/lite/kernels/op_macros.h" // for TF_LITE_ASSERT

namespace tflite {

template <typename T, std::size_t MaxSize>
Expand Down Expand Up @@ -67,7 +69,7 @@ class StaticVector {
}

void push_back(const T& t) {
assert(!full());
TF_LITE_ASSERT(!full());
*end() = t;
++size_;
}
Expand Down

0 comments on commit 4784ada

Please sign in to comment.