Skip to content

Commit fac6e34

Browse files
author
Esteban Gómez
committed
Fix _batchnorm1d_ops_fn and _batchnorm2d_ops_fn
1 parent 4b0f3f6 commit fac6e34

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

src/moduleprofiler/ops.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -602,11 +602,7 @@ def _batchnorm1d_ops_fn(
602602
total_ops = 5 * num_elements + 4
603603

604604
else:
605-
if module.bias is not None:
606-
total_ops = 7 * num_elements + 4
607-
608-
else:
609-
total_ops = 6 * num_elements + 4
605+
total_ops = 7 * num_elements + 4
610606

611607
# Add num_features C
612608
total_ops *= module.num_features
@@ -625,11 +621,7 @@ def _batchnorm2d_ops_fn(
625621
total_ops = 5 * num_elements + 4
626622

627623
else:
628-
if module.bias is not None:
629-
total_ops = 7 * num_elements + 4
630-
631-
else:
632-
total_ops = 6 * num_elements + 4
624+
total_ops = 7 * num_elements + 4
633625

634626
# Add num_features C
635627
total_ops *= module.num_features

0 commit comments

Comments
 (0)