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

Function get_layer_param

PATH/helper/param_count.py:72–73  ·  view source on GitHub ↗
(model)

Source from the content-addressed store, hash-verified

70# return sum(counts)
71
72def get_layer_param(model):
73 return sum([reduce(operator.mul, i.size(), 1) for i in model.parameters()])
74
75def measure_model(model, input_image_size, forward_param=None):
76 flop_counts = []

Callers 1

hookFunction · 0.85

Calls 1

sizeMethod · 0.80

Tested by

no test coverage detected