()
| 179 | |
| 180 | |
| 181 | def test_image_decoder_fused(): |
| 182 | threads = 4 |
| 183 | batch_size = 10 |
| 184 | for test_fun in [ |
| 185 | create_decoder_slice_pipeline, |
| 186 | create_decoder_crop_pipeline, |
| 187 | create_decoder_random_crop_pipeline, |
| 188 | ]: |
| 189 | # before CUDA 11.4 HW decoder API doesn't support ROI so we get slightly different results |
| 190 | # HW decoder + slice vs fused which in this case is executed by the hybrid backend |
| 191 | if test_fun == create_decoder_random_crop_pipeline or get_nvjpeg_ver() < (11, 4, 0): |
| 192 | # random_resized_crop can properly handle border as it has pixels that are cropped out, |
| 193 | # while plain resize following image_decoder_random_crop cannot do that |
| 194 | # and must duplicate the border pixels |
| 195 | def mean_close(x, y): |
| 196 | return np.mean(np.abs(x - y) < 0.5) |
| 197 | |
| 198 | validation_fun = mean_close |
| 199 | else: |
| 200 | |
| 201 | def mean_close(x, y): |
| 202 | return np.allclose(x, y) |
| 203 | |
| 204 | validation_fun = mean_close |
| 205 | for device in ["cpu", "mixed"]: |
| 206 | for img_type in test_good_path: |
| 207 | yield ( |
| 208 | run_decode_fused, |
| 209 | test_fun, |
| 210 | good_path, |
| 211 | img_type, |
| 212 | batch_size, |
| 213 | device, |
| 214 | threads, |
| 215 | validation_fun, |
| 216 | ) |
| 217 | |
| 218 | |
| 219 | def check_FastDCT_body(batch_size, img_type, device): |
nothing calls this directly
no test coverage detected