PyTorch 1.7.0 Compatibility Updates (#1233)

* torch 1.7.0 compatibility updates

* add inference verification
This commit is contained in:
Glenn Jocher authored and GitHub committed 2020-10-28 15:03:50 +01:00
1 parent 453acdec67
commit c8c5ef36c9
4 files changed
+16 -2

No files matched your search

-1
View File
@@ -165,7 +165,6 @@ class Model(nn.Module):
print('Fusing layers... ')
for m in self.model.modules():
if type(m) is Conv and hasattr(m, 'bn'):
m._non_persistent_buffers_set = set() # pytorch 1.6.0 compatability
m.conv = fuse_conv_and_bn(m.conv, m.bn) # update conv
delattr(m, 'bn') # remove batchnorm
m.forward = m.fuseforward # update forward