code: def _check_device(self, requested_device, map_device):
          
          type_1 = torch.device(requested_device)
          type_2 = torch.device(map_device)
          if type_1 != type_2:
              warnings.warn(
                  'Setting self.device = {} since the requested device ({}) '
                  'is not available.'.format(map_device, requested_device),
                  DeviceWarning)
              return map_device
          # return requested_device instead of map_device even though we
          # checked for *type* equality as we might have 'cuda:0' vs. 'cuda:1'.
          return requested_device
docs: Compare the requested device with the map device and
          return the map device if it differs from the requested device
          along with a warning.