def METHOD_NAME(linear: nn.Linear, lora_rank: int) -> LoraLinear:
    assert (
        lora_rank <= linear.in_features
    ), f"LoRA rank ({lora_rank}) must be less than or equal to in features ({linear.in_features})"
    lora_linear = LoraLinear(
        linear.weight, linear.bias, r=lora_rank, merge_weights=False
    )
    return lora_linear