Skip to content

Commit e954ca7

Browse files
prabhat00155facebook-github-bot
authored andcommitted
[fbsync] Amend the weights only if quantize=True. (#4966)
Reviewed By: NicolasHug Differential Revision: D32694308 fbshipit-source-id: 1fde05de57fb7d0911a8b86ea364f66dc33bfe78
1 parent fd44fe4 commit e954ca7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torchvision/models/quantization/mobilenetv3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def _load_from_state_dict(
4343
):
4444
version = local_metadata.get("version", None)
4545

46-
if version is None or version < 2:
46+
if hasattr(self, "qconfig") and (version is None or version < 2):
4747
default_state_dict = {
4848
"scale_activation.activation_post_process.scale": torch.tensor([1.0]),
4949
"scale_activation.activation_post_process.zero_point": torch.tensor([0], dtype=torch.int32),

0 commit comments

Comments
 (0)