def METHOD_NAME(batch_shape):
    dim = 2
    loc = torch.randn(batch_shape + (dim,))
    A = torch.randn(batch_shape + (dim, dim + dim))
    scale_tril = torch.linalg.cholesky(A.matmul(A.transpose(-2, -1)))
    df = torch.randn(batch_shape).exp() + 4
    num_samples = 100000
    d = MultivariateStudentT(df, loc, scale_tril)
    samples = d.sample(sample_shape=(num_samples,))
    expected_mean = samples.mean(0)
    expected_variance = samples.var(0)
    assert_equal(d.mean, expected_mean, prec=0.1)
    assert_equal(d.variance, expected_variance, prec=0.2)
    assert_equal(
        MultivariateStudentT(0.5, loc, scale_tril).mean,
        torch.full(batch_shape + (dim,), float("nan")),
    )
    assert_equal(
        MultivariateStudentT(0.5, loc, scale_tril).variance,
        torch.full(batch_shape + (dim,), float("nan")),
    )
    assert_equal(
        MultivariateStudentT(1.5, loc, scale_tril).variance,
        torch.full(batch_shape + (dim,), float("inf")),
    )