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)[исходный код] -
Объединяет параметры линейного модуля и модуля BatchNorm в новые параметры линейного модуля.
- Параметры:
-
- linear_w (torch.Tensor) – Вес линейного слоя.
- linear_b (Optional[torch.Tensor]) – Смещение линейного слоя.
- bn_rm (torch.Tensor) – Скользящее среднее BatchNorm.
- bn_rv (torch.Tensor) – Скользящая дисперсия BatchNorm.
- bn_eps (float) – Эпсилон BatchNorm.
- bn_w (torch.Tensor) – Вес BatchNorm.
- bn_b (torch.Tensor) – Смещение BatchNorm.
- Возвращает:
-
Объединённые вес и смещение линейного слоя.
- Тип возвращаемого значения:
-
Tuple[torch.nn.Parameter, torch.nn.Parameter]
© 2026, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://docs.pytorch.org/docs/2.14/generated/torch.nn.utils.fuse_linear_bn_weights.html