| 134 | |
| 135 | |
| 136 | void Conv3DWithBiasesDilationFp32Test(std::vector<armnn::BackendId>& backends) |
| 137 | { |
| 138 | std::vector<int32_t> inputShape { 1, 5, 5, 5, 2 }; |
| 139 | std::vector<int32_t> filterShape { 2, 2, 2, 2, 2 }; |
| 140 | std::vector<int32_t> biasShape { 2 }; |
| 141 | std::vector<int32_t> outputShape { 1, 2, 2, 2, 2 }; |
| 142 | |
| 143 | std::vector<float> inputValues = CreateFloatData<float>(250, 1.0f); |
| 144 | |
| 145 | std::vector<float> filterValues = |
| 146 | { |
| 147 | -1.f, -1.f, -1.f, -1.f, -1.f, -1.f, -1.f, -1.f, -1.f, -1.f, -1.f, 1.f, 1.f, 1.f, -1.f, -1.f, |
| 148 | 1.f, 1.f, -1.f, 1.f, -1.f, 1.f, -1.f, 1.f, -1.f, -1.f, -1.f, 1.f, -1.f, 1.f, -1.f, 1.f, |
| 149 | }; |
| 150 | |
| 151 | std::vector<float> biasValues = { 0.f, 2.f }; |
| 152 | |
| 153 | // Since the dilation rate is 3 this will dilate the kernel to be 4x4, |
| 154 | // therefore the output will be 2x2 |
| 155 | std::vector<float> expectedOutputValues = |
| 156 | { |
| 157 | -1124.f, 976.f, |
| 158 | -1148.f, 980.f, |
| 159 | |
| 160 | -1244.f, 996.f, |
| 161 | -1268.f, 1000.f, |
| 162 | |
| 163 | -1724.f, 1076.f, |
| 164 | -1748.f, 1080.f, |
| 165 | |
| 166 | -1844.f, 1096.f, |
| 167 | -1868.f, 1100.f |
| 168 | }; |
| 169 | |
| 170 | Convolution3dTest<float>(tflite::BuiltinOperator_CONV_3D, |
| 171 | ::tflite::TensorType_FLOAT32, |
| 172 | { 1, 1, 1 }, // strideX, strideY, strideZ |
| 173 | { 3, 3, 3 }, // dilationX, dilationY, dilationZ |
| 174 | tflite::Padding_VALID, |
| 175 | tflite::ActivationFunctionType_NONE, |
| 176 | inputShape, |
| 177 | filterShape, |
| 178 | outputShape, |
| 179 | inputValues, |
| 180 | filterValues, |
| 181 | expectedOutputValues, |
| 182 | biasShape, |
| 183 | biasValues, |
| 184 | {1.0f}, |
| 185 | {0}, |
| 186 | {1.0f}, |
| 187 | {0}, |
| 188 | 2.0f, |
| 189 | 0, |
| 190 | 1.0f, |
| 191 | 0, |
| 192 | 1, |
| 193 | 3, |