def map_location(storage: torch.Storage, location) -> torch.Storage: """ Args: storage (torch.Storage) : the initial deserialization of the storage of the data read by `torch.load`, residing on the CPU. location (str): tag identifiying the location the data being read by `torch.load` was originally saved from. Returns: torch.Storage : the storage """ xpu = xpu_device.XPU(gpu_num) if xpu.is_gpu(): return storage.cuda(xpu.num) else: return storage
def inner_device_mapping(storage: torch.Storage, location) -> torch.Storage: # pylint: disable=unused-argument if cuda_device >= 0: return storage.cuda(cuda_device) else: return storage
def inner_device_mapping(storage: torch.Storage, location) -> torch.Storage: if cuda_device >= 0: return storage.cuda(cuda_device) else: return storage