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

Function flatten_list

python/paddle/hapi/model.py:100–108  ·  view source on GitHub ↗
(l)

Source from the content-addressed store, hash-verified

98
99
100def flatten_list(l):
101 assert isinstance(l, list), "not a list"
102 outl = []
103 splits = []
104 for sl in l:
105 assert isinstance(sl, list), "sub content not a list"
106 splits.append(len(sl))
107 outl += sl
108 return outl, splits
109
110
111def restore_flatten_list(l, splits):

Callers 4

_runMethod · 0.85
_runMethod · 0.85
flatten_listMethod · 0.85

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected