@@ -139,29 +139,21 @@ namespace internal {
139139
140140 const auto input = get_im2col_mapping (in, f_width, f_depth, 1 , mapping_width, 0 , y_filt);
141141
142- Eigen::Map<Eigen::Matrix<float_type, Eigen::Dynamic, Eigen::Dynamic>, Eigen::Unaligned>
142+ Eigen::Map<Eigen::Matrix<float_type, Eigen::Dynamic, Eigen::Dynamic>, Eigen::Unaligned>
143143 output_temp_map (&output_temp.get_ref_ignore_rank (tensor_pos (0 , 0 , 0 , 0 , 0 )),
144144 static_cast <EigenIndex>(out_depth),
145145 static_cast <EigenIndex>(mapping_width));
146146
147- // Use = (beta=0) for the first filter row to avoid reading the
148- // zero-initialized output_temp values, saving memory bandwidth.
149- if (y_filt == 0 ) {
150- output_temp_map.noalias () = filter * input;
151- } else {
152- output_temp_map.noalias () += filter * input;
153- }
147+ output_temp_map.noalias () += filter * input;
154148 }
155149
156- // Add the valid portion of each output_temp row into the bias-initialized
157- // output tensor. Process one full row (out_width * out_depth contiguous
158- // elements) per iteration using Eigen's SIMD-vectorized addition.
150+ // Dropping the superfluous results from "between" the rows.
159151 for (std::size_t y_out = 0 ; y_out < out_height; ++y_out) {
160- const float_type* src = &output_temp. get_ref_ignore_rank ( tensor_pos ( 0 , 0 , y_out, 0 , 0 ));
161- float_type* dst = &output. get_ref_ignore_rank ( tensor_pos ( 0 , 0 , y_out, 0 , 0 ));
162- const EigenIndex n = static_cast <EigenIndex>(out_width * out_depth );
163- Eigen::Map<Eigen::Array<float_type, Eigen::Dynamic, 1 >>(dst, n) +=
164- Eigen::Map< const Eigen::Array<float_type, Eigen::Dynamic, 1 >>(src, n);
152+ for (std:: size_t x_out = 0 ; x_out < out_width; ++x_out) {
153+ for (std:: size_t z_out = 0 ; z_out < out_depth; ++z_out) {
154+ output. get_ref_ignore_rank ( tensor_pos ( 0 , 0 , y_out, x_out, z_out)) += output_temp. get_ref_ignore_rank ( tensor_pos ( 0 , 0 , y_out, x_out, z_out) );
155+ }
156+ }
165157 }
166158
167159 return output;
0 commit comments