If you use different modules on different GPUs, you would also have to transfer the tensors in the forward to the device as given in the example.
In your case search_result should be transferred to 'cuda:2'.