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

Function count_avgpool

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

Source from the content-addressed store, hash-verified

157
158
159def count_avgpool(m, x, y):
160 total_add = torch.prod(torch.Tensor([m.kernel_size]))
161 total_div = 1
162 kernel_ops = total_add + total_div
163 num_elements = y.numel()
164 total_ops = kernel_ops * num_elements
165
166 m.total_ops = torch.Tensor([int(total_ops)])
167
168
169def count_adap_avgpool(m, x, y):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected