torch.cuda.comm.reduce_add_coalesced() can handle a list of tensors with different size, but gather() can not.

  
      github.com
  
  
    pytorch/pytorch/blob/master/torch/cuda/comm.py#L196 8

outputs = []
for device, chunk, stream in zip(devices, chunks, streams):
    with torch.cuda.device(device), torch.cuda.stream(stream):
        outputs.append(chunk.cuda(device, async=True))
return tuple(outputs)




def gather(tensors, dim=0, destination=None):
"""Gathers tensors from multiple GPUs.


Tensor sizes in all dimension different than ``dim`` have to match.


Arguments:
    tensors (Iterable[Tensor]): iterable of tensors to gather.
    dim (int): a dimension along which the tensors will be concatenated.
    destination (int, optional): output device (-1 means CPU, default:
        current device)


Returns:
    A tensor located on ``destination`` device, that is a result of
    concatenating ``tensors`` along ``dim``.



  
  
    
    
  
  


Is there a way to make gather supporting different tensor size?
Thanks