快捷方式

DTypeWithConstraints

class torch.ao.quantization.backend_config.DTypeWithConstraints(dtype=None, quant_min_lower_bound=None, quant_max_upper_bound=None, scale_min_lower_bound=None, scale_max_upper_bound=None, scale_exact_match=None, zero_point_exact_match=None)[原始碼][原始碼]

用於指定給定 dtype 的額外約束的設定,例如量化值範圍、比例值範圍和固定量化參數,用於 DTypeConfig 中。

目前支援的約束有

  • quant_min_lower_boundquant_max_upper_bound:分別為最小和最大量化值的下限和上限。如果 QConfig 的 quant_minquant_max 超出此範圍,則將忽略 QConfig。

  • scale_min_lower_boundscale_max_upper_bound:分別為最小和最大比例值的下限和上限。如果 QConfig 的最小比例值(目前公開為 eps)低於下限,則將忽略 QConfig。請注意,目前不強制執行上限。

  • scale_exact_matchzero_point_exact_match:比例和零點的精確匹配要求,用於具有固定量化參數的運算子,例如 sigmoid 和 tanh。如果 QConfig 中指定的觀察者既不是 FixedQParamsObserver 也不是 FixedQParamsFakeQuantize,或者如果量化參數不匹配,則將忽略 QConfig。

文件

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