Skip to content

Commit

Permalink
Fix coverity defects (Samsung#11759)
Browse files Browse the repository at this point in the history
- WID 1733311
- WID 1733310
- WID 1733309
- WID 1733308

ONE-DCO-1.0-Signed-off-by: Chunseok Lee <[email protected]>
  • Loading branch information
chunseoklee authored and Seunghui98 committed Oct 25, 2023
1 parent e04213f commit c6472fe
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions onert-micro/luci-interpreter/pal/common/PALL2Pool2D.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ inline void L2Pool(const PoolParams &params, const luci_interpreter::RuntimeShap
filter_count++;
}
}
assert(filter_count != 0);
const float l2pool_result = std::sqrt(sum_squares / filter_count);
output_data[offset(output_shape.dimsData(), batch, out_y, out_x, channel)] =
activationFunctionWithMinMax(l2pool_result, params.float_activation_min,
Expand Down
1 change: 1 addition & 0 deletions onert-micro/luci-interpreter/src/kernels/DepthToSpace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ void execute_kernel_CircleDepthToSpace(const circle::Operator *cur_op,
#ifndef DIS_FLOAT
case DataType::FLOAT32:
{
assert(block_size != 0);
luci_interpreter_pal::DepthToSpace(
block_size, kernels::getTensorRuntimeShape(kernel.input(), runtime_graph),
kernels::getTensorData<float>(runtime_graph->getDataByTensor(kernel.input())),
Expand Down
4 changes: 2 additions & 2 deletions onert-micro/luci-interpreter/src/kernels/Softmax.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void evalQuantize(const circle::Tensor *input, const circle::Tensor *output,

if (Tensor::element_type(input) == DataType::S16)
{
int left_shift = params.input_left_shift;
int left_shift = 0;
double input_scale_beta_rescale =
static_cast<double>(Tensor::scale(input)) * static_cast<double>(beta) /
(10.0 / 65535.0); // scale the input_diff such that [-65535, 0]
Expand All @@ -99,7 +99,7 @@ void evalQuantize(const circle::Tensor *input, const circle::Tensor *output,
}
else
{
int left_shift = params.input_left_shift;
int left_shift = 0;
preprocessSoftmaxScaling(static_cast<double>(params.beta),
static_cast<double>(Tensor::scale(input)), kScaledDiffIntegerBits,
&params.input_multiplier, &left_shift);
Expand Down
1 change: 1 addition & 0 deletions onert-micro/luci-interpreter/src/kernels/SpaceToDepth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ void execute_kernel_CircleSpaceToDepth(const circle::Operator *cur_op,
#ifndef DIS_FLOAT
case DataType::FLOAT32:
{
assert(block_size != 0);
luci_interpreter_pal::SpaceToDepth(
block_size, kernels::getTensorRuntimeShape(kernel.input(), runtime_graph),
kernels::getTensorData<float>(runtime_graph->getDataByTensor(kernel.input())),
Expand Down

0 comments on commit c6472fe

Please sign in to comment.