def METHOD_NAME(
    self, tmp_path: Path, monkeypatch: MonkeyPatch, weights: WeightsEnum
) -> WeightsEnum:
    path = tmp_path / f"{weights}.pth"
    model = timm.create_model(
        weights.meta["model"], in_chans=weights.meta["in_chans"]
    )
    torch.save(model.state_dict(), path)
    try:
        monkeypatch.setattr(weights.value, "url", str(path))
    except AttributeError:
        monkeypatch.setattr(weights, "url", str(path))
    monkeypatch.setattr(torchvision.models._api, "load_state_dict_from_url", load)
    return weights