| 412 | } |
| 413 | |
| 414 | bool test_mean_operations() { |
| 415 | TestUtils::FP16TestFixture fixture("Mean Operations"); |
| 416 | |
| 417 | size_t input_a = fixture.create_input({2, 4}); |
| 418 | size_t mean_all = fixture.graph().mean(input_a, -1); |
| 419 | size_t mean_axis0 = fixture.graph().mean(input_a, 0); |
| 420 | size_t mean_axis1 = fixture.graph().mean(input_a, 1); |
| 421 | |
| 422 | std::vector<__fp16> data_a = {2, 4, 6, 8, 10, 12, 14, 16}; |
| 423 | fixture.set_input_data(input_a, data_a); |
| 424 | fixture.execute(); |
| 425 | |
| 426 | std::vector<__fp16> expected_all = {9}; |
| 427 | std::vector<__fp16> expected_axis0 = {6, 8, 10, 12}; |
| 428 | std::vector<__fp16> expected_axis1 = {5, 13}; |
| 429 | |
| 430 | return fixture.verify_output(mean_all, expected_all) && |
| 431 | fixture.verify_output(mean_axis0, expected_axis0) && |
| 432 | fixture.verify_output(mean_axis1, expected_axis1); |
| 433 | } |
| 434 | |
| 435 | bool test_variance_operations() { |
| 436 | TestUtils::FP16TestFixture fixture("Variance Operations"); |
no test coverage detected