Lines Matching +full:- +full:oc

6 // This source code is licensed under the BSD-style license found in the
22 #include "convolution-test-helpers.h"
44 this->padding_tf_same_ = padding_same; in padding_tf_same()
49 return this->padding_tf_same_; in padding_tf_same()
54 this->padding_top_ = padding; in padding()
55 this->padding_right_ = padding; in padding()
56 this->padding_bottom_ = padding; in padding()
57 this->padding_left_ = padding; in padding()
63 this->padding_top_ = padding_height; in padding()
64 this->padding_right_ = padding_width; in padding()
65 this->padding_bottom_ = padding_height; in padding()
66 this->padding_left_ = padding_width; in padding()
72 this->padding_top_ = padding_height; in padding_height()
73 this->padding_bottom_ = padding_height; in padding_height()
79 this->padding_right_ = padding_width; in padding_width()
80 this->padding_left_ = padding_width; in padding_width()
86 this->padding_top_ = padding_top; in padding_top()
93 (output_height() - 1) * subsampling_height() + dilated_kernel_height() - input_height(); in padding_top()
96 return this->padding_top_; in padding_top()
102 this->padding_left_ = padding_left; in padding_left()
109 (output_width() - 1) * subsampling_width() + dilated_kernel_width() - input_width(); in padding_left()
112 return this->padding_left_; in padding_left()
118 this->padding_bottom_ = padding_bottom; in padding_bottom()
125 (output_height() - 1) * subsampling_height() + dilated_kernel_height() - input_height(); in padding_bottom()
126 return total_padding_height - total_padding_height / 2; in padding_bottom()
128 return this->padding_bottom_; in padding_bottom()
134 this->padding_right_ = padding_right; in padding_right()
141 (output_width() - 1) * subsampling_width() + dilated_kernel_width() - input_width(); in padding_right()
142 return total_padding_width - total_padding_width / 2; in padding_right()
144 return this->padding_right_; in padding_right()
151 this->input_height_ = input_height; in input_size()
152 this->input_width_ = input_width; in input_size()
158 this->input_height_ = input_height; in input_height()
163 return this->input_height_; in input_height()
168 this->input_width_ = input_width; in input_width()
173 return this->input_width_; in input_width()
178 this->groups_ = groups; in groups()
183 return this->groups_; in groups()
188 this->group_input_channels_ = group_input_channels; in group_input_channels()
193 return this->group_input_channels_; in group_input_channels()
198 this->group_output_channels_ = group_output_channels; in group_output_channels()
203 return this->group_output_channels_; in group_output_channels()
208 this->batch_size_ = batch_size; in batch_size()
213 return this->batch_size_; in batch_size()
218 this->kernel_height_ = kernel_size; in kernel_size()
219 this->kernel_width_ = kernel_size; in kernel_size()
226 this->kernel_height_ = kernel_height; in kernel_size()
227 this->kernel_width_ = kernel_width; in kernel_size()
233 this->kernel_height_ = kernel_height; in kernel_height()
238 return this->kernel_height_; in kernel_height()
243 this->kernel_width_ = kernel_width; in kernel_width()
248 return this->kernel_width_; in kernel_width()
253 this->dilation_height_ = dilation; in dilation()
254 this->dilation_width_ = dilation; in dilation()
261 this->dilation_height_ = dilation_height; in dilation()
262 this->dilation_width_ = dilation_width; in dilation()
268 this->dilation_height_ = dilation_height; in dilation_height()
273 return this->dilation_height_; in dilation_height()
278 this->dilation_width_ = dilation_width; in dilation_width()
283 return this->dilation_width_; in dilation_width()
288 this->subsampling_height_ = subsampling; in subsampling()
289 this->subsampling_width_ = subsampling; in subsampling()
296 this->subsampling_height_ = subsampling_height; in subsampling()
297 this->subsampling_width_ = subsampling_width; in subsampling()
303 this->subsampling_height_ = subsampling_height; in subsampling_height()
308 return this->subsampling_height_; in subsampling_height()
313 this->subsampling_width_ = subsampling_width; in subsampling_width()
318 return this->subsampling_width_; in subsampling_width()
323 this->input_channel_stride_ = input_channel_stride; in input_channel_stride()
328 if (this->input_channel_stride_ == 0) { in input_channel_stride()
331 assert(this->input_channel_stride_ >= group_input_channels() * groups()); in input_channel_stride()
332 return this->input_channel_stride_; in input_channel_stride()
338 this->output_channel_stride_ = output_channel_stride; in output_channel_stride()
343 if (this->output_channel_stride_ == 0) { in output_channel_stride()
346 assert(this->output_channel_stride_ >= group_output_channels() * groups()); in output_channel_stride()
347 return this->output_channel_stride_; in output_channel_stride()
352 return (kernel_height() - 1) * dilation_height() + 1; in dilated_kernel_height()
356 return (kernel_width() - 1) * dilation_width() + 1; in dilated_kernel_width()
361 return (input_height() + subsampling_height() - 1) / subsampling_height(); in output_height()
367 return (padded_input_height - dilated_kernel_height()) / subsampling_height() + 1; in output_height()
374 return (input_width() + subsampling_width() - 1) / subsampling_width(); in output_width()
380 return (padded_input_width - dilated_kernel_width()) / subsampling_width() + 1; in output_width()
388 this->next_input_height_ = next_input_height; in next_input_size()
389 this->next_input_width_ = next_input_width; in next_input_size()
395 this->next_input_height_ = next_input_height; in next_input_height()
400 if (this->next_input_height_ == 0) { in next_input_height()
403 return this->next_input_height_; in next_input_height()
409 this->next_input_width_ = next_input_width; in next_input_width()
414 if (this->next_input_width_ == 0) { in next_input_width()
417 return this->next_input_width_; in next_input_width()
426 return (padded_input_height - dilated_kernel_height()) / subsampling_height() + 1; in next_output_height()
435 return (padded_input_width - dilated_kernel_width()) / subsampling_width() + 1; in next_output_width()
441 this->next_batch_size_ = next_batch_size; in next_batch_size()
446 if (this->next_batch_size_ == 0) { in next_batch_size()
449 return this->next_batch_size_; in next_batch_size()
454 this->sparsity_ = sparsity; in sparsity()
459 return this->sparsity_; in sparsity()
463 this->qmin_ = qmin; in qmin()
468 return this->qmin_; in qmin()
472 this->qmax_ = qmax; in qmax()
477 return this->qmax_; in qmax()
481 this->force_nhwc_input_ = force_nhwc_input; in force_nhwc_input()
486 return this->force_nhwc_input_; in force_nhwc_input()
490 this->depthwise_layout_ = depthwise_layout; in depthwise_layout()
495 return this->depthwise_layout_; in depthwise_layout()
499 this->has_bias_ = has_bias; in has_bias()
504 return this->has_bias_; in has_bias()
508 this->weights_type_ = weights_type; in weights_type()
513 return this->weights_type_; in weights_type()
517 this->iterations_ = iterations; in iterations()
522 return this->iterations_; in iterations()
527 this->use_jit_ = use_jit; in use_jit()
532 return this->use_jit_; in use_jit()
537 this->use_weights_cache_ = use_weights_cache; in use_weights_cache()
542 return this->use_weights_cache_; in use_weights_cache()
550 std::uniform_int_distribution<int32_t> i32dist(-10000, 10000); in TestNHWCxQC8()
554 -std::numeric_limits<int8_t>::max(), std::numeric_limits<int8_t>::max()); in TestNHWCxQC8()
557 …batch_size() * ((input_height() * input_width() - 1) * input_channel_stride() + groups() * group_i… in TestNHWCxQC8()
560 …std::vector<int8_t> output(batch_size() * ((output_height() * output_width() - 1) * output_channel… in TestNHWCxQC8()
565 const int8_t input_zero_point = -1; in TestNHWCxQC8()
566 const int8_t output_zero_point = -1; in TestNHWCxQC8()
640 float requantization_scale = 0x1.0p-32f; in TestNHWCxQC8()
643 …float(int32_t(std::numeric_limits<int8_t>::max()) - int32_t(output_zero_point)) / float(accumulate… in TestNHWCxQC8()
647 …float(int32_t(std::numeric_limits<int8_t>::min()) - int32_t(output_zero_point)) / float(accumulate… in TestNHWCxQC8()
649 requantization_scale = std::min(requantization_scale, 0x1.FFFFFEp-1f); in TestNHWCxQC8()
662 [this](double x) -> double { in TestNHWCxQC8()
663 … return std::max<double>(std::min<double>(x, double(qmax() - 0x80)), double(qmin() - 0x80)); in TestNHWCxQC8()
689 output_zero_point, 1.0f /* output scale */, int8_t(qmin() - 0x80), int8_t(qmax() - 0x80), in TestNHWCxQC8()
733 … output_zero_point, 1.0f /* output scale */, int8_t(qmin() - 0x80), int8_t(qmax() - 0x80), in TestNHWCxQC8()
767 …width() + x) * output_channel_stride() + g * group_output_channels() + c]), int32_t(qmax() - 0x80)) in VerifyNHWCxQC8()
769 …width() + x) * output_channel_stride() + g * group_output_channels() + c]), int32_t(qmin() - 0x80)) in VerifyNHWCxQC8()
788 std::uniform_int_distribution<int32_t> i32dist(-10000, 10000); in TestNHWCxQS8()
792 -std::numeric_limits<int8_t>::max(), std::numeric_limits<int8_t>::max()); in TestNHWCxQS8()
795 …batch_size() * ((input_height() * input_width() - 1) * input_channel_stride() + groups() * group_i… in TestNHWCxQS8()
798 …std::vector<int8_t> output(batch_size() * ((output_height() * output_width() - 1) * output_channel… in TestNHWCxQS8()
802 const int8_t input_zero_point = -1; in TestNHWCxQS8()
871 const double output_scale = double(uint32_t(accumulated_max - accumulated_min)) / 255.0; in TestNHWCxQS8()
873 lrint(-0.5 - 0.5 * double(accumulated_min + accumulated_max) / output_scale), in TestNHWCxQS8()
878 [this, output_scale, output_zero_point](int32_t x) -> double { in TestNHWCxQS8()
879 …n<double>(double(x) / output_scale, double(qmax() - 0x80) - output_zero_point), double(qmin() - 0x… in TestNHWCxQS8()
905 output_zero_point, output_scale, int8_t(qmin() - 0x80), int8_t(qmax() - 0x80), in TestNHWCxQS8()
952 output_scale, int8_t(qmin() - 0x80), int8_t(qmax() - 0x80), in TestNHWCxQS8()
987 …width() + x) * output_channel_stride() + g * group_output_channels() + c]), int32_t(qmax() - 0x80)) in VerifyNHWCxQS8()
989 …width() + x) * output_channel_stride() + g * group_output_channels() + c]), int32_t(qmin() - 0x80)) in VerifyNHWCxQS8()
993 …_width() + x) * output_channel_stride() + g * group_output_channels() + c]) - double(output_zero_p… in VerifyNHWCxQS8()
1008 std::uniform_int_distribution<int32_t> i32dist(-10000, 10000); in TestNHWCxQU8()
1013 …batch_size() * ((input_height() * input_width() - 1) * input_channel_stride() + groups() * group_i… in TestNHWCxQU8()
1016 …std::vector<uint8_t> output(batch_size() * ((output_height() * output_width() - 1) * output_channe… in TestNHWCxQU8()
1035 for (size_t oc = 0; oc < group_output_channels(); oc++) { in TestNHWCxQU8() local
1036 …(i * output_height() + oy) * output_width() + ox) * groups() + g) * group_output_channels() + oc] = in TestNHWCxQU8()
1037 bias[g * group_output_channels() + oc]; in TestNHWCxQU8()
1108 const double output_scale = double(uint32_t(accumulated_max - accumulated_min)) / 255.0; in TestNHWCxQU8()
1110 lrint(127.5 - 0.5 * double(accumulated_min + accumulated_max) / output_scale), in TestNHWCxQU8()
1115 [this, output_scale, output_zero_point](int32_t x) -> double { in TestNHWCxQU8()
1116 …td::min<double>(double(x) / output_scale, double(qmax()) - output_zero_point), double(qmin()) - ou… in TestNHWCxQU8()
1234 …_width() + x) * output_channel_stride() + g * group_output_channels() + c]) - double(output_zero_p… in VerifyNHWCxQU8()
1252 …batch_size() * ((input_height() * input_width() - 1) * input_channel_stride() + groups() * group_i… in TestNHWCxF32()
1255 …std::vector<float> output(batch_size() * ((output_height() * output_width() - 1) * output_channel_… in TestNHWCxF32()
1270 for (size_t oc = 0; oc < group_output_channels(); oc++) { in TestNHWCxF32() local
1271 …(i * output_height() + oy) * output_width() + ox) * groups() + g) * group_output_channels() + oc] = in TestNHWCxF32()
1272 bias[g * group_output_channels() + oc]; in TestNHWCxF32()
1288 … const size_t iy = oy * subsampling_height() + ky * dilation_height() - padding_top(); in TestNHWCxF32()
1291 … const size_t ix = ox * subsampling_width() + kx * dilation_width() - padding_left(); in TestNHWCxF32()
1294 for (size_t oc = 0; oc < group_output_channels(); oc++) { in TestNHWCxF32() local
1295 …i * output_height() + oy) * output_width() + ox) * groups() + g) * group_output_channels() + oc] += in TestNHWCxF32()
1297 … kernel[((ky * kernel_width() + kx) * groups() + g) * group_output_channels() + oc]; in TestNHWCxF32()
1312 … const size_t iy = oy * subsampling_height() + ky * dilation_height() - padding_top(); in TestNHWCxF32()
1315 … const size_t ix = ox * subsampling_width() + kx * dilation_width() - padding_left(); in TestNHWCxF32()
1318 for (size_t oc = 0; oc < group_output_channels(); oc++) { in TestNHWCxF32() local
1320 …i * output_height() + oy) * output_width() + ox) * groups() + g) * group_output_channels() + oc] += in TestNHWCxF32()
1322 …kernel[(((g * group_output_channels() + oc) * kernel_height() + ky) * kernel_width() + kx) * group… in TestNHWCxF32()
1339 …const float output_min = accumulated_min + (accumulated_max - accumulated_min) / 255.0f * float(qm… in TestNHWCxF32()
1340 …const float output_max = accumulated_max - (accumulated_max - accumulated_min) / 255.0f * float(25… in TestNHWCxF32()
1498 …1.0e-4 * std::abs(output_ref[(((i * output_height() + y) * output_width() + x) * groups() + g) * g… in VerifyNHWCxF32()
1522 …batch_size() * ((input_height() * input_width() - 1) * input_channel_stride() + groups() * group_i… in TestNHWCxF16()
1527 …std::vector<uint16_t> output(batch_size() * ((output_height() * output_width() - 1) * output_chann… in TestNHWCxF16()
1545 for (size_t oc = 0; oc < group_output_channels(); oc++) { in TestNHWCxF16() local
1546 …(i * output_height() + oy) * output_width() + ox) * groups() + g) * group_output_channels() + oc] = in TestNHWCxF16()
1547 fp16_ieee_to_fp32_value(bias[g * group_output_channels() + oc]); in TestNHWCxF16()
1563 … const size_t iy = oy * subsampling_height() + ky * dilation_height() - padding_top(); in TestNHWCxF16()
1566 … const size_t ix = ox * subsampling_width() + kx * dilation_width() - padding_left(); in TestNHWCxF16()
1569 for (size_t oc = 0; oc < group_output_channels(); oc++) { in TestNHWCxF16() local
1570 …i * output_height() + oy) * output_width() + ox) * groups() + g) * group_output_channels() + oc] += in TestNHWCxF16()
1572 …_to_fp32_value(kernel[((ky * kernel_width() + kx) * groups() + g) * group_output_channels() + oc]); in TestNHWCxF16()
1587 … const size_t iy = oy * subsampling_height() + ky * dilation_height() - padding_top(); in TestNHWCxF16()
1590 … const size_t ix = ox * subsampling_width() + kx * dilation_width() - padding_left(); in TestNHWCxF16()
1593 for (size_t oc = 0; oc < group_output_channels(); oc++) { in TestNHWCxF16() local
1595 …i * output_height() + oy) * output_width() + ox) * groups() + g) * group_output_channels() + oc] += in TestNHWCxF16()
1597 …fp16_ieee_to_fp32_value(kernel[(((g * group_output_channels() + oc) * kernel_height() + ky) * kern… in TestNHWCxF16()
1613 const float accumulated_range = accumulated_max - accumulated_min; in TestNHWCxF16()
1615 …o_fp32_value(fp16_ieee_from_fp32_value(accumulated_max - accumulated_range / 255.0f * float(255 - in TestNHWCxF16()
1616 …const float output_min = scaled_min == scaled_max ? -std::numeric_limits<float>::infinity() : scal… in TestNHWCxF16()
1742 …d::max(1.0e-4f, std::abs(output_ref[(((i * output_height() + y) * output_width() + x) * groups() +… in VerifyNHWCxF16()
1760 …((batch_size() - 1) * input_channel_stride() + groups() * group_input_channels()) * input_height()… in TestNCHWxF32()
1765 …((batch_size() - 1) * output_channel_stride() + groups() * group_output_channels()) * output_heigh… in TestNCHWxF32()
1785 for (size_t oc = 0; oc < group_output_channels(); oc++) { in TestNCHWxF32() local
1786 …output_ref[(((i * groups() + g) * group_output_channels() + oc) * output_height() + oy) * output_w… in TestNCHWxF32()
1787 bias[g * group_output_channels() + oc]; in TestNCHWxF32()
1801 … const size_t iy = oy * subsampling_height() + ky * dilation_height() - padding_top(); in TestNCHWxF32()
1804 … const size_t ix = ox * subsampling_width() + kx * dilation_width() - padding_left(); in TestNCHWxF32()
1807 for (size_t oc = 0; oc < group_output_channels(); oc++) { in TestNCHWxF32() local
1809 …output_ref[(((i * groups() + g) * group_output_channels() + oc) * output_height() + oy) * output_w… in TestNCHWxF32()
1811 …kernel[(((g * group_output_channels() + oc) * kernel_height() + ky) * kernel_width() + kx) * group… in TestNCHWxF32()
1829 … const size_t iy = oy * subsampling_height() + ky * dilation_height() - padding_top(); in TestNCHWxF32()
1832 … const size_t ix = ox * subsampling_width() + kx * dilation_width() - padding_left(); in TestNCHWxF32()
1835 for (size_t oc = 0; oc < group_output_channels(); oc++) { in TestNCHWxF32() local
1836 …output_ref[(((i * groups() + g) * group_output_channels() + oc) * output_height() + oy) * output_w… in TestNCHWxF32()
1838 … kernel[((ky * kernel_width() + kx) * groups() + g) * group_output_channels() + oc]; in TestNCHWxF32()
1853 … const size_t iy = oy * subsampling_height() + ky * dilation_height() - padding_top(); in TestNCHWxF32()
1856 … const size_t ix = ox * subsampling_width() + kx * dilation_width() - padding_left(); in TestNCHWxF32()
1859 for (size_t oc = 0; oc < group_output_channels(); oc++) { in TestNCHWxF32() local
1861 …output_ref[(((i * groups() + g) * group_output_channels() + oc) * output_height() + oy) * output_w… in TestNCHWxF32()
1863 …kernel[(((g * group_output_channels() + oc) * kernel_height() + ky) * kernel_width() + kx) * group… in TestNCHWxF32()
1880 const float output_min = qmin() == 0 ? -std::numeric_limits<float>::infinity() : in TestNCHWxF32()
1881 accumulated_min + (accumulated_max - accumulated_min) / 255.0f * float(qmin()); in TestNCHWxF32()
1883 accumulated_max - (accumulated_max - accumulated_min) / 255.0f * float(255 - qmax()); in TestNCHWxF32()
1998 …1.0e-4 * std::abs(output_ref[(((i * groups() + g) * group_output_channels() + c) * output_height()… in VerifyNCHWxF32()
2014 std::uniform_int_distribution<int32_t> i32dist(-10000, 10000); in TestSetupNHWCxQC8()
2018 -std::numeric_limits<int8_t>::max(), std::numeric_limits<int8_t>::max()); in TestSetupNHWCxQC8()
2021 …batch_size() * ((input_height() * input_width() - 1) * input_channel_stride() + groups() * group_i… in TestSetupNHWCxQC8()
2022 …next_batch_size() * ((next_input_height() * next_input_width() - 1) * input_channel_stride() + gro… in TestSetupNHWCxQC8()
2026 …batch_size() * ((output_height() * output_width() - 1) * output_channel_stride() + groups() * grou… in TestSetupNHWCxQC8()
2027 …next_batch_size() * ((next_output_height() * next_output_width() - 1) * output_channel_stride() + … in TestSetupNHWCxQC8()
2035 const int8_t input_zero_point = -1; in TestSetupNHWCxQC8()
2036 const int8_t output_zero_point = -1; in TestSetupNHWCxQC8()
2050 for (size_t oc = 0; oc < group_output_channels(); oc++) { in TestSetupNHWCxQC8() local
2051 …(i * output_height() + oy) * output_width() + ox) * groups() + g) * group_output_channels() + oc] = in TestSetupNHWCxQC8()
2052 bias[g * group_output_channels() + oc]; in TestSetupNHWCxQC8()
2065 const size_t iy = oy * subsampling_height() + ky * dilation_height() - padding_top(); in TestSetupNHWCxQC8()
2068 … const size_t ix = ox * subsampling_width() + kx * dilation_width() - padding_left(); in TestSetupNHWCxQC8()
2071 for (size_t oc = 0; oc < group_output_channels(); oc++) { in TestSetupNHWCxQC8() local
2073 …i * output_height() + oy) * output_width() + ox) * groups() + g) * group_output_channels() + oc] += in TestSetupNHWCxQC8()
2074 …_width() + ix) * input_channel_stride() + g * group_input_channels() + ic]) - int32_t(input_zero_p… in TestSetupNHWCxQC8()
2075 …int32_t(kernel[(((g * group_output_channels() + oc) * kernel_height() + ky) * kernel_width() + kx)… in TestSetupNHWCxQC8()
2096 float requantization_scale = 0x1.0p-32f; in TestSetupNHWCxQC8()
2099 …float(int32_t(std::numeric_limits<int8_t>::max()) - int32_t(output_zero_point)) / float(accumulate… in TestSetupNHWCxQC8()
2103 …float(int32_t(std::numeric_limits<int8_t>::min()) - int32_t(output_zero_point)) / float(accumulate… in TestSetupNHWCxQC8()
2105 requantization_scale = std::min(requantization_scale, 0x1.FFFFFEp-1f); in TestSetupNHWCxQC8()
2118 [this](double x) -> double { in TestSetupNHWCxQC8()
2119 … return std::max<double>(std::min<double>(x, double(qmax() - 0x80)), double(qmin() - 0x80)); in TestSetupNHWCxQC8()
2135 output_zero_point, 1.0f /* output scale */, int8_t(qmin() - 0x80), int8_t(qmax() - 0x80), in TestSetupNHWCxQC8()
2162 …width() + x) * output_channel_stride() + g * group_output_channels() + c]), int32_t(qmax() - 0x80)) in TestSetupNHWCxQC8()
2164 …width() + x) * output_channel_stride() + g * group_output_channels() + c]), int32_t(qmin() - 0x80)) in TestSetupNHWCxQC8()
2177 // Re-generate data for the second run. in TestSetupNHWCxQC8()
2187 for (size_t oc = 0; oc < group_output_channels(); oc++) { in TestSetupNHWCxQC8() local
2188 …output_height() + oy) * next_output_width() + ox) * groups() + g) * group_output_channels() + oc] = in TestSetupNHWCxQC8()
2189 bias[g * group_output_channels() + oc]; in TestSetupNHWCxQC8()
2202 const size_t iy = oy * subsampling_height() + ky * dilation_height() - padding_top(); in TestSetupNHWCxQC8()
2205 … const size_t ix = ox * subsampling_width() + kx * dilation_width() - padding_left(); in TestSetupNHWCxQC8()
2208 for (size_t oc = 0; oc < group_output_channels(); oc++) { in TestSetupNHWCxQC8() local
2210 …utput_height() + oy) * next_output_width() + ox) * groups() + g) * group_output_channels() + oc] += in TestSetupNHWCxQC8()
2211 …_width() + ix) * input_channel_stride() + g * group_input_channels() + ic]) - int32_t(input_zero_p… in TestSetupNHWCxQC8()
2212 …int32_t(kernel[(((g * group_output_channels() + oc) * kernel_height() + ky) * kernel_width() + kx)… in TestSetupNHWCxQC8()
2230 [this](double x) -> double { in TestSetupNHWCxQC8()
2231 … return std::max<double>(std::min<double>(x, double(qmax() - 0x80)), double(qmin() - 0x80)); in TestSetupNHWCxQC8()
2251 …width() + x) * output_channel_stride() + g * group_output_channels() + c]), int32_t(qmax() - 0x80)) in TestSetupNHWCxQC8()
2253 …width() + x) * output_channel_stride() + g * group_output_channels() + c]), int32_t(qmin() - 0x80)) in TestSetupNHWCxQC8()
2275 std::uniform_int_distribution<int32_t> i32dist(-10000, 10000); in TestSetupNHWCxQS8()
2279 -std::numeric_limits<int8_t>::max(), std::numeric_limits<int8_t>::max()); in TestSetupNHWCxQS8()
2282 …batch_size() * ((input_height() * input_width() - 1) * input_channel_stride() + groups() * group_i… in TestSetupNHWCxQS8()
2283 …next_batch_size() * ((next_input_height() * next_input_width() - 1) * input_channel_stride() + gro… in TestSetupNHWCxQS8()
2287 …batch_size() * ((output_height() * output_width() - 1) * output_channel_stride() + groups() * grou… in TestSetupNHWCxQS8()
2288 …next_batch_size() * ((next_output_height() * next_output_width() - 1) * output_channel_stride() + … in TestSetupNHWCxQS8()
2294 const int8_t input_zero_point = -1; in TestSetupNHWCxQS8()
2308 for (size_t oc = 0; oc < group_output_channels(); oc++) { in TestSetupNHWCxQS8() local
2309 …(i * output_height() + oy) * output_width() + ox) * groups() + g) * group_output_channels() + oc] = in TestSetupNHWCxQS8()
2310 bias[g * group_output_channels() + oc]; in TestSetupNHWCxQS8()
2323 const size_t iy = oy * subsampling_height() + ky * dilation_height() - padding_top(); in TestSetupNHWCxQS8()
2326 … const size_t ix = ox * subsampling_width() + kx * dilation_width() - padding_left(); in TestSetupNHWCxQS8()
2329 for (size_t oc = 0; oc < group_output_channels(); oc++) { in TestSetupNHWCxQS8() local
2331 …i * output_height() + oy) * output_width() + ox) * groups() + g) * group_output_channels() + oc] += in TestSetupNHWCxQS8()
2332 …_width() + ix) * input_channel_stride() + g * group_input_channels() + ic]) - int32_t(input_zero_p… in TestSetupNHWCxQS8()
2333 …int32_t(kernel[(((g * group_output_channels() + oc) * kernel_height() + ky) * kernel_width() + kx)… in TestSetupNHWCxQS8()
2349 const double output_scale = double(uint32_t(accumulated_max - accumulated_min)) / 255.0; in TestSetupNHWCxQS8()
2351 lrint(-0.5 - 0.5 * double(accumulated_min + accumulated_max) / output_scale), in TestSetupNHWCxQS8()
2356 [this, output_scale, output_zero_point](int32_t x) -> double { in TestSetupNHWCxQS8()
2357 …n<double>(double(x) / output_scale, double(qmax() - 0x80) - output_zero_point), double(qmin() - 0x… in TestSetupNHWCxQS8()
2373 output_zero_point, output_scale, int8_t(qmin() - 0x80), int8_t(qmax() - 0x80), in TestSetupNHWCxQS8()
2400 …width() + x) * output_channel_stride() + g * group_output_channels() + c]), int32_t(qmax() - 0x80)) in TestSetupNHWCxQS8()
2402 …width() + x) * output_channel_stride() + g * group_output_channels() + c]), int32_t(qmin() - 0x80)) in TestSetupNHWCxQS8()
2406 …_width() + x) * output_channel_stride() + g * group_output_channels() + c]) - double(output_zero_p… in TestSetupNHWCxQS8()
2415 // Re-generate data for the second run. in TestSetupNHWCxQS8()
2425 for (size_t oc = 0; oc < group_output_channels(); oc++) { in TestSetupNHWCxQS8() local
2426 …output_height() + oy) * next_output_width() + ox) * groups() + g) * group_output_channels() + oc] = in TestSetupNHWCxQS8()
2427 bias[g * group_output_channels() + oc]; in TestSetupNHWCxQS8()
2440 const size_t iy = oy * subsampling_height() + ky * dilation_height() - padding_top(); in TestSetupNHWCxQS8()
2443 … const size_t ix = ox * subsampling_width() + kx * dilation_width() - padding_left(); in TestSetupNHWCxQS8()
2446 for (size_t oc = 0; oc < group_output_channels(); oc++) { in TestSetupNHWCxQS8() local
2448 …utput_height() + oy) * next_output_width() + ox) * groups() + g) * group_output_channels() + oc] += in TestSetupNHWCxQS8()
2449 …_width() + ix) * input_channel_stride() + g * group_input_channels() + ic]) - int32_t(input_zero_p… in TestSetupNHWCxQS8()
2450 …int32_t(kernel[(((g * group_output_channels() + oc) * kernel_height() + ky) * kernel_width() + kx)… in TestSetupNHWCxQS8()
2462 [this, output_scale, output_zero_point](int32_t x) -> double { in TestSetupNHWCxQS8()
2463 …n<double>(double(x) / output_scale, double(qmax() - 0x80) - output_zero_point), double(qmin() - 0x… in TestSetupNHWCxQS8()
2483 …width() + x) * output_channel_stride() + g * group_output_channels() + c]), int32_t(qmax() - 0x80)) in TestSetupNHWCxQS8()
2485 …width() + x) * output_channel_stride() + g * group_output_channels() + c]), int32_t(qmin() - 0x80)) in TestSetupNHWCxQS8()
2489 …_width() + x) * output_channel_stride() + g * group_output_channels() + c]) - double(output_zero_p… in TestSetupNHWCxQS8()
2507 std::uniform_int_distribution<int32_t> i32dist(-10000, 10000); in TestSetupNHWCxQU8()
2512 …batch_size() * ((input_height() * input_width() - 1) * input_channel_stride() + groups() * group_i… in TestSetupNHWCxQU8()
2513 …next_batch_size() * ((next_input_height() * next_input_width() - 1) * input_channel_stride() + gro… in TestSetupNHWCxQU8()
2517 …batch_size() * ((output_height() * output_width() - 1) * output_channel_stride() + groups() * grou… in TestSetupNHWCxQU8()
2518 …next_batch_size() * ((next_output_height() * next_output_width() - 1) * output_channel_stride() + … in TestSetupNHWCxQU8()
2539 for (size_t oc = 0; oc < group_output_channels(); oc++) { in TestSetupNHWCxQU8() local
2540 …(i * output_height() + oy) * output_width() + ox) * groups() + g) * group_output_channels() + oc] = in TestSetupNHWCxQU8()
2541 bias[g * group_output_channels() + oc]; in TestSetupNHWCxQU8()
2554 const size_t iy = oy * subsampling_height() + ky * dilation_height() - padding_top(); in TestSetupNHWCxQU8()
2557 … const size_t ix = ox * subsampling_width() + kx * dilation_width() - padding_left(); in TestSetupNHWCxQU8()
2560 for (size_t oc = 0; oc < group_output_channels(); oc++) { in TestSetupNHWCxQU8() local
2562 …i * output_height() + oy) * output_width() + ox) * groups() + g) * group_output_channels() + oc] += in TestSetupNHWCxQU8()
2563 …_width() + ix) * input_channel_stride() + g * group_input_channels() + ic]) - int32_t(input_zero_p… in TestSetupNHWCxQU8()
2564 …[(((g * group_output_channels() + oc) * kernel_height() + ky) * kernel_width() + kx) * group_input… in TestSetupNHWCxQU8()
2580 const double output_scale = double(uint32_t(accumulated_max - accumulated_min)) / 255.0; in TestSetupNHWCxQU8()
2582 lrint(127.5 - 0.5 * double(accumulated_min + accumulated_max) / output_scale), in TestSetupNHWCxQU8()
2587 [this, output_scale, output_zero_point](int32_t x) -> double { in TestSetupNHWCxQU8()
2588 …td::min<double>(double(x) / output_scale, double(qmax()) - output_zero_point), double(qmin()) - ou… in TestSetupNHWCxQU8()
2638 …_width() + x) * output_channel_stride() + g * group_output_channels() + c]) - double(output_zero_p… in TestSetupNHWCxQU8()
2647 // Re-generate data for the second run. in TestSetupNHWCxQU8()
2657 for (size_t oc = 0; oc < group_output_channels(); oc++) { in TestSetupNHWCxQU8() local
2658 …output_height() + oy) * next_output_width() + ox) * groups() + g) * group_output_channels() + oc] = in TestSetupNHWCxQU8()
2659 bias[g * group_output_channels() + oc]; in TestSetupNHWCxQU8()
2672 const size_t iy = oy * subsampling_height() + ky * dilation_height() - padding_top(); in TestSetupNHWCxQU8()
2675 … const size_t ix = ox * subsampling_width() + kx * dilation_width() - padding_left(); in TestSetupNHWCxQU8()
2678 for (size_t oc = 0; oc < group_output_channels(); oc++) { in TestSetupNHWCxQU8() local
2680 …utput_height() + oy) * next_output_width() + ox) * groups() + g) * group_output_channels() + oc] += in TestSetupNHWCxQU8()
2681 …_width() + ix) * input_channel_stride() + g * group_input_channels() + ic]) - int32_t(input_zero_p… in TestSetupNHWCxQU8()
2682 …[(((g * group_output_channels() + oc) * kernel_height() + ky) * kernel_width() + kx) * group_input… in TestSetupNHWCxQU8()
2694 [this, output_scale, output_zero_point](int32_t x) -> double { in TestSetupNHWCxQU8()
2695 …td::min<double>(double(x) / output_scale, double(qmax()) - output_zero_point), double(qmin()) - ou… in TestSetupNHWCxQU8()
2721 …_width() + x) * output_channel_stride() + g * group_output_channels() + c]) - double(output_zero_p… in TestSetupNHWCxQU8()
2742 …batch_size() * ((input_height() * input_width() - 1) * input_channel_stride() + groups() * group_i… in TestSetupNHWCxF16()
2743 …next_batch_size() * ((next_input_height() * next_input_width() - 1) * input_channel_stride() + gro… in TestSetupNHWCxF16()
2747 …batch_size() * ((output_height() * output_width() - 1) * output_channel_stride() + groups() * grou… in TestSetupNHWCxF16()
2748 …next_batch_size() * ((next_output_height() * next_output_width() - 1) * output_channel_stride() + … in TestSetupNHWCxF16()
2764 for (size_t oc = 0; oc < group_output_channels(); oc++) { in TestSetupNHWCxF16() local
2765 …(i * output_height() + oy) * output_width() + ox) * groups() + g) * group_output_channels() + oc] = in TestSetupNHWCxF16()
2766 fp16_ieee_to_fp32_value(bias[g * group_output_channels() + oc]); in TestSetupNHWCxF16()
2779 const size_t iy = oy * subsampling_height() + ky * dilation_height() - padding_top(); in TestSetupNHWCxF16()
2782 … const size_t ix = ox * subsampling_width() + kx * dilation_width() - padding_left(); in TestSetupNHWCxF16()
2785 for (size_t oc = 0; oc < group_output_channels(); oc++) { in TestSetupNHWCxF16() local
2787 …i * output_height() + oy) * output_width() + ox) * groups() + g) * group_output_channels() + oc] += in TestSetupNHWCxF16()
2789 …fp16_ieee_to_fp32_value(kernel[(((g * group_output_channels() + oc) * kernel_height() + ky) * kern… in TestSetupNHWCxF16()
2804 const float accumulated_range = accumulated_max - accumulated_min; in TestSetupNHWCxF16()
2806 …o_fp32_value(fp16_ieee_from_fp32_value(accumulated_max - accumulated_range / 255.0f * float(255 - in TestSetupNHWCxF16()
2807 …const float output_min = scaled_min == scaled_max ? -std::numeric_limits<float>::infinity() : scal… in TestSetupNHWCxF16()
2857 …d::max(1.0e-4f, std::abs(output_ref[(((i * output_height() + y) * output_width() + x) * groups() +… in TestSetupNHWCxF16()
2865 // Re-generate data for the second run. in TestSetupNHWCxF16()
2875 for (size_t oc = 0; oc < group_output_channels(); oc++) { in TestSetupNHWCxF16() local
2876 …output_height() + oy) * next_output_width() + ox) * groups() + g) * group_output_channels() + oc] = in TestSetupNHWCxF16()
2877 fp16_ieee_to_fp32_value(bias[g * group_output_channels() + oc]); in TestSetupNHWCxF16()
2890 const size_t iy = oy * subsampling_height() + ky * dilation_height() - padding_top(); in TestSetupNHWCxF16()
2893 … const size_t ix = ox * subsampling_width() + kx * dilation_width() - padding_left(); in TestSetupNHWCxF16()
2896 for (size_t oc = 0; oc < group_output_channels(); oc++) { in TestSetupNHWCxF16() local
2898 …utput_height() + oy) * next_output_width() + ox) * groups() + g) * group_output_channels() + oc] += in TestSetupNHWCxF16()
2900 …fp16_ieee_to_fp32_value(kernel[(((g * group_output_channels() + oc) * kernel_height() + ky) * kern… in TestSetupNHWCxF16()
2936 …1.0e-4f, std::abs(next_output_ref[(((i * next_output_height() + y) * next_output_width() + x) * gr… in TestSetupNHWCxF16()
2956 …batch_size() * ((input_height() * input_width() - 1) * input_channel_stride() + groups() * group_i… in TestSetupNHWCxF32()
2957 …next_batch_size() * ((next_input_height() * next_input_width() - 1) * input_channel_stride() + gro… in TestSetupNHWCxF32()
2961 …batch_size() * ((output_height() * output_width() - 1) * output_channel_stride() + groups() * grou… in TestSetupNHWCxF32()
2962 …next_batch_size() * ((next_output_height() * next_output_width() - 1) * output_channel_stride() + … in TestSetupNHWCxF32()
2978 for (size_t oc = 0; oc < group_output_channels(); oc++) { in TestSetupNHWCxF32() local
2979 …(i * output_height() + oy) * output_width() + ox) * groups() + g) * group_output_channels() + oc] = in TestSetupNHWCxF32()
2980 bias[g * group_output_channels() + oc]; in TestSetupNHWCxF32()
2993 const size_t iy = oy * subsampling_height() + ky * dilation_height() - padding_top(); in TestSetupNHWCxF32()
2996 … const size_t ix = ox * subsampling_width() + kx * dilation_width() - padding_left(); in TestSetupNHWCxF32()
2999 for (size_t oc = 0; oc < group_output_channels(); oc++) { in TestSetupNHWCxF32() local
3001 …i * output_height() + oy) * output_width() + ox) * groups() + g) * group_output_channels() + oc] += in TestSetupNHWCxF32()
3003 …kernel[(((g * group_output_channels() + oc) * kernel_height() + ky) * kernel_width() + kx) * group… in TestSetupNHWCxF32()
3019 …const float output_min = accumulated_min + (accumulated_max - accumulated_min) / 255.0f * float(qm… in TestSetupNHWCxF32()
3020 …const float output_max = accumulated_max - (accumulated_max - accumulated_min) / 255.0f * float(25… in TestSetupNHWCxF32()
3073 …1.0e-4 * std::abs(output_ref[(((i * output_height() + y) * output_width() + x) * groups() + g) * g… in TestSetupNHWCxF32()
3081 // Re-generate data for the second run. in TestSetupNHWCxF32()
3091 for (size_t oc = 0; oc < group_output_channels(); oc++) { in TestSetupNHWCxF32() local
3092 …output_height() + oy) * next_output_width() + ox) * groups() + g) * group_output_channels() + oc] = in TestSetupNHWCxF32()
3093 bias[g * group_output_channels() + oc]; in TestSetupNHWCxF32()
3106 const size_t iy = oy * subsampling_height() + ky * dilation_height() - padding_top(); in TestSetupNHWCxF32()
3109 … const size_t ix = ox * subsampling_width() + kx * dilation_width() - padding_left(); in TestSetupNHWCxF32()
3112 for (size_t oc = 0; oc < group_output_channels(); oc++) { in TestSetupNHWCxF32() local
3114 …utput_height() + oy) * next_output_width() + ox) * groups() + g) * group_output_channels() + oc] += in TestSetupNHWCxF32()
3116 …kernel[(((g * group_output_channels() + oc) * kernel_height() + ky) * kernel_width() + kx) * group… in TestSetupNHWCxF32()
3155 …1.0e-4 * std::abs(next_output_ref[(((i * next_output_height() + y) * next_output_width() + x) * gr… in TestSetupNHWCxF32()