gather(tensors, dim=0, destination=None, *, out=None)¶
Gathers tensors from multiple GPU devices.
tensors (Iterable[Tensor]) – an iterable of tensors to gather. Tensor sizes in all dimensions other than
dimhave to match.
dim (int, optional) – a dimension along which the tensors will be concatenated. Default:
out (Tensor, optional, keyword-only) – the tensor to store gather result. Its sizes must match those of
tensors, except for
dim, where the size must equal
sum(tensor.size(dim) for tensor in tensors). Can be on CPU or CUDA.
destinationmust not be specified when
a tensor located on
destinationdevice, that is a result of concatenating
outtensor, now containing results of concatenating