MCPcopy Create free account
hub / github.com/OpenGVLab/HumanBench / count_bn

Function count_bn

PATH/helper/flops_helper.py:129–137  ·  view source on GitHub ↗
(m, x, y)

Source from the content-addressed store, hash-verified

127
128
129def count_bn(m, x, y):
130 x = x[0]
131 c_out = y.size(1)
132 nelements = x.numel()
133 # subtract, divide, gamma, beta
134 total_ops = 4 * nelements
135
136 m.total_ops = torch.Tensor([int(total_ops)])
137 m.total_params = torch.Tensor([int(c_out) * 2])
138
139
140def count_relu(m, x, y):

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.80

Tested by

no test coverage detected