快捷方式

FuseCustomConfig¶

class torch.ao.quantization.fx.custom_config.FuseCustomConfig[source][source]

fuse_fx() 的自定義配置。

示例用法

fuse_custom_config = FuseCustomConfig().set_preserved_attributes(["attr1", "attr2"])
classmethod from_dict(fuse_custom_config_dict)[source][source]

從包含以下項的字典建立 ConvertCustomConfig

“preserved_attributes”:即使不在 forward 中使用也會保留的屬性列表

此函式主要用於向後相容,將來可能會被移除。

返回型別

FuseCustomConfig

set_preserved_attributes(attributes)[source][source]

設定屬性的名稱,即使在模型的 forward 方法中未使用這些屬性,它們也會保留在圖模組中。

返回型別

FuseCustomConfig

to_dict()[source][source]

將此 FuseCustomConfig 轉換為包含 from_dict() 中描述的項的字典。

返回型別

dict[str, Any]

文件

訪問 PyTorch 的全面開發者文件

檢視文件

教程

獲取面向初學者和高階開發者的深度教程

檢視教程

資源

查詢開發資源並獲得問題解答

檢視資源