John Mcloughlin | 0ec0087 | 2023-05-15 17:03:49 +0100 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2023 Arm Ltd and Contributors. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | #include "SquaredDifferenceTestImpl.hpp" |
| 7 | |
| 8 | #include "ElementwiseTestImpl.hpp" |
| 9 | |
| 10 | LayerTestResult<float, 4> SquaredDifferenceTest( |
| 11 | armnn::IWorkloadFactory& workloadFactory, |
| 12 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 13 | const armnn::ITensorHandleFactory& tensorHandleFactory) |
| 14 | { |
| 15 | IgnoreUnused(memoryManager); |
| 16 | unsigned int shape[] = { 2, 2, 2, 2 }; |
| 17 | |
| 18 | std::vector<float> input0 = |
| 19 | { |
| 20 | 7.f, 3.f, 4.f, 2.f, 6.f, 4.f, 2.f, 1.f, |
| 21 | 3.f, 1.f, 0.f, 1.f, 4.f, 3.f, 4.f, 3.f |
| 22 | }; |
| 23 | |
| 24 | std::vector<float> input1 = |
| 25 | { |
| 26 | 5.f, 3.f, 2.f, 5.f, 3.f, 3.f, 4.f, 3.f, |
| 27 | 4.f, 4.f, 3.f, 2.f, 5.f, 5.f, 5.f, 5.f |
| 28 | }; |
| 29 | |
| 30 | std::vector<float> output |
| 31 | { |
| 32 | 4.f, 0.f, 4.f, 9.f, 9.f, 1.f, 4.f, 4.f, |
| 33 | 1.f, 9.f, 9.f, 1.f, 1.f, 4.f, 1.f, 4.f |
| 34 | }; |
| 35 | |
| 36 | return ElementwiseTestHelper<4, armnn::DataType::Float32, armnn::DataType::Float32>( |
| 37 | workloadFactory, |
| 38 | memoryManager, |
| 39 | armnn::BinaryOperation::SqDiff, |
| 40 | shape, |
| 41 | input0, |
| 42 | shape, |
| 43 | input1, |
| 44 | shape, |
| 45 | output, |
| 46 | tensorHandleFactory); |
| 47 | } |
| 48 | |
| 49 | LayerTestResult<float, 4> SquaredDiffBroadcast1ElementTest( |
| 50 | armnn::IWorkloadFactory& workloadFactory, |
| 51 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 52 | const armnn::ITensorHandleFactory& tensorHandleFactory) |
| 53 | { |
| 54 | IgnoreUnused(memoryManager); |
| 55 | unsigned int shape0[] = { 1, 2, 2, 2 }; |
| 56 | unsigned int shape1[] = { 1, 1, 1, 1 }; |
| 57 | |
| 58 | std::vector<float> input0 = |
| 59 | { |
| 60 | 1.f, 2.f, 3.f, 4.f, 5.f, 0.f, 2.f, 1.f |
| 61 | }; |
| 62 | |
| 63 | std::vector<float> input1 = { 2.f }; |
| 64 | |
| 65 | std::vector<float> output = |
| 66 | { |
| 67 | 1.f, 0.f, 1.f, 4.f, 9.f, 4.f, 0.f, 1.f |
| 68 | }; |
| 69 | |
| 70 | return ElementwiseTestHelper<4, armnn::DataType::Float32, armnn::DataType::Float32>( |
| 71 | workloadFactory, |
| 72 | memoryManager, |
| 73 | armnn::BinaryOperation::SqDiff, |
| 74 | shape0, |
| 75 | input0, |
| 76 | shape1, |
| 77 | input1, |
| 78 | shape0, |
| 79 | output, |
| 80 | tensorHandleFactory); |
| 81 | } |
| 82 | |
| 83 | LayerTestResult<float, 4> SquaredDiffBroadcastTest( |
| 84 | armnn::IWorkloadFactory & workloadFactory, |
| 85 | const armnn::IBackendInternal::IMemoryManagerSharedPtr & memoryManager, |
| 86 | const armnn::ITensorHandleFactory& tensorHandleFactory) |
| 87 | { |
| 88 | IgnoreUnused(memoryManager); |
| 89 | const unsigned int shape0[] = { 1, 2, 2, 3 }; |
| 90 | const unsigned int shape1[] = { 1, 1, 1, 3 }; |
| 91 | |
| 92 | std::vector<float> input0 = |
| 93 | { |
| 94 | 1.f, 2.f, 3.f, 3.f, 6.f, 4.f, |
| 95 | 4.f, 0.f, 2.f, 3.f, 4.f, 4.f |
| 96 | }; |
| 97 | |
| 98 | std::vector<float> input1 = { 1.f, 3.f, 1.f }; |
| 99 | |
| 100 | std::vector<float> output = |
| 101 | { |
| 102 | 0.f, 1.f, 4.f, 4.f, 9.f, 9.f, |
| 103 | 9.f, 9.f, 1.f, 4.f, 1.f, 9.f |
| 104 | }; |
| 105 | |
| 106 | return ElementwiseTestHelper<4, armnn::DataType::Float32, armnn::DataType::Float32>( |
| 107 | workloadFactory, |
| 108 | memoryManager, |
| 109 | armnn::BinaryOperation::SqDiff, |
| 110 | shape0, |
| 111 | input0, |
| 112 | shape1, |
| 113 | input1, |
| 114 | shape0, |
| 115 | output, |
| 116 | tensorHandleFactory); |
| 117 | } |
| 118 | |
| 119 | LayerTestResult<armnn::Half, 4> SquaredDifferenceFloat16Test( |
| 120 | armnn::IWorkloadFactory& workloadFactory, |
| 121 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 122 | const armnn::ITensorHandleFactory& tensorHandleFactory) |
| 123 | { |
| 124 | IgnoreUnused(memoryManager); |
| 125 | using namespace half_float::literal; |
| 126 | |
| 127 | unsigned int shape[] = { 2, 2, 2, 2 }; |
| 128 | |
| 129 | std::vector<armnn::Half> input0 = |
| 130 | { |
| 131 | 1._h, 5._h, 1._h, 4._h, 6._h, 1._h, 3._h, 5._h, |
| 132 | 3._h, 7._h, 6._h, 3._h, 8._h, 4._h, 4._h, 2._h |
| 133 | }; |
| 134 | |
| 135 | std::vector<armnn::Half> input1 = |
| 136 | { |
| 137 | 2._h, 2._h, 2._h, 2._h, 3._h, 3._h, 3._h, 3._h, |
| 138 | 4._h, 4._h, 4._h, 4._h, 5._h, 6._h, 5._h, 5._h |
| 139 | }; |
| 140 | |
| 141 | std::vector<armnn::Half> output |
| 142 | { |
| 143 | 1._h, 9._h, 1._h, 4._h, 9._h, 4._h, 0._h, 4._h, |
| 144 | 1._h, 9._h, 4._h, 1._h, 9._h, 4._h, 1._h, 9._h |
| 145 | }; |
| 146 | |
| 147 | return ElementwiseTestHelper<4, armnn::DataType::Float16, armnn::DataType::Float16>( |
| 148 | workloadFactory, |
| 149 | memoryManager, |
| 150 | armnn::BinaryOperation::SqDiff, |
| 151 | shape, |
| 152 | input0, |
| 153 | shape, |
| 154 | input1, |
| 155 | shape, |
| 156 | output, |
| 157 | tensorHandleFactory); |
| 158 | } |
| 159 | |
| 160 | LayerTestResult<armnn::Half, 4> SquaredDiffBroadcast1ElementFloat16Test( |
| 161 | armnn::IWorkloadFactory& workloadFactory, |
| 162 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 163 | const armnn::ITensorHandleFactory& tensorHandleFactory) |
| 164 | { |
| 165 | IgnoreUnused(memoryManager); |
| 166 | using namespace half_float::literal; |
| 167 | |
| 168 | const unsigned int shape0[] = { 1, 2, 2, 3 }; |
| 169 | const unsigned int shape1[] = { 1, 1, 1, 1 }; |
| 170 | |
| 171 | std::vector<armnn::Half> input0 = |
| 172 | { |
| 173 | 1._h, 2._h, 3._h, 4._h, 5._h, 4._h, |
| 174 | 1._h, 5._h, 4._h, 2._h, 0._h, 1._h |
| 175 | }; |
| 176 | |
| 177 | std::vector<armnn::Half> input1 = { 2._h }; |
| 178 | |
| 179 | std::vector<armnn::Half> output = |
| 180 | { |
| 181 | 1._h, 0._h, 1._h, 4._h, 9._h, 4._h, |
| 182 | 1._h, 9._h, 4._h, 0._h, 4._h, 1._h |
| 183 | }; |
| 184 | |
| 185 | return ElementwiseTestHelper<4, armnn::DataType::Float16, armnn::DataType::Float16>( |
| 186 | workloadFactory, |
| 187 | memoryManager, |
| 188 | armnn::BinaryOperation::SqDiff, |
| 189 | shape0, |
| 190 | input0, |
| 191 | shape1, |
| 192 | input1, |
| 193 | shape0, |
| 194 | output, |
| 195 | tensorHandleFactory); |
| 196 | } |
| 197 | |
| 198 | LayerTestResult<armnn::Half, 4> SquaredDiffBroadcastFloat16Test( |
| 199 | armnn::IWorkloadFactory& workloadFactory, |
| 200 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 201 | const armnn::ITensorHandleFactory& tensorHandleFactory) |
| 202 | { |
| 203 | IgnoreUnused(memoryManager); |
| 204 | using namespace half_float::literal; |
| 205 | const unsigned int shape0[] = { 1, 2, 2, 3 }; |
| 206 | const unsigned int shape1[] = { 1, 1, 1, 3 }; |
| 207 | |
| 208 | std::vector<armnn::Half> input0 = |
| 209 | { |
| 210 | 4._h, 2._h, 3._h, 4._h, 5._h, 5._h, |
| 211 | 2._h, 8._h, 1._h, 1._h, 2._h, 4._h |
| 212 | }; |
| 213 | |
| 214 | std::vector<armnn::Half> input1 = { 1._h, 5._h, 3._h }; |
| 215 | |
| 216 | std::vector<armnn::Half> output = |
| 217 | { |
| 218 | 9._h, 9._h, 0._h, 9._h, 0._h, 4._h, |
| 219 | 1._h, 9._h, 4._h, 0._h, 9._h, 1._h |
| 220 | }; |
| 221 | |
| 222 | return ElementwiseTestHelper<4, armnn::DataType::Float16, armnn::DataType::Float16>( |
| 223 | workloadFactory, |
| 224 | memoryManager, |
| 225 | armnn::BinaryOperation::SqDiff, |
| 226 | shape0, |
| 227 | input0, |
| 228 | shape1, |
| 229 | input1, |
| 230 | shape0, |
| 231 | output, |
| 232 | tensorHandleFactory); |
| 233 | } |
| 234 | |
| 235 | LayerTestResult<uint8_t, 4> SquaredDifferenceUint8Test( |
| 236 | armnn::IWorkloadFactory& workloadFactory, |
| 237 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 238 | const armnn::ITensorHandleFactory& tensorHandleFactory) |
| 239 | { |
| 240 | IgnoreUnused(memoryManager); |
| 241 | const unsigned int shape0[] = { 1, 1, 2, 2 }; |
| 242 | const unsigned int shape1[] = { 1, 1, 2, 2 }; |
| 243 | |
| 244 | std::vector<uint8_t> input0 = { 4, 2, 4, 3 }; |
| 245 | |
| 246 | std::vector<uint8_t> input1 = { 1, 2, 2, 2 }; |
| 247 | |
| 248 | std::vector<uint8_t> output = { 9, 0, 4, 1 }; |
| 249 | |
| 250 | return ElementwiseTestHelper<4, armnn::DataType::QAsymmU8, armnn::DataType::QAsymmU8>( |
| 251 | workloadFactory, |
| 252 | memoryManager, |
| 253 | armnn::BinaryOperation::SqDiff, |
| 254 | shape0, |
| 255 | input0, |
| 256 | shape1, |
| 257 | input1, |
| 258 | shape0, |
| 259 | output, |
| 260 | tensorHandleFactory); |
| 261 | } |
| 262 | |
| 263 | LayerTestResult<uint8_t, 4> SquaredDiffBroadcast1ElementUint8Test( |
| 264 | armnn::IWorkloadFactory& workloadFactory, |
| 265 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 266 | const armnn::ITensorHandleFactory& tensorHandleFactory) |
| 267 | { |
| 268 | IgnoreUnused(memoryManager); |
| 269 | const unsigned int shape0[] = { 1, 1, 2, 2 }; |
| 270 | const unsigned int shape1[] = { 1, 1, 1, 1 }; |
| 271 | |
| 272 | std::vector<uint8_t> input0 = { 4, 5, 1, 0 }; |
| 273 | |
| 274 | std::vector<uint8_t> input1 = { 2 }; |
| 275 | |
| 276 | std::vector<uint8_t> output = { 4, 9, 1, 4 }; |
| 277 | |
| 278 | return ElementwiseTestHelper<4, armnn::DataType::QAsymmU8, armnn::DataType::QAsymmU8>( |
| 279 | workloadFactory, |
| 280 | memoryManager, |
| 281 | armnn::BinaryOperation::SqDiff, |
| 282 | shape0, |
| 283 | input0, |
| 284 | shape1, |
| 285 | input1, |
| 286 | shape0, |
| 287 | output, |
| 288 | tensorHandleFactory); |
| 289 | } |
| 290 | |
| 291 | LayerTestResult<uint8_t, 4> SquaredDiffBroadcastUint8Test( |
| 292 | armnn::IWorkloadFactory& workloadFactory, |
| 293 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 294 | const armnn::ITensorHandleFactory& tensorHandleFactory) |
| 295 | { |
| 296 | IgnoreUnused(memoryManager); |
| 297 | const unsigned int shape0[] = { 1, 1, 2, 2 }; |
| 298 | const unsigned int shape1[] = { 1, 1, 1, 2 }; |
| 299 | |
| 300 | std::vector<uint8_t> input0 = { 4, 12, 3, 6 }; |
| 301 | |
| 302 | std::vector<uint8_t> input1 = { 2, 9 }; |
| 303 | |
| 304 | std::vector<uint8_t> output = { 4, 9, 1, 9 }; |
| 305 | |
| 306 | return ElementwiseTestHelper<4, armnn::DataType::QAsymmU8, armnn::DataType::QAsymmU8>( |
| 307 | workloadFactory, |
| 308 | memoryManager, |
| 309 | armnn::BinaryOperation::SqDiff, |
| 310 | shape0, |
| 311 | input0, |
| 312 | shape1, |
| 313 | input1, |
| 314 | shape0, |
| 315 | output, |
| 316 | tensorHandleFactory); |
| 317 | } |
| 318 | |
| 319 | LayerTestResult<int16_t, 4> SquaredDifferenceInt16Test( |
| 320 | armnn::IWorkloadFactory& workloadFactory, |
| 321 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 322 | const armnn::ITensorHandleFactory& tensorHandleFactory) |
| 323 | { |
| 324 | IgnoreUnused(memoryManager); |
| 325 | unsigned int shape[] = { 2, 2, 2, 2 }; |
| 326 | |
| 327 | std::vector<int16_t> input0 = |
| 328 | { |
| 329 | 1, 5, 1, 4, 6, 9, 6, 5, |
| 330 | 3, 2, 3, 6, 4, 4, 1, 4 |
| 331 | }; |
| 332 | |
| 333 | std::vector<int16_t> input1 = |
| 334 | { |
| 335 | 2, 2, 0, 4, 3, 7, 3, 3, |
| 336 | 4, 4, 4, 9, 7, 5, 4, 5 |
| 337 | }; |
| 338 | |
| 339 | std::vector<int16_t> output |
| 340 | { |
| 341 | 1, 9, 1, 0, 9, 4, 9, 4, |
| 342 | 1, 4, 1, 9, 9, 1, 9, 1 |
| 343 | }; |
| 344 | |
| 345 | return ElementwiseTestHelper<4, armnn::DataType::QSymmS16, armnn::DataType::QSymmS16>( |
| 346 | workloadFactory, |
| 347 | memoryManager, |
| 348 | armnn::BinaryOperation::SqDiff, |
| 349 | shape, |
| 350 | input0, |
| 351 | shape, |
| 352 | input1, |
| 353 | shape, |
| 354 | output, |
| 355 | tensorHandleFactory); |
| 356 | } |
| 357 | |
| 358 | LayerTestResult<int16_t, 4> SquaredDiffBroadcast1ElementInt16Test( |
| 359 | armnn::IWorkloadFactory& workloadFactory, |
| 360 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 361 | const armnn::ITensorHandleFactory& tensorHandleFactory) |
| 362 | { |
| 363 | IgnoreUnused(memoryManager); |
| 364 | const unsigned int shape0[] = { 1, 2, 2, 3 }; |
| 365 | const unsigned int shape1[] = { 1, 1, 1, 1 }; |
| 366 | |
| 367 | std::vector<int16_t> input0 = |
| 368 | { |
| 369 | 1, 2, 3, 4, 5, 0, |
| 370 | 5, 4, 1, 4, 5, 2 |
| 371 | }; |
| 372 | |
| 373 | std::vector<int16_t> input1 = { 2 }; |
| 374 | |
| 375 | std::vector<int16_t> output = |
| 376 | { |
| 377 | 1, 0, 1, 4, 9, 4, |
| 378 | 9, 4, 1, 4, 9, 0 |
| 379 | }; |
| 380 | |
| 381 | return ElementwiseTestHelper<4, armnn::DataType::QSymmS16, armnn::DataType::QSymmS16>( |
| 382 | workloadFactory, |
| 383 | memoryManager, |
| 384 | armnn::BinaryOperation::SqDiff, |
| 385 | shape0, |
| 386 | input0, |
| 387 | shape1, |
| 388 | input1, |
| 389 | shape0, |
| 390 | output, |
| 391 | tensorHandleFactory); |
| 392 | } |
| 393 | |
| 394 | LayerTestResult<int16_t, 4> SquaredDiffBroadcastInt16Test( |
| 395 | armnn::IWorkloadFactory& workloadFactory, |
| 396 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 397 | const armnn::ITensorHandleFactory& tensorHandleFactory) |
| 398 | { |
| 399 | IgnoreUnused(memoryManager); |
| 400 | const unsigned int shape0[] = { 1, 2, 2, 3 }; |
| 401 | const unsigned int shape1[] = { 1, 1, 1, 3 }; |
| 402 | |
| 403 | std::vector<int16_t> input0 = |
| 404 | { |
| 405 | 4, 2, 1, 4, 5, 6, |
| 406 | 7, 3, 5, 8, 1, 5 |
| 407 | }; |
| 408 | |
| 409 | std::vector<int16_t> input1 = { 7, 2, 3 }; |
| 410 | |
| 411 | std::vector<int16_t> output = |
| 412 | { |
| 413 | 9, 0, 4, 9, 9, 9, |
| 414 | 0, 1, 4, 1, 1, 4 |
| 415 | }; |
| 416 | |
| 417 | return ElementwiseTestHelper<4, armnn::DataType::QSymmS16, armnn::DataType::QSymmS16>( |
| 418 | workloadFactory, |
| 419 | memoryManager, |
| 420 | armnn::BinaryOperation::SqDiff, |
| 421 | shape0, |
| 422 | input0, |
| 423 | shape1, |
| 424 | input1, |
| 425 | shape0, |
| 426 | output, |
| 427 | tensorHandleFactory); |
| 428 | } |
| 429 | |
| 430 | LayerTestResult<int32_t, 4> SquaredDifferenceInt32Test( |
| 431 | armnn::IWorkloadFactory& workloadFactory, |
| 432 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 433 | const armnn::ITensorHandleFactory& tensorHandleFactory) |
| 434 | { |
| 435 | IgnoreUnused(memoryManager); |
| 436 | unsigned int shape[] = { 2, 2, 2, 2 }; |
| 437 | |
| 438 | std::vector<int32_t> input0 = |
| 439 | { |
| 440 | 1, 3, 4, 3, 6, 4, 2, 6, |
| 441 | 3, 1, 3, 1, 4, 3, 4, 3 |
| 442 | }; |
| 443 | |
| 444 | std::vector<int32_t> input1 = |
| 445 | { |
| 446 | 2, 2, 2, 2, 3, 3, 4, 3, |
| 447 | 4, 4, 4, 4, 5, 5, 5, 5 |
| 448 | }; |
| 449 | |
| 450 | std::vector<int32_t> output |
| 451 | { |
| 452 | 1, 1, 4, 1, 9, 1, 4, 9, |
| 453 | 1, 9, 1, 9, 1, 4, 1, 4 |
| 454 | }; |
| 455 | |
| 456 | return ElementwiseTestHelper<4, armnn::DataType::Signed32, armnn::DataType::Signed32>( |
| 457 | workloadFactory, |
| 458 | memoryManager, |
| 459 | armnn::BinaryOperation::SqDiff, |
| 460 | shape, |
| 461 | input0, |
| 462 | shape, |
| 463 | input1, |
| 464 | shape, |
| 465 | output, |
| 466 | tensorHandleFactory); |
| 467 | } |
| 468 | |
| 469 | LayerTestResult<int32_t, 4> SquaredDiffBroadcastInt32Test( |
| 470 | armnn::IWorkloadFactory& workloadFactory, |
| 471 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 472 | const armnn::ITensorHandleFactory& tensorHandleFactory) |
| 473 | { |
| 474 | IgnoreUnused(memoryManager); |
| 475 | const unsigned int shape0[] = { 1, 2, 2, 3 }; |
| 476 | const unsigned int shape1[] = { 1, 1, 1, 3 }; |
| 477 | |
| 478 | std::vector<int32_t> input0 = |
| 479 | { |
| 480 | 4, 4, 3, 4, 5, 6, |
| 481 | 5, 8, 6, 3, 9, 5 |
| 482 | }; |
| 483 | |
| 484 | std::vector<int32_t> input1 = { 2, 7, 3 }; |
| 485 | |
| 486 | std::vector<int32_t> output = |
| 487 | { |
| 488 | 4, 9, 0, 4, 4, 9, |
| 489 | 9, 1, 9, 1, 4, 4 |
| 490 | }; |
| 491 | |
| 492 | return ElementwiseTestHelper<4, armnn::DataType::Signed32, armnn::DataType::Signed32>( |
| 493 | workloadFactory, |
| 494 | memoryManager, |
| 495 | armnn::BinaryOperation::SqDiff, |
| 496 | shape0, |
| 497 | input0, |
| 498 | shape1, |
| 499 | input1, |
| 500 | shape0, |
| 501 | output, |
| 502 | tensorHandleFactory); |
| 503 | } |
| 504 | |
| 505 | LayerTestResult<int32_t, 4> SquaredDiffBroadcast1ElementInt32Test( |
| 506 | armnn::IWorkloadFactory& workloadFactory, |
| 507 | const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |
| 508 | const armnn::ITensorHandleFactory& tensorHandleFactory) |
| 509 | { |
| 510 | IgnoreUnused(memoryManager); |
| 511 | const unsigned int shape0[] = { 1, 2, 2, 3 }; |
| 512 | const unsigned int shape1[] = { 1, 1, 1, 1 }; |
| 513 | |
| 514 | std::vector<int32_t> input0 = |
| 515 | { |
| 516 | 1, 2, 3, 4, 5, 3, |
| 517 | 3, 1, 0, 2, 1, 5 |
| 518 | }; |
| 519 | |
| 520 | std::vector<int32_t> input1 = { 2 }; |
| 521 | |
| 522 | std::vector<int32_t> output = |
| 523 | { |
| 524 | 1, 0, 1, 4, 9, 1, |
| 525 | 1, 1, 4, 0, 1, 9 |
| 526 | }; |
| 527 | |
| 528 | return ElementwiseTestHelper<4, armnn::DataType::Signed32, armnn::DataType::Signed32>( |
| 529 | workloadFactory, |
| 530 | memoryManager, |
| 531 | armnn::BinaryOperation::SqDiff, |
| 532 | shape0, |
| 533 | input0, |
| 534 | shape1, |
| 535 | input1, |
| 536 | shape0, |
| 537 | output, |
| 538 | tensorHandleFactory); |
| 539 | } |