projects
/
platform
/
core
/
ml
/
nntrainer.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4037f36
)
[Trivial] Fix svace issue
author
SeoHyungjun
<hyungjun.seo@samsung.com>
Fri, 16 Dec 2022 07:14:16 +0000
(16:14 +0900)
committer
Jijoong Moon
<jijoong.moon@samsung.com>
Thu, 22 Dec 2022 03:11:23 +0000
(12:11 +0900)
The for loop runs only once due to a return.
To resolve this issue, we added a conditional statement to run return when it is not ML_ERROR_NONE.
Signed-off-by: SeoHyungjun <hyungjun.seo@samsung.com>
api/capi/src/nntrainer.cpp
patch
|
blob
|
history
diff --git
a/api/capi/src/nntrainer.cpp
b/api/capi/src/nntrainer.cpp
index
b5ace04
..
efe71d8
100644
(file)
--- a/
api/capi/src/nntrainer.cpp
+++ b/
api/capi/src/nntrainer.cpp
@@
-1286,7
+1286,10
@@
int ml_train_model_get_weight(ml_train_model_h model, const char *layer_name,
for (unsigned int i = 0; i < dims.size(); ++i) {
status = ml_tensors_data_set_tensor_data(
*weight, i, w[i], dims[i].getDataLen() * sizeof(float));
- return status;
+ if (status != ML_ERROR_NONE) {
+ ml_tensors_data_destroy(weight);
+ return status;
+ }
}
return status;