肖鹏

Results 6 comments of 肖鹏

LSTest( (stem): Stem( (stages): Sequential( (0): Conv2d(3, 16, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), bias=False) (1): BatchNorm2d(16, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True) (2): ReLU() (3): Conv2d(16, 32, kernel_size=(3, 3), stride=(2, 2),...

RuntimeError: The size of tensor a (16) must match the size of tensor b (4) at non-singleton dimension 3我跑源码不知道为什么遇到这个问题

嗯嗯我知道,这个结构图不重要,主要我好奇作者自己使用没有遇到相关问题吗

class LSTest(torch.nn.Module): """ i = 0, ed = 64, kd = 16, dpth = 1, nh = 4, ar = 1.0 i = 1, ed = 128, kd = 16,...

(q.transpose(-2, -1) @ k) * self.scale RuntimeError: The size of tensor a (16) must match the size of tensor b (4) at non-singleton dimension 3

参数维度为 q.shape = torch.Size([1, 4, 16, 16]) k.shape = torch.Size([1, 4, 16, 16]) v.shape = torch.Size([1, 4, 64, 16]) q.transpose(-2, -1).shape = torch.Size([1, 4, 16, 16])