(src, dst)
| 36 | ret = {} |
| 37 | |
| 38 | def _convert_conv(src, dst): |
| 39 | src_w = d.pop(src + ".weight").transpose(2, 3, 1, 0) |
| 40 | ret[dst + "/W"] = src_w |
| 41 | if src + ".norm.weight" in d: # has norm |
| 42 | ret[dst + "/bn/gamma"] = d.pop(src + ".norm.weight") |
| 43 | ret[dst + "/bn/beta"] = d.pop(src + ".norm.bias") |
| 44 | ret[dst + "/bn/variance/EMA"] = d.pop(src + ".norm.running_var") |
| 45 | ret[dst + "/bn/mean/EMA"] = d.pop(src + ".norm.running_mean") |
| 46 | if src + ".bias" in d: |
| 47 | ret[dst + "/b"] = d.pop(src + ".bias") |
| 48 | |
| 49 | def _convert_fc(src, dst): |
| 50 | ret[dst + "/W"] = d.pop(src + ".weight").transpose() |
no outgoing calls
no test coverage detected
searching dependent graphs…