Make sure num_features attr is present in vit models as with others

pull/263/head
Ross Wightman 2020-10-29 15:33:47 -07:00
parent 4a3df7842a
commit f591e90b0d
1 changed files with 1 additions and 1 deletions

View File

@ -206,7 +206,7 @@ class VisionTransformer(nn.Module):
drop_path_rate=0., hybrid_backbone=None, norm_layer=nn.LayerNorm):
super().__init__()
self.num_classes = num_classes
self.embed_dim = embed_dim
self.num_features = self.embed_dim = embed_dim # num_features for consistency with other models
if hybrid_backbone is not None:
self.patch_embed = HybridEmbed(