(main_list, check_list)
| 243 | |
| 244 | |
| 245 | def 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 | |
| 263 | def ctc_loss(logits: torch.Tensor, |
no outgoing calls
no test coverage detected
searching dependent graphs…