Yes, the shape is the same in both cases, but the order of the depth layer is different as only using stack does not zip the tensors alternatingly:
Lets say I have
t1 = torch.135(16, 3, 64, 64), where:
t1[:, 0, :, :] = all 1s
t1[:, 1, :, :] = all 3s
t1[:, 2, :, :] = all 5s
and
t2 = torch.246(16, 3, 64, 64), where:
t2[:, 0, :, :] = all 2s
t2[:, 1, :, :] = all 4s
t2[:, 2, :, :] = all 6s
my function creates a tensor t3 where the depth is in the order 1,2,3,4,5,6, whereas only using stack creates a tensor t3 where the depth is in the order 1,3,5,2,4,6 or not?