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

Function _check_common_length

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

Check if all list representing multiple input sets have the same length and return it

(inputs)

Source from the content-addressed store, hash-verified

85 return 1
86
87 def _check_common_length(inputs):
88 """Check if all list representing multiple input sets have the same length and return it"""
89 arg_list_len = max(_safe_len(input) for input in inputs)
90 for input in inputs:
91 if isinstance(input, list):
92 if len(input) != arg_list_len:
93 raise ValueError(
94 f"All argument lists for Multiple Input Sets used "
95 f"with operator `{op_name}` must have "
96 f"the same length"
97 )
98 return arg_list_len
99
100 def _unify_lists(inputs, arg_list_len):
101 """Pack single _DataNodes into lists, so they are treated as Multiple Input Sets

Callers 1

_build_input_setsFunction · 0.85

Calls 2

_safe_lenFunction · 0.85
maxFunction · 0.50

Tested by

no test coverage detected