评价此页

torch.nn.utils.fusion.fuse_linear_bn_weights#

torch.nn.utils.fusion.fuse_linear_bn_weights(linear_w, linear_b, bn_rm, bn_rv, bn_eps, bn_w, bn_b)[源码]#

将线性模块参数和 BatchNorm 模块参数融合为新的线性模块参数。

参数
返回

融合后的线性层权重和偏置。

返回类型

Tuple[torch.nn.Parameter, torch.nn.Parameter]