捷徑

torch.nn.utils.fuse_linear_bn_eval

torch.nn.utils.fuse_linear_bn_eval(linear, bn)[原始碼][原始碼]

將線性模組和 BatchNorm 模組融合為單一、新的線性模組。

參數
  • linear (torch.nn.Linear) – 一個線性模組。

  • bn (torch.nn.modules.batchnorm._BatchNorm) – 一個 BatchNorm 模組。

傳回

融合的線性模組。

傳回類型

torch.nn.Linear

注意

linearbn 都必須處於 eval 模式,並且 bn 必須已計算其 running buffers。

文件

取得 PyTorch 的完整開發者文件

檢視文件

教學

取得適合初學者和進階開發者的深度教學

檢視教學

資源

尋找開發資源並獲得您問題的解答

檢視資源