| 141 | }; |
| 142 | |
| 143 | TEST_P(ConvolutionOpTest, SimpleTestFloat32) { |
| 144 | ConvolutionOpModel m(GetRegistration(), {TensorType_FLOAT32, {2, 2, 4, 1}}, |
| 145 | {TensorType_FLOAT32, {3, 2, 2, 1}}, |
| 146 | {TensorType_FLOAT32, {}}); |
| 147 | |
| 148 | m.SetInput({ |
| 149 | // First batch |
| 150 | 1, 1, 1, 1, // row = 1 |
| 151 | 2, 2, 2, 2, // row = 2 |
| 152 | // Second batch |
| 153 | 1, 2, 3, 4, // row = 1 |
| 154 | 1, 2, 3, 4, // row = 2 |
| 155 | }); |
| 156 | m.SetFilter({ |
| 157 | 1, 2, 3, 4, // first 2x2 filter |
| 158 | -1, 1, -1, 1, // second 2x2 filter |
| 159 | -1, -1, 1, 1, // third 2x2 filter |
| 160 | }); |
| 161 | m.SetBias({1, 2, 3}); |
| 162 | |
| 163 | m.Invoke(); |
| 164 | |
| 165 | EXPECT_THAT(m.GetOutput(), ElementsAreArray({ |
| 166 | 18, 2, 5, // first batch, left |
| 167 | 18, 2, 5, // first batch, right |
| 168 | 17, 4, 3, // second batch, left |
| 169 | 37, 4, 3, // second batch, right |
| 170 | })); |
| 171 | } |
| 172 | |
| 173 | TEST_P(ConvolutionOpTest, SimpleTestFloat32SingleThreaded) { |
| 174 | ConvolutionOpModel m(GetRegistration(), {TensorType_FLOAT32, {2, 2, 4, 1}}, |
nothing calls this directly
no test coverage detected