torch.nn.utils.fuse_conv_bn_weights — PyTorch 2.7 documentation (original) (raw)

torch.nn.utils.fuse_conv_bn_weights(conv_w, conv_b, bn_rm, bn_rv, bn_eps, bn_w, bn_b, transpose=False)[source][source]

Fuse convolutional module parameters and BatchNorm module parameters into new convolutional module parameters.

Parameters

Returns

Fused convolutional weight and bias.

Return type

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