print(cat_ab.size())
'''
Traceback (most recent call last):
File "/home/chenkc/code/pytorch/cat_test.py...", line 13, in
cat_ab = torch.cat([a, b], dim = 0)
RuntimeError: Expected object of scalar...比如图像张量形状为 [4, 3, 32, 32] 和形状为 [5, 1, 32, 32] 的张量不能直接在批量维度上进行合并,因为两个图像张量的通道维度的长度不一致,一个是单通道(channels =...cat_ab.size())
'''
Traceback (most recent call last):
File "/home/chenkc/code/pytorch/repeat_function.py...", line 9, in
cat_ab = torch.cat([a, b], dim = 0)
RuntimeError: Sizes of tensors must match