MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / count_linear

Function count_linear

python/paddle/hapi/dynamic_flops.py:172–176  ·  view source on GitHub ↗
(m, x, y)

Source from the content-addressed store, hash-verified

170
171
172def count_linear(m, x, y):
173 total_mul = m.weight.shape[0]
174 num_elements = y.numel()
175 total_ops = total_mul * num_elements
176 m.total_ops += abs(int(total_ops))
177
178
179def count_avgpool(m, x, y):

Callers

nothing calls this directly

Calls 2

absFunction · 0.50
numelMethod · 0.45

Tested by

no test coverage detected