PyTorch 1.6.0 compatibility updates

pull/1/head
Glenn Jocher 5 years ago committed by GitHub
parent 7f8471eaeb
commit 91af0401d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -148,6 +148,7 @@ class Model(nn.Module):
print('Fusing layers... ', end='') print('Fusing layers... ', end='')
for m in self.model.modules(): for m in self.model.modules():
if type(m) is Conv: if type(m) is Conv:
m._non_persistent_buffers_set = set() # pytorch 1.6.0 compatability
m.conv = torch_utils.fuse_conv_and_bn(m.conv, m.bn) # update conv m.conv = torch_utils.fuse_conv_and_bn(m.conv, m.bn) # update conv
m.bn = None # remove batchnorm m.bn = None # remove batchnorm
m.forward = m.fuseforward # update forward m.forward = m.fuseforward # update forward

Loading…
Cancel
Save