question about the MACs of nn.BatchNorm2d
DaMiBear opened this issue · comments
DaMiBear commented
Hi, happy new year!
I'm confused about the method of calculating nn.BatchNorm2d MACs.
pytorch-OpCounter/thop/vision/basic_hooks.py
Lines 60 to 69 in 43c064a
pytorch-OpCounter/thop/vision/calc_func.py
Lines 43 to 45 in 43c064a
In my opinion: in
calculate_norm(input_size)
, the 2 * input_size
already means the MACs of subtract(mean), divide(var), mul(weight) and add(bias). But why is the flops
(w.r.t MACs) multiplied by 2 again in the next?