Support cpu tensors without direct device invocation (#3842)
Motivation:
Fix for reproducible issue #3837 on cpu. On cpus direct invocation of
torch.cpu.tensor leads to dtype mismatch.
Another way would be to have something like :
["torch.DoubleTensor" if device_type == 'cpu else
'"torch.{}.DoubleTensor".format(device_type)] for all elements in the
supported list , but that would eliminate "torch.cpu.DoubleTensor" ,etc
from the scope.
@jeffra requesting review.
CLA is signed
---------
Co-authored-by: Olatunji Ruwase <olruwase@microsoft.com>
Co-authored-by: inkcherry <mingzhi.liu@intel.com>