def METHOD_NAME(test_case):
    with test_case.assertRaises(Exception) as context:
        x = flow.randn(2, 4)
        m = flow.nn.Softmax(dim=2)
        y = m(x)
    test_case.assertTrue(
        "Dimension out of range (expected to be in range of [-2, 1], but got 2)"
        in str(context.exception)
    )