swap_module¶ class torch.ao.quantization.swap_module(mod, mapping, custom_module_class_mapping, use_precomputed_fake_quant=False)[原始碼][原始碼]¶ 如果模組有量化對應項目,且已附加 observer,則交換模組。 參數 mod – 輸入模組 mapping – 從 nn 模組映射到 nnq 模組的字典 傳回 mod 的相應量化模組