Skip to content

Commit

Permalink
[coverity] fix coverity issues
Browse files Browse the repository at this point in the history
This commit fixes coverity issues of auto_causes_copy
	- 1739360
	- 1740106

Self-evaluation:

Build test: [X]Passed [ ]Failed [ ]Skipped
Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Eunju Yang <[email protected]>
  • Loading branch information
EunjuYang committed Mar 19, 2024
1 parent 6be8e84 commit 1bb2f8b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions nntrainer/tensor/task_executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ namespace nntrainer {
std::atomic_int32_t TaskExecutor::ids(1);

TaskExecutor::TaskExecutor(const std::string &n) :
name(n),
run_thread(true),
wait_complete(false) {
name(n), run_thread(true), wait_complete(false) {
task_thread = std::thread([&]() {
ml_logd("Task Thread(%s): start thread", name.c_str());
while (run_thread) {
Expand All @@ -44,7 +42,7 @@ TaskExecutor::TaskExecutor(const std::string &n) :
lk.unlock();

const auto &id = std::get<int>(task_info);
auto callback = std::get<CompleteCallback>(task_info);
const auto &callback = std::get<CompleteCallback>(task_info);

auto status = worker(task_info);
callback(id, status);
Expand Down
6 changes: 2 additions & 4 deletions nntrainer/utils/node_exporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ Exporter::Exporter() : stored_result(nullptr), is_exported(false) {
*
*/
Exporter::Exporter(flatbuffers::FlatBufferBuilder *fbb) :
fbb(fbb),
stored_result(nullptr),
is_exported(false) {}
fbb(fbb), stored_result(nullptr), is_exported(false) {}
#endif

/**
Expand Down Expand Up @@ -265,7 +263,7 @@ void Exporter::saveTflResult(
assert(strides.size() == POOLING2D_DIM);
auto poolSize = std::get<std::vector<props::PoolSize>>(props);
assert(poolSize.size() == POOLING2D_DIM);
auto padding = std::get<props::Padding2D>(props).get();
const auto &padding = std::get<props::Padding2D>(props).get();
assert(padding == "same" || padding == "valid");

switch (poolingType.get()) {
Expand Down

0 comments on commit 1bb2f8b

Please sign in to comment.