TypeError: _gather(): incompatible function arguments. The following argument types are supported:
    1. (tensors: List[at::Tensor], dim: int, destination_index: Optional[int]) -> at::Tensor

Invoked with: (tensor([8.9125], device='cuda:0', grad_fn=<UnsqueezeBackward0>), tensor([7.4709], device='cuda:1', grad_fn=<UnsqueezeBackward0>), tensor([6.6035], device='cuda:2', grad_fn=<UnsqueezeBackward0>), tensor([8.3252], device='cuda:3', grad_fn=<UnsqueezeBackward0>)), 0, [3]

It works not so well…
my return is
return torch.unsqueeze(loss1+loss2,0)

cause my loss is computed in two loss functions