(kernel)
| 73 | resize_mat_pinv = torch.tensor(np.linalg.pinv(resize_mat.T), device=patch_embed.device) |
| 74 | |
| 75 | def resample_kernel(kernel): |
| 76 | resampled_kernel = resize_mat_pinv @ kernel.reshape(-1) |
| 77 | return resampled_kernel.reshape(new_size) |
| 78 | |
| 79 | v_resample_kernel = vmap(vmap(resample_kernel, 0, 0), 1, 1) |
| 80 | orig_dtype = patch_embed.dtype |
nothing calls this directly
no outgoing calls
no test coverage detected