MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / as_count

Method as_count

imperative/python/megengine/utils/network.py:751–753  ·  view source on GitHub ↗

r"""consume this iterator and get the number of elements

(self)

Source from the content-addressed store, hash-verified

749 return collections.OrderedDict((i.name, i) for i in self)
750
751 def as_count(self):
752 r"""consume this iterator and get the number of elements"""
753 return sum(1 for _ in self)
754
755
756class NodeFilterType(NodeFilter):

Callers 1

test_queryFunction · 0.45

Calls 1

sumFunction · 0.85

Tested by 1

test_queryFunction · 0.36