Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[onert/test] Apply strict build to tflite_comparator #14515

Merged
merged 1 commit into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/tools/tflite_comparator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ list(APPEND SOURCES "src/args.cc")

add_executable(tflite_comparator ${SOURCES})

target_link_libraries(tflite_comparator nnfw_common)
target_link_libraries(tflite_comparator nnfw-dev)
target_link_libraries(tflite_comparator nnfw_lib_tflite nnfw_lib_misc)
target_link_libraries(tflite_comparator arser)
Expand Down
5 changes: 3 additions & 2 deletions tests/tools/tflite_comparator/src/tflite_comparator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void randomBoolData(benchmark::RandomGenerator &randgen, std::vector<uint8_t> &d
inline uint64_t num_elems(const nnfw_tensorinfo *ti)
{
uint64_t n = 1;
for (uint32_t i = 0; i < ti->rank; ++i)
for (int32_t i = 0; i < ti->rank; ++i)
{
n *= ti->dims[i];
}
Expand Down Expand Up @@ -172,7 +172,7 @@ template <>
bool isClose(const uint8_t *ref_buf, const std::vector<uint8_t> &act_buf, uint32_t index)
{
// TODO better way for handling quant error?
auto tolerance = static_cast<uint64_t>(nnfw::misc::EnvVar("TOLERANCE").asInt(0));
auto tolerance = nnfw::misc::EnvVar("TOLERANCE").asInt(0);
bool match = true;

for (uint32_t e = 0; e < act_buf.size() / sizeof(uint8_t); e++)
Expand Down Expand Up @@ -294,6 +294,7 @@ int main(const int argc, char **argv)
break;
case NNFW_TYPE_TENSOR_QUANT16_SYMM_SIGNED:
randomData<int16_t>(randgen, inputs[i]);
break;
case NNFW_TYPE_TENSOR_FLOAT32:
randomData<float>(randgen, inputs[i]);
break;
Expand Down