MCPcopy Create free account
hub / github.com/NVIDIA/DALI / _repack_list

Function _repack_list

dali/python/nvidia/dali/ops/_operator_utils.py:16–26  ·  view source on GitHub ↗

Repack list from [[a, b, c], [a', b', c'], ....] to [fn(a, a', ...), fn(b, b', ...), fn(c, c', ...)] where fn can be `tuple` or `list` Assume that all elements of input have the same length

(sets, fn)

Source from the content-addressed store, hash-verified

14
15
16def _repack_list(sets, fn):
17 """Repack list from [[a, b, c], [a', b', c'], ....]
18 to [fn(a, a', ...), fn(b, b', ...), fn(c, c', ...)]
19 where fn can be `tuple` or `list`
20 Assume that all elements of input have the same length
21 """
22 output_list = []
23 arg_list_len = len(sets[0])
24 for i in range(arg_list_len):
25 output_list.append(fn(input_set[i] for input_set in sets))
26 return output_list
27
28
29def _repack_output_sets(outputs):

Callers 2

_repack_output_setsFunction · 0.85
_repack_input_setsFunction · 0.85

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected