• 文档 >
  • torch.nn >
  • torch.nn.utils.fuse_linear_bn_weights
快捷键

torch.nn.utils.fuse_linear_bn_weights

torch.nn.utils.fuse_linear_bn_weights(linear_w, linear_b, bn_rm, bn_rv, bn_eps, bn_w, bn_b)[source][source]

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

参数:
  • 线性_w (torch.Tensor) – 线性权重。

  • linear_b (Optional[torch.Tensor]) – 线性偏置。

  • bn_rm (torch.Tensor) – BatchNorm 运行均值。

  • bn_rv (torch.Tensor) – BatchNorm 运行方差。

  • bn_eps (浮点数) – 批标准化 epsilon。

  • bn_w (torch.Tensor) – 批标准化权重。

  • bn_b (torch.Tensor) – 批标准化偏差。

返回值:

混合线性权重和偏差。

返回类型:

torch.nn.Parameter 元组


© 版权所有 PyTorch 贡献者。

使用 Sphinx 构建,并使用 Read the Docs 提供的主题。

文档

PyTorch 的全面开发者文档

查看文档

教程

深入了解初学者和高级开发者的教程

查看教程

资源

查找开发资源并获得您的疑问解答

查看资源