Fix F.conv3d call: remove invalid kernel_size kwarg (uses weight.shape)
This commit is contained in:
parent
453aa86328
commit
6866263631
1 changed files with 2 additions and 1 deletions
|
|
@ -213,7 +213,8 @@ class _VisionPatchEmbed(nn.Module):
|
||||||
def forward(self, x: torch.Tensor) -> torch.Tensor:
|
def forward(self, x: torch.Tensor) -> torch.Tensor:
|
||||||
target = self.weight.dtype
|
target = self.weight.dtype
|
||||||
x = x.view(-1, 3, VISION_TEMPORAL, VISION_PATCH, VISION_PATCH)
|
x = x.view(-1, 3, VISION_TEMPORAL, VISION_PATCH, VISION_PATCH)
|
||||||
return F.conv3d(x.to(target), self.weight, self.bias, kernel_size=(VISION_TEMPORAL, VISION_PATCH, VISION_PATCH), stride=(VISION_TEMPORAL, VISION_PATCH, VISION_PATCH)).view(-1, self.weight.shape[0])
|
s = (VISION_TEMPORAL, VISION_PATCH, VISION_PATCH)
|
||||||
|
return F.conv3d(x.to(target), self.weight, self.bias, stride=s).view(-1, self.weight.shape[0])
|
||||||
|
|
||||||
|
|
||||||
class _VisionMLP(nn.Module):
|
class _VisionMLP(nn.Module):
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue