| 5704 | // ---------------------------------------------------------------------------------------- |
| 5705 | |
| 5706 | void test_reorg() |
| 5707 | { |
| 5708 | IF_DLIB_USE_CUDA( |
| 5709 | print_spinner(); |
| 5710 | resizable_tensor x(2, 4, 8, 16); |
| 5711 | resizable_tensor out_cpu(2, 16, 4, 8), out_cuda(2, 16, 4, 8); |
| 5712 | resizable_tensor grad_cpu(x), grad_cuda(x); |
| 5713 | tt::tensor_rand rnd; |
| 5714 | rnd.fill_gaussian(x); |
| 5715 | cpu::reorg(false, out_cpu, 2, 2, x); |
| 5716 | cuda::reorg(false, out_cuda, 2, 2, x); |
| 5717 | DLIB_TEST(max(squared(mat(out_cuda) - mat(out_cpu))) == 0); |
| 5718 | cpu::reorg_gradient(false, grad_cpu, 2, 2, out_cpu); |
| 5719 | cuda::reorg_gradient(false, grad_cuda, 2, 2, out_cuda); |
| 5720 | DLIB_TEST(max(squared(mat(out_cuda) - mat(out_cpu))) == 0); |
| 5721 | ) |
| 5722 | } |
| 5723 | |
| 5724 | void test_input_tensor() |
| 5725 | { |
no test coverage detected