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

Function _sorted

python/paddle/utils/layers_utils.py:144–151  ·  view source on GitHub ↗

Returns a sorted list of the dict keys, with error if keys not sortable.

(dict_)

Source from the content-addressed store, hash-verified

142
143
144def _sorted(dict_):
145 """
146 Returns a sorted list of the dict keys, with error if keys not sortable.
147 """
148 try:
149 return sorted(dict_.keys())
150 except TypeError:
151 raise TypeError("nest only supports dicts with sortable keys.")
152
153
154def _yield_value(iterable):

Callers 2

_yield_valueFunction · 0.85
_sequence_likeFunction · 0.85

Calls 2

TypeErrorClass · 0.85
keysMethod · 0.45

Tested by

no test coverage detected