| 335 | } |
| 336 | |
| 337 | bool test_softmax() { |
| 338 | TestUtils::FP16TestFixture fixture("Softmax"); |
| 339 | |
| 340 | size_t input_a = fixture.create_input({2, 3}); |
| 341 | size_t softmax_result = fixture.graph().softmax(input_a, -1); |
| 342 | |
| 343 | std::vector<__fp16> input_data = {1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}; |
| 344 | fixture.set_input_data(input_a, input_data); |
| 345 | fixture.execute(); |
| 346 | |
| 347 | std::vector<__fp16> expected = {0.09003f, 0.24473f, 0.66524f, 0.09003f, 0.24473f, 0.66524f}; |
| 348 | return fixture.verify_output(softmax_result, expected, 0.01f); |
| 349 | } |
| 350 | |
| 351 | bool test_attention() { |
| 352 | TestUtils::FP16TestFixture fixture("Attention"); |
no test coverage detected