标签:int nbsp tar print targe must bsp end Dimension
a=torch.rand(32,1)
a.expend(imgs.size())
>>>RuntimeError: The expanded size of the tensor (256) must match the existing size (32) at non-singleton dimension 2. Target sizes: [32, 1, 256, 170]. Tensor sizes: [32, 1]
a=torch.rand(32,1,1,1)
a.expend(imgs.size())
print(a.size())
>>>(32,1,256,170)
标签:int nbsp tar print targe must bsp end Dimension
原文地址:https://www.cnblogs.com/JunzhaoLiang/p/12368733.html