def has_grad(model: nn.Module) -> bool:
    """Helper method to check if a model has `requires_grad` set to True"""
    has_grad_ = False
    for param in model.parameters():
        if param.requires_grad == True:
            has_grad_ = True
            break
    return has_grad_
Helper method to check if a model has `requires_grad` set to True
tests/models/test_ModelUtils.py