code: def _collate(self, batch):
          
  
          Y_batch = None
          if isinstance(batch[0], tuple):
              batch, Y_batch = list(zip(*batch))
              Y_batch = self._cuda(torch.Tensor(Y_batch))
  
          f_batch, v_batch = list(zip(*batch))
  
          f_batch, _ = pad_batch(f_batch, 0)
          v_batch, _ = pad_batch(v_batch, 0, type="float")
  
          f_batch = self._cuda(f_batch)
          v_batch = self._cuda(v_batch)
  
          if Y_batch is not None:
              return [f_batch, v_batch], Y_batch
          else:
              return [f_batch, v_batch]
docs: Puts each data field into a tensor.
  
          :param batch: The input data batch.
          :type batch: list of (features, feature_weights) pair
          :return: Preprocessed data.
          :rtype: list of torch.Tensor with torch.Tensor (Optional)