mirror of
https://github.com/huggingface/pytorch-image-models.git
synced 2025-06-03 15:01:08 +08:00
Update metaformers.py
This commit is contained in:
parent
9efb706b25
commit
eecab9eba8
@ -180,7 +180,6 @@ class RandomMixing(nn.Module):
|
|||||||
requires_grad=False)
|
requires_grad=False)
|
||||||
def forward(self, x):
|
def forward(self, x):
|
||||||
B, C, H, W = x.shape
|
B, C, H, W = x.shape
|
||||||
print(H*W)
|
|
||||||
x = x.reshape(B, H*W, C)
|
x = x.reshape(B, H*W, C)
|
||||||
x = torch.einsum('mn, bnc -> bmc', self.random_matrix, x)
|
x = torch.einsum('mn, bnc -> bmc', self.random_matrix, x)
|
||||||
x = x.reshape(B, C, H, W)
|
x = x.reshape(B, C, H, W)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user