@@ -86,15 +86,17 @@ class ConvImpl : public LayerImpl<ValueType> {
8686
8787 ConvImpl (const ConvImpl& c) = default;
8888
89- std::vector<ValueType> run (
89+ [[nodiscard]] std::vector<ValueType> run (
9090 const std::vector<ValueType>& input) const override {
9191 return input;
9292 }
9393
94- std::vector<ValueType> run (std::vector<ValueType> startmatrix, int new_rows,
95- int new_cols, std::vector<ValueType> startkernel,
96- size_t start_kernel_size, size_t kernel_size,
97- int center_distance) const {
94+ [[nodiscard]] std::vector<ValueType> run (std::vector<ValueType> startmatrix,
95+ int new_rows, int new_cols,
96+ std::vector<ValueType> startkernel,
97+ size_t start_kernel_size,
98+ size_t kernel_size,
99+ int center_distance) const {
98100 std::vector<ValueType> matrix (new_rows * new_cols * input_flow_, 0 );
99101 for (int i = 0 ; i < input_height_; ++i) {
100102 for (int j = 0 ; j < input_width_; ++j) {
@@ -125,14 +127,14 @@ class ConvImpl : public LayerImpl<ValueType> {
125127 if (input_width_ == 0 ) {
126128 throw std::out_of_range (" Input = 0" );
127129 }
128- int kercol_index = coloms / input_width_ + 1 ;
129- if (kercol_index < 0 ) {
130- throw std::out_of_range (" Kernel column index is negative" );
131- }
132- auto kercol = static_cast <size_t >(kercol_index);
133- color +=
134- matrix[(i + coloms + str) * input_flow_ + x] *
135- kernel[kercol * kernel_size + static_cast <size_t >(str + 1 )];
130+ int kercol_index = coloms / input_width_ + 1 ;
131+ if (kercol_index < 0 ) {
132+ throw std::out_of_range (" Kernel column index is negative" );
133+ }
134+ auto kercol = static_cast <size_t >(kercol_index);
135+ color +=
136+ matrix[(i + coloms + str) * input_flow_ + x] *
137+ kernel[kercol * kernel_size + static_cast <size_t >(str + 1 )];
136138 }
137139 }
138140 if (!bias_.empty () && static_cast <size_t >(x) < bias_.size ()) {
0 commit comments