Home
last modified time | relevance | path

Searched refs:y_ref (Results 1 – 25 of 33) sorted by relevance

12

/external/XNNPACK/test/
Dvbinaryc-microkernel-tester.h95 std::vector<float> y_ref(batch_size());
109 y_ref[i] = a_data[i] + b;
112 y_ref[i] = a_data[i] / b;
115 y_ref[i] = b / a_data[i];
118 y_ref[i] = std::max<float>(a_data[i], b);
121 y_ref[i] = std::min<float>(a_data[i], b);
124 y_ref[i] = a_data[i] * b;
127 y_ref[i] = a_data[i] - b;
130 y_ref[i] = b - a_data[i];
134 const float accumulated_min = *std::min_element(y_ref.cbegin(), y_ref.cend());
[all …]
Dvbinary-microkernel-tester.h102 std::vector<float> y_ref(batch_size());
118 y_ref[i] = a_data[i] + b_data[i];
121 y_ref[i] = a_data[i] / b_data[i];
124 y_ref[i] = std::max<float>(a_data[i], b_data[i]);
127 y_ref[i] = std::min<float>(a_data[i], b_data[i]);
130 y_ref[i] = a_data[i] * b_data[i];
133 y_ref[i] = a_data[i] - b_data[i];
137 const float accumulated_min = *std::min_element(y_ref.cbegin(), y_ref.cend());
138 const float accumulated_max = *std::max_element(y_ref.cbegin(), y_ref.cend());
147 y_ref[i] = std::max<float>(std::min<float>(y_ref[i], y_max), y_min);
[all …]
Drmax-microkernel-tester.h55 uint8_t y_ref = 0; in Test() local
57 y_ref = std::max(y_ref, x[i]); in Test()
65 ASSERT_EQ(y_ref, y) << "n = " << n(); in Test()
79 float y_ref = 0; in Test() local
81 y_ref = std::max(y_ref, x[i]); in Test()
89 ASSERT_EQ(y_ref, y) << "n = " << n(); in Test()
Dgavgpool-microkernel-tester.h156 std::vector<uint8_t> y_ref(n());
192 y_ref[j] = xnn_avgpool_quantize(acc, scalar_quantization_params);
213 ASSERT_EQ(uint32_t(y_ref[i]), uint32_t(y[i]))
228 std::vector<uint8_t> y_ref(n());
265 y_ref[j] = xnn_avgpool_quantize(acc, scalar_quantization_params);
287 ASSERT_EQ(uint32_t(y_ref[i]), uint32_t(y[i]))
301 std::vector<float> y_ref(n());
314 y_ref[j] = acc / float(m());
318 const float accumulated_min = *std::min_element(y_ref.cbegin(), y_ref.cend());
319 const float accumulated_max = *std::max_element(y_ref.cbegin(), y_ref.cend());
[all …]
Davgpool-microkernel-tester.h225 std::vector<uint8_t> y_ref(n() * kc());
267 y_ref[i * kc() + k] = xnn_avgpool_quantize(acc, scalar_quantization_params);
292 ASSERT_EQ(uint32_t(y_ref[i * kc() + k]), uint32_t(y[i * y_stride() + k]))
312 std::vector<uint8_t> y_ref(n() * kc());
354 y_ref[i * kc() + k] = xnn_avgpool_quantize(acc, scalar_quantization_params);
379 ASSERT_EQ(uint32_t(y_ref[i * kc() + k]), uint32_t(y[i * y_stride() + k]))
398 std::vector<float> y_ref(n() * kc());
415 y_ref[i * kc() + k] = acc / float(ks());
420 const float accumulated_min = *std::min_element(y_ref.cbegin(), y_ref.cend());
421 const float accumulated_max = *std::max_element(y_ref.cbegin(), y_ref.cend());
[all …]
Dadd-operator-tester.h186 std::vector<float> y_ref(batch_size() * channels()); in TestQ8()
200 y_ref[i * channels() + c] = float(y_zero_point()) + in TestQ8()
203 y_ref[i * channels() + c] = std::min<float>(y_ref[i * channels() + c], float(qmax())); in TestQ8()
204 y_ref[i * channels() + c] = std::max<float>(y_ref[i * channels() + c], float(qmin())); in TestQ8()
240 ASSERT_NEAR(float(int32_t(y[i * y_stride() + c])), y_ref[i * channels() + c], 0.6f); in TestQ8()
254 std::vector<float> y_ref(batch_size() * channels()); in TestF32()
263 y_ref[i * channels() + c] = a[i * a_stride() + c] + b[i * b_stride() + c]; in TestF32()
266 const float accumulated_min = *std::min_element(y_ref.cbegin(), y_ref.cend()); in TestF32()
267 const float accumulated_max = *std::max_element(y_ref.cbegin(), y_ref.cend()); in TestF32()
275 y_ref[i * channels() + c] = std::min(std::max(y_ref[i * channels() + c], y_min), y_max); in TestF32()
[all …]
Dgavgpool-spchw-microkernel-tester.h87 std::vector<float> y_ref(channels());
98 y_ref[i] = acc / float(elements());
102 const float accumulated_min = *std::min_element(y_ref.cbegin(), y_ref.cend());
103 const float accumulated_max = *std::max_element(y_ref.cbegin(), y_ref.cend());
122 for (float& y_value : y_ref) {
135 ASSERT_NEAR(y[i], y_ref[i], std::abs(y_ref[i]) * 1.0e-6f)
Dvunary-microkernel-tester.h87 std::vector<double> y_ref(batch_size());
103 y_ref[i] = e / (1.0 + e);
108 const float accumulated_min = *std::min_element(y_ref.cbegin(), y_ref.cend());
109 const float accumulated_max = *std::max_element(y_ref.cbegin(), y_ref.cend());
118 y_ref[i] = std::max<float>(std::min<float>(y_ref[i], y_max), y_min);
137 ASSERT_NEAR(y[i], y_ref[i], 5.0e-6)
Dprelu-microkernel-tester.h127 std::vector<float> y_ref(channels());
140 y_ref[i] = std::signbit(x_data[i]) ? x_data[i] * w[i] : x_data[i];
144 const float accumulated_min = *std::min_element(y_ref.cbegin(), y_ref.cend());
145 const float accumulated_max = *std::max_element(y_ref.cbegin(), y_ref.cend());
164 for (float& value : y_ref) {
181 ASSERT_NEAR(y[i], y_ref[i], 1.0e-6f * std::abs(y_ref[i]))
Dprelu-operator-tester.h109 std::vector<float> y_ref(batch_size() * channels()); in TestF32()
118y_ref[i * channels() + c] = std::signbit(x[i * x_stride() + c]) ? x[i * x_stride() + c] * w[c] : x… in TestF32()
123 const float accumulated_min = *std::min_element(y_ref.cbegin(), y_ref.cend()); in TestF32()
124 const float accumulated_max = *std::max_element(y_ref.cbegin(), y_ref.cend()); in TestF32()
132 for (float& value : y_ref) { in TestF32()
168 …ASSERT_NEAR(y[i * y_stride() + c], y_ref[i * channels() + c], 1.0e-6f * std::abs(y_ref[i * channel… in TestF32()
Dvmulcaddc-microkernel-tester.h133 std::vector<float> y_ref(rows() * channels());
152 y_ref[i * channels() + j] = x_data[i * input_stride() + j] * scale[j] + bias[j];
155 const float accumulated_min = *std::min_element(y_ref.cbegin(), y_ref.cend());
156 const float accumulated_max = *std::max_element(y_ref.cbegin(), y_ref.cend());
160 for (float& y_value : y_ref) {
185 …ASSERT_NEAR(y[i * output_stride() + j], y_ref[i * channels() + j], std::abs(y_ref[i * channels() +…
Dlut-norm-microkernel-tester.h65 std::vector<float> y_ref(n()); in Test()
82 y_ref[i] = 256.0f * float(t[x_data[i]]) / float(sum); in Test()
83 y_ref[i] = std::min(y_ref[i], 255.0f); in Test()
91 ASSERT_NEAR(y_ref[i], float(y[i]), 0.5f) in Test()
Dpack-microkernel-tester.h87 std::vector<uint32_t> y_ref(mr() * k()); in Test()
93 std::fill(y_ref.begin(), y_ref.end(), c); in Test()
96 y_ref[j * mr() + i] = x[std::min(i, m() - 1) * x_stride() + j]; in Test()
109 ASSERT_EQ(y_ref[j * mr() + i], y[j * mr() + i]) in Test()
Dvscaleextexp-microkernel-tester.h51 std::vector<double> y_ref(elements()); in Test()
67 y_ref[i] = std::exp(double(x[i])) / sum; in Test()
75 ASSERT_NEAR(y_ref[i], y[i], std::abs(y_ref[i]) * 1.0e-6) in Test()
Dvscaleexpminusmax-microkernel-tester.h63 std::vector<double> y_ref(elements()); in Test()
70 y_ref[i] = double(scale()) * exp(double(x[i]) - double(x_max)); in Test()
78 ASSERT_NEAR(y_ref[i], y[i], std::abs(y_ref[i]) * 1.0e-6) in Test()
Draddstoreexpminusmax-microkernel-tester.h52 std::vector<double> y_ref(elements()); in Test()
62 y_ref[i] = y_ref_value; in Test()
72 ASSERT_NEAR(y_ref[i], double(y[i]), std::abs(y_ref[i]) * 1.0e-6) in Test()
Dclamp-microkernel-tester.h86 std::vector<uint8_t> y_ref(n());
109 y_ref[i] = std::max(std::min(x_data[i], qmax()), qmin());
121 ASSERT_EQ(uint32_t(y_ref[i]), uint32_t(y[i]))
135 std::vector<float> y_ref(n());
158 y_ref[i] = std::max(std::min(x_data[i], float(qmax())), float(qmin()));
170 ASSERT_EQ(y_ref[i], y[i])
Dunpool-microkernel-tester.h88 std::vector<uint32_t> y_ref((p() - 1) * y_stride() + c()); in Test()
100 std::fill(y_ref.begin(), y_ref.end(), f()); in Test()
103 (indirect_y[idx] - y.data() + y_ref.data())[k] = x[k]; in Test()
112 ASSERT_EQ(y_ref[i * y_stride() + k], y[i * y_stride() + k]) in Test()
Dvscale-microkernel-tester.h65 std::vector<float> y_ref(n());
78 y_ref[i] = x_data[i] * c;
86 ASSERT_NEAR(y[i], y_ref[i], std::abs(y_ref[i]) * 1.0e-6f)
Dpad-microkernel-tester.h109 std::vector<uint32_t> y_ref(m() * (l() + n() + r())); in Test()
115 std::fill(y_ref.begin(), y_ref.end(), c); in Test()
118 y_ref[k * (l() + n() + r()) + l() + i] = x[k * x_stride() + i]; in Test()
135 ASSERT_EQ(y_ref[k * (l() + n() + r()) + i], y[k * y_stride() + i]) in Test()
Dhswish-microkernel-tester.h65 std::vector<float> y_ref(batch_size());
88 y_ref[i] = x_data[i] * std::max(std::min(x_data[i] + 3.0f, 6.0f), 0.0f) / 6.0f;
96 ASSERT_NEAR(y_ref[i], y[i], std::abs(y_ref[i]) * 1.0e-6f)
Dlut-microkernel-tester.h62 std::vector<uint8_t> y_ref(n()); in Test()
75 y_ref[i] = t[x_data[i]]; in Test()
83 ASSERT_EQ(uint32_t(y_ref[i]), uint32_t(y[i])) in Test()
/external/XNNPACK/eval/
Df32-exp.cc45 const double y_ref = std::exp(double(x[i])); in ExpError() local
46 const double abs_error = std::abs(y_ref - double(y[i])); in ExpError()
47 const float y_abs = std::abs(y_ref); in ExpError()
61 const double y_ref = std::exp(double(x[i])); in ExpError() local
62 const double abs_error = std::abs(y_ref - double(y[i])); in ExpError()
63 const float y_abs = std::abs(y_ref); in ExpError()
Df32-extexp.cc47 const double y_ref = std::exp(double(x[i])); in ExpError() local
49 const double y_ref_m = std::frexp(y_ref, &y_ref_e); in ExpError()
64 const double y_ref = std::exp(double(x[i])); in ExpError() local
66 const double y_ref_m = std::frexp(y_ref, &y_ref_e); in ExpError()
Df32-expminus.cc42 const double y_ref = std::exp(double(x[i])); in ExpError() local
43 const double abs_error = std::abs(y_ref - double(y[i])); in ExpError()
44 const float y_abs = std::abs(y_ref); in ExpError()

12