def METHOD_NAME(x: Any) -> None:
    """Call retain_grad() on a tensor.
    Args:
        x (Any): Object to be called.
    """
    if isinstance(x, torch.Tensor) and x.requires_grad:
        x.METHOD_NAME()