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

Function _is_leaf

imperative/python/megengine/traced_module/pytree.py:176–181  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

174
175
176def _is_leaf(obj):
177 obj_type = obj if isinstance(obj, type) else type(obj)
178 return (
179 issubclass(obj_type, tuple(SUPPORTED_LEAF_CLS))
180 or obj_type in SUPPORTED_LEAF_TYPE
181 )
182
183
184def _leaf_type(node):

Callers 2

add_inputsMethod · 0.70
set_args_kwargsMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected