How can torch.cat only have one tensor?
I think there is an error in line 53 of the following code:
CycleGan, Buffer for Images
It says:
return_images = torch.cat(return_images, 0)  # collect all the images and return

What do you think, what should it read correctly? After having gone throught the code, I am unfortunately not sure what this specific line is supposed to do, but I think I understand the rest until line 52.

torch.cat's first argument is expected to be a sequence of tensors rather than a single tensor. So you pass in like:
torch.cat([tensor_1, tensor_2, tensor_3])       # the right way

instead of
torch.cat(tensor_1, tensor_2, tensor_3)         # not the right way

In the code you linked, they are forming a list called return_images which contains many tensors in it.
np.concatenate has the same behaviour too and PyTorch designers probably mimicked the choice from there. (&quot;cat&quot; is short for &quot;concatenate&quot; which is hard to write!).
