def METHOD_NAME(df_shape, loc_shape, cov_shape, dim):
    """
    Generate a random MultivariateStudentT distribution for testing.
    """
    rank = dim + dim
    df = torch.rand(df_shape, requires_grad=True).exp()
    loc = torch.randn(loc_shape + (dim,), requires_grad=True)
    cov = torch.randn(cov_shape + (dim, rank), requires_grad=True)
    cov = cov.matmul(cov.transpose(-1, -2))
    scale_tril = torch.linalg.cholesky(cov)
    return MultivariateStudentT(df, loc, scale_tril)