Skip to content

Commit

Permalink
[!HOTFIX] disable to get equivalent rbr_identity kernel when it is None
Browse files Browse the repository at this point in the history
  • Loading branch information
hglee98 committed Dec 6, 2024
1 parent 60ec1c4 commit 8bcb7c9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/netspresso_trainer/models/op/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,11 @@ def convert_to_deploy(self):
def get_equivalent_kernel_bias(self):
kernel3x3, bias3x3 = self._fuse_bn_tensor(self.conv1)
kernel1x1, bias1x1 = self._fuse_bn_tensor(self.conv2)
kernelid, biasid = self._fuse_bn_tensor(self.rbr_identity)
if self.rbr_identity:
kernelid, biasid = self._fuse_bn_tensor(self.rbr_identity)
else:
kernelid = 0
biasid = 0

return kernel3x3 + self._pad_1x1_to_3x3_tensor(kernel1x1) + kernelid, bias3x3 + bias1x1 + biasid

Expand Down

0 comments on commit 8bcb7c9

Please sign in to comment.