def METHOD_NAME(test_case, N, C, H_in, H_out):
    inputval = oneflow.ones(N, C, H_in,)
    grid = oneflow.ones(N, H_out, 1)
    with test_case.assertRaises(RuntimeError) as ctx:
        flow.nn.functional.grid_sample(
            inputval, grid, mode="bilinear", padding_mode="zeros"
        )
    test_case.assertTrue("MUST be 4D or 5D input" in str(ctx.exception))