torch.nn.utils.fuse_linear_bn_eval
- torch.nn.utils.fuse_linear_bn_eval(linear, bn)[源代码]
-
将一个线性模块和一个批处理规范化模块融合成一个新的线性模块。
- 参数
-
-
linear (torch.nn.Linear) — 一个线性层。
-
bn (torch.nn.modules.batchnorm._BatchNorm) – 批归一化模块。
-
- 返回值
-
集成的线性模块。
- 返回类型
注意
Both
linear
andbn
must be in eval mode, andbn
needs to have its running buffers calculated.