3131]
3232
3333
34- def _vgg (arch : str , cfg : str , batch_norm : bool , weights : Optional [Weights ], progress : bool , ** kwargs : Any ) -> VGG :
34+ def _vgg (cfg : str , batch_norm : bool , weights : Optional [Weights ], progress : bool , ** kwargs : Any ) -> VGG :
3535 if weights is not None :
3636 kwargs ["num_classes" ] = len (weights .meta ["categories" ])
3737 model = VGG (make_layers (cfgs [cfg ], batch_norm = batch_norm ), ** kwargs )
@@ -150,7 +150,7 @@ def vgg11(weights: Optional[VGG11Weights] = None, progress: bool = True, **kwarg
150150 weights = VGG11Weights .ImageNet1K_RefV1 if kwargs .pop ("pretrained" ) else None
151151 weights = VGG11Weights .verify (weights )
152152
153- return _vgg ("vgg11" , " A" , False , weights , progress , ** kwargs )
153+ return _vgg ("A" , False , weights , progress , ** kwargs )
154154
155155
156156def vgg11_bn (weights : Optional [VGG11BNWeights ] = None , progress : bool = True , ** kwargs : Any ) -> VGG :
@@ -159,7 +159,7 @@ def vgg11_bn(weights: Optional[VGG11BNWeights] = None, progress: bool = True, **
159159 weights = VGG11BNWeights .ImageNet1K_RefV1 if kwargs .pop ("pretrained" ) else None
160160 weights = VGG11BNWeights .verify (weights )
161161
162- return _vgg ("vgg11_bn" , " A" , True , weights , progress , ** kwargs )
162+ return _vgg ("A" , True , weights , progress , ** kwargs )
163163
164164
165165def vgg13 (weights : Optional [VGG13Weights ] = None , progress : bool = True , ** kwargs : Any ) -> VGG :
@@ -168,7 +168,7 @@ def vgg13(weights: Optional[VGG13Weights] = None, progress: bool = True, **kwarg
168168 weights = VGG13Weights .ImageNet1K_RefV1 if kwargs .pop ("pretrained" ) else None
169169 weights = VGG13Weights .verify (weights )
170170
171- return _vgg ("vgg13" , " B" , False , weights , progress , ** kwargs )
171+ return _vgg ("B" , False , weights , progress , ** kwargs )
172172
173173
174174def vgg13_bn (weights : Optional [VGG13BNWeights ] = None , progress : bool = True , ** kwargs : Any ) -> VGG :
@@ -177,7 +177,7 @@ def vgg13_bn(weights: Optional[VGG13BNWeights] = None, progress: bool = True, **
177177 weights = VGG13BNWeights .ImageNet1K_RefV1 if kwargs .pop ("pretrained" ) else None
178178 weights = VGG13BNWeights .verify (weights )
179179
180- return _vgg ("vgg13_bn" , " B" , True , weights , progress , ** kwargs )
180+ return _vgg ("B" , True , weights , progress , ** kwargs )
181181
182182
183183def vgg16 (weights : Optional [VGG16Weights ] = None , progress : bool = True , ** kwargs : Any ) -> VGG :
@@ -186,7 +186,7 @@ def vgg16(weights: Optional[VGG16Weights] = None, progress: bool = True, **kwarg
186186 weights = VGG16Weights .ImageNet1K_RefV1 if kwargs .pop ("pretrained" ) else None
187187 weights = VGG16Weights .verify (weights )
188188
189- return _vgg ("vgg16" , " D" , False , weights , progress , ** kwargs )
189+ return _vgg ("D" , False , weights , progress , ** kwargs )
190190
191191
192192def vgg16_bn (weights : Optional [VGG16BNWeights ] = None , progress : bool = True , ** kwargs : Any ) -> VGG :
@@ -195,7 +195,7 @@ def vgg16_bn(weights: Optional[VGG16BNWeights] = None, progress: bool = True, **
195195 weights = VGG16BNWeights .ImageNet1K_RefV1 if kwargs .pop ("pretrained" ) else None
196196 weights = VGG16BNWeights .verify (weights )
197197
198- return _vgg ("vgg16_bn" , " D" , True , weights , progress , ** kwargs )
198+ return _vgg ("D" , True , weights , progress , ** kwargs )
199199
200200
201201def vgg19 (weights : Optional [VGG19Weights ] = None , progress : bool = True , ** kwargs : Any ) -> VGG :
@@ -204,7 +204,7 @@ def vgg19(weights: Optional[VGG19Weights] = None, progress: bool = True, **kwarg
204204 weights = VGG19Weights .ImageNet1K_RefV1 if kwargs .pop ("pretrained" ) else None
205205 weights = VGG19Weights .verify (weights )
206206
207- return _vgg ("vgg19" , " E" , False , weights , progress , ** kwargs )
207+ return _vgg ("E" , False , weights , progress , ** kwargs )
208208
209209
210210def vgg19_bn (weights : Optional [VGG19BNWeights ] = None , progress : bool = True , ** kwargs : Any ) -> VGG :
@@ -213,4 +213,4 @@ def vgg19_bn(weights: Optional[VGG19BNWeights] = None, progress: bool = True, **
213213 weights = VGG19BNWeights .ImageNet1K_RefV1 if kwargs .pop ("pretrained" ) else None
214214 weights = VGG19BNWeights .verify (weights )
215215
216- return _vgg ("vgg19_bn" , " E" , True , weights , progress , ** kwargs )
216+ return _vgg ("E" , True , weights , progress , ** kwargs )
0 commit comments