mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
Change condition in swap module
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/23561 Test Plan: python test/test_quantization.py Imported from OSS Differential Revision: D16570928 Pulled By: jerryzh168 fbshipit-source-id: 70f36f577ac657d015f3d7738819867742088e5a
This commit is contained in:
parent
ab584c738b
commit
bc64324da9
|
|
@ -275,7 +275,7 @@ def swap_module(mod, mapping):
|
|||
The corresponding quantized module of `mod`
|
||||
"""
|
||||
new_mod = mod
|
||||
if hasattr(mod, 'observer'):
|
||||
if hasattr(mod, 'qconfig') and mod.qconfig is not None:
|
||||
if type(mod) in mapping:
|
||||
new_mod = mapping[type(mod)].from_float(mod)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user