From e3a84ef4779813eeb332e99c5e8add1706e90510 Mon Sep 17 00:00:00 2001 From: Vincent Moens Date: Thu, 5 Aug 2021 17:00:15 +0100 Subject: [PATCH] amend --- torchvision/models/inception.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/torchvision/models/inception.py b/torchvision/models/inception.py index 60ded085a8f..d7d7af6faf9 100644 --- a/torchvision/models/inception.py +++ b/torchvision/models/inception.py @@ -120,7 +120,7 @@ def __init__( if init_weights: for m in self.modules(): if isinstance(m, nn.Conv2d) or isinstance(m, nn.Linear): - stddev = float(m.stddev) if hasattr(m, 'stddev') else 0.1 + stddev = m.stddev if hasattr(m, 'stddev') else 0.1 # type: ignore[assignment] torch.nn.init.trunc_normal_(m.weight, mean=0.0, std=stddev, a=-2, b=2) elif isinstance(m, nn.BatchNorm2d): nn.init.constant_(m.weight, 1)