MCPcopy
hub / github.com/datalab-to/surya / val2tuple

Function val2tuple

surya/detection/model/encoderdecoder.py:34–40  ·  view source on GitHub ↗
(x: Union[List, Tuple, Any], min_len: int = 1, idx_repeat: int = -1)

Source from the content-addressed store, hash-verified

32
33
34def val2tuple(x: Union[List, Tuple, Any], min_len: int = 1, idx_repeat: int = -1):
35 # repeat elements if necessary
36 x = val2list(x)
37 if len(x) > 0:
38 x[idx_repeat:idx_repeat] = [x[idx_repeat] for _ in range(min_len - len(x))]
39
40 return tuple(x)
41
42
43def get_same_padding(

Callers 5

__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85

Calls 1

val2listFunction · 0.85

Tested by

no test coverage detected