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
199b443884
commit
0a9c2607a0
@ -731,6 +731,10 @@ class MetaFormer(nn.Module):
|
||||
|
||||
def reset_classifier(self, num_classes=0, global_pool=None):
|
||||
|
||||
if global_pool is not None:
|
||||
self.global_pool = SelectAdaptivePool2d(pool_type=global_pool)
|
||||
|
||||
|
||||
if num_classes == 0:
|
||||
self.head = nn.Identity()
|
||||
self.norm = nn.Identity()
|
||||
|
Loading…
x
Reference in New Issue
Block a user