[quant] Check if cuda quantizing while on qnnpack engine (#85423)
Although not possible in practice, while running the tests it is possible to try to quantize a CUDA tensor while quantization engine is set to QNNPACK. This would override the memory allocator from CUDA to MobileCPU, which would cause the new quantized tensors to be allocated on a CPU (instead of CUDA).
Please, note that this is not a realistic scenario, as the qnnpack quantization engine is only "emulated" during the tests. When running on a real mobile CPU we don't expect a CUDA to be present.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/85423
Approved by: https://github.com/jerryzh168