| 745 | }; |
| 746 | |
| 747 | TEST_F(FusedPadConvOpTest, PaddingConvTest) { |
| 748 | const int depth = 1; |
| 749 | const int image_width = 4; |
| 750 | const int image_height = 3; |
| 751 | const int image_batch_count = 1; |
| 752 | Tensor image(DT_FLOAT, {image_batch_count, image_height, image_width, depth}); |
| 753 | test::FillValues<float>(&image, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}); |
| 754 | |
| 755 | const int kFilterSize = 3; |
| 756 | const int kFilterCount = 1; |
| 757 | Tensor filter(DT_FLOAT, {kFilterSize, kFilterSize, depth, kFilterCount}); |
| 758 | test::FillValues<float>(&filter, {1, 4, 7, 2, 5, 8, 3, 6, 9}); |
| 759 | |
| 760 | const int padding_height = 4; |
| 761 | const int padding_width = 2; |
| 762 | Tensor padding(DT_INT32, {padding_height, padding_width}); |
| 763 | test::FillValues<int32>(&padding, {0, 0, 3, 4, 1, 2, 0, 0}); |
| 764 | |
| 765 | Tensor expected(DT_FLOAT, TensorShape({1, 8, 5, 1})); |
| 766 | test::FillValues<float>( |
| 767 | &expected, |
| 768 | {0, 0, 0, 0, 0, 24, 42, 60, 33, 12, 105, 150, 183, 95, |
| 769 | 32, 235, 312, 357, 178, 56, 187, 234, 261, 121, 32, 106, 126, 138, |
| 770 | 59, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}); |
| 771 | |
| 772 | Run<float>(DT_FLOAT, image, filter, padding, expected, "NHWC"); |
| 773 | } |
| 774 | |
| 775 | TEST_F(FusedPadConvOpTest, PaddingConvTestNchw) { |
| 776 | const int depth = 1; |
nothing calls this directly
no test coverage detected