Skip to content

Commit

Permalink
Quant (not tested)
Browse files Browse the repository at this point in the history
  • Loading branch information
dingxiaohan committed May 10, 2021
1 parent 8229eee commit 6185d4e
Show file tree
Hide file tree
Showing 4 changed files with 550 additions and 83 deletions.
3 changes: 3 additions & 0 deletions insert_bn.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ def directly_insert_bn_without_init(model):
block.rbr_reparam.dilation,
block.rbr_reparam.groups, bias=False)) # Note bias=False
convbn.add_module('bn', nn.BatchNorm2d(block.rbr_reparam.out_channels))
convbn.add_module('relu', nn.ReLU())
print('conv bn relu')
block.nonlinearity = nn.Identity() #TODO note this
block.__delattr__('rbr_reparam')
block.rbr_reparam = convbn

Expand Down
Loading

0 comments on commit 6185d4e

Please sign in to comment.