(state_dict)
| 89 | |
| 90 | |
| 91 | def search_for_embeddings(state_dict): |
| 92 | embeddings = [] |
| 93 | for k in state_dict: |
| 94 | if isinstance(state_dict[k], torch.Tensor): |
| 95 | embeddings.append(state_dict[k]) |
| 96 | elif isinstance(state_dict[k], dict): |
| 97 | embeddings += search_for_embeddings(state_dict[k]) |
| 98 | return embeddings |
| 99 | |
| 100 | |
| 101 | def search_parameter(param, state_dict): |
no outgoing calls
no test coverage detected