| 195 | } |
| 196 | |
| 197 | void Conv3DFp32SmallTest() |
| 198 | { |
| 199 | std::vector<int32_t> inputShape { 1, 3, 10, 10, 1 }; |
| 200 | std::vector<int32_t> filterShape { 3, 3, 3, 1, 1 }; |
| 201 | std::vector<int32_t> biasShape { 1 }; |
| 202 | std::vector<int32_t> outputShape { 1, 1, 4, 4, 1 }; |
| 203 | |
| 204 | std::vector<float> inputValues = CreateFloatData<float>(300, 100.0f); |
| 205 | |
| 206 | std::vector<float> filterValues = |
| 207 | { |
| 208 | 0.125977f, 0.150391f, 0.101562f, |
| 209 | 0.0585938f, 0.0864258f, 0.043457f, |
| 210 | 0.034668f, 0.0322266f, 0.0385742f, |
| 211 | |
| 212 | 0.125977f, 0.150391f, -0.101562f, |
| 213 | -0.0585938f,-0.0864258f,-0.043457f, |
| 214 | -0.0104630f, 0.0154114f, 0.0013768f, |
| 215 | |
| 216 | 0.0344238f, 0.035644f, 0.0495605f, |
| 217 | 0.0683594f, 0.099121f, -0.0461426f, |
| 218 | -0.0996094f,-0.126953f, -0.043457f, |
| 219 | }; |
| 220 | |
| 221 | std::vector<float> biasValues = { 0 }; |
| 222 | |
| 223 | std::vector<float> expectedOutputValues = |
| 224 | { |
| 225 | -0.08156067f, -0.06891209f, -0.05589598f, -0.04310101f, |
| 226 | 0.04584253f, 0.05855697f, 0.07129729f, 0.08325434f, |
| 227 | 0.17304349f, 0.18521416f, 0.19818866f, 0.21096253f, |
| 228 | 0.29965734f, 0.312698f, 0.32547557f, 0.33818722f |
| 229 | }; |
| 230 | |
| 231 | Convolution3dTest<float>(tflite::BuiltinOperator_CONV_3D, |
| 232 | ::tflite::TensorType_FLOAT32, |
| 233 | { 2, 2, 2 }, // strideX, strideY, strideZ |
| 234 | { 1, 1, 1 }, // dilationX, dilationY, dilationZ |
| 235 | tflite::Padding_VALID, |
| 236 | tflite::ActivationFunctionType_NONE, |
| 237 | inputShape, |
| 238 | filterShape, |
| 239 | outputShape, |
| 240 | inputValues, |
| 241 | filterValues, |
| 242 | expectedOutputValues, |
| 243 | biasShape, |
| 244 | biasValues); |
| 245 | } |
| 246 | |
| 247 | TEST_SUITE("Convolution3dTest_CpuRefTests") |
| 248 | { |