捷徑

prepare_qat

class torch.ao.quantization.prepare_qat(model, mapping=None, inplace=False)[source][source]

準備模型的副本以進行量化校準或感知量化訓練,並將其轉換為量化版本。

量化配置應預先分配給 .qconfig 屬性中的各個子模組。

參數
  • model – 要就地修改的輸入模型

  • mapping – 將浮點模組映射到要替換的量化模組的字典。

  • inplace – 就地執行模型轉換,原始模組會被修改

文件

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources