MCPcopy Create free account
hub / github.com/modelscope/modelscope / is_sublist

Function is_sublist

modelscope/trainers/audio/kws_utils/batch_utils.py:245–260  ·  view source on GitHub ↗
(main_list, check_list)

Source from the content-addressed store, hash-verified

243
244
245def is_sublist(main_list, check_list):
246 if len(main_list) < len(check_list):
247 return -1
248
249 if len(main_list) == len(check_list):
250 return 0 if main_list == check_list else -1
251
252 for i in range(len(main_list) - len(check_list)):
253 if main_list[i] == check_list[0]:
254 for j in range(len(check_list)):
255 if main_list[i + j] != check_list[j]:
256 break
257 else:
258 return i
259 else:
260 return -1
261
262
263def ctc_loss(logits: torch.Tensor,

Callers 1

executor_testFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…