Skip to content

Commit

Permalink
[train] update casting to int16
Browse files Browse the repository at this point in the history
This commit updates padding type to int16

ONE-DCO-1.0-Signed-off-by: JuYoung Lee [email protected]
  • Loading branch information
icodo98 committed Oct 9, 2024
1 parent 0366ecc commit 8ff3675
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions runtime/onert/backend/train/ops/PoolLayer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ class MaxPool2D final : public TrainingKernelRegistry
_op_params.stride_width = strideWidth;
_op_params.filter_height = kernelHeight;
_op_params.filter_width = kernelWidth;
assert(paddingTop < (1 << 8));
assert(paddingLeft < (1 << 8));
_op_params.padding_values.height = static_cast<uint8_t>(paddingTop);
_op_params.padding_values.width = static_cast<uint8_t>(paddingLeft);
assert(paddingTop < (1 << 15));
assert(paddingLeft < (1 << 15));
_op_params.padding_values.height = static_cast<int16_t>(paddingTop);
_op_params.padding_values.width = static_cast<int16_t>(paddingLeft);
CalculateActivationRange<float>(activation, &_op_params.float_activation_min,
&_op_params.float_activation_max);
}
Expand Down Expand Up @@ -134,10 +134,10 @@ class AveragePool2D final : public TrainingKernelRegistry
_op_params.stride_width = strideWidth;
_op_params.filter_height = kernelHeight;
_op_params.filter_width = kernelWidth;
assert(paddingTop < (1 << 8));
assert(paddingLeft < (1 << 8));
_op_params.padding_values.height = static_cast<uint8_t>(paddingTop);
_op_params.padding_values.width = static_cast<uint8_t>(paddingLeft);
assert(paddingTop < (1 << 15));
assert(paddingLeft < (1 << 15));
_op_params.padding_values.height = static_cast<int16_t>(paddingTop);
_op_params.padding_values.width = static_cast<int16_t>(paddingLeft);
CalculateActivationRange<float>(activation, &_op_params.float_activation_min,
&_op_params.float_activation_max);
}
Expand Down

0 comments on commit 8ff3675

Please sign in to comment.