MCPcopy Create free account
hub / github.com/PeizeSun/SparseR-CNN / _op_stats

Function _op_stats

detectron2/export/caffe2_export.py:74–80  ·  view source on GitHub ↗
(net_def)

Source from the content-addressed store, hash-verified

72
73
74def _op_stats(net_def):
75 type_count = {}
76 for t in [op.type for op in net_def.op]:
77 type_count[t] = type_count.get(t, 0) + 1
78 type_count_list = sorted(type_count.items(), key=lambda kv: kv[0]) # alphabet
79 type_count_list = sorted(type_count_list, key=lambda kv: -kv[1]) # count
80 return "\n".join("{:>4}x {}".format(count, name) for name, count in type_count_list)
81
82
83def _assign_device_option(

Callers 1

Calls 1

getMethod · 0.45

Tested by

no test coverage detected