Skip to content

Commit c8436a4

Browse files
committed
removed deepcopy from fuse_conv_bn_eval method
1 parent 0fc6fb6 commit c8436a4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

intermediate_source/fx_conv_bn_fuser.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ def fuse_conv_bn_eval(conv, bn):
104104
module `C` such that C(x) == B(A(x)) in inference mode.
105105
"""
106106
assert(not (conv.training or bn.training)), "Fusion only for eval!"
107-
fused_conv = copy.deepcopy(conv)
107+
fused_conv = type(conv)(conv.in_channels, conv.out_channels, conv.kernel_size)
108+
fused_conv.load_state_dict(conv.state_dict())
109+
fused_conv.eval()
108110

109111
fused_conv.weight, fused_conv.bias = \
110112
fuse_conv_bn_weights(fused_conv.weight, fused_conv.bias,

0 commit comments

Comments
 (0)