def METHOD_NAME(self, x_world, y, R, T, print_stats, skip_q, check_output=False):
    sol = perspective_n_points.efficient_pnp(
        x_world, y.expand_as(x_world[:, :, :2]), skip_quadratic_eq=skip_q
    )
    err_2d = reproj_error(x_world, y, sol.R, sol.T)
    R_est_quat = rotation_conversions.matrix_to_quaternion(sol.R)
    R_quat = rotation_conversions.matrix_to_quaternion(R)
    num_pts = x_world.shape[-2]
    if check_output:
        assert_msg = (
            f"test_perspective_n_points assertion failure for "
            f"n_points={num_pts}, "
            f"skip_quadratic={skip_q}, "
            f"no noise."
        )
        self.assertClose(err_2d, sol.err_2d, msg=assert_msg)
        self.assertTrue((err_2d < 1e-3).all(), msg=assert_msg)
        def norm_fn(t):
            return t.norm(dim=-1)
        self.assertNormsClose(
            T, sol.T[:, None, :], rtol=4e-3, norm_fn=norm_fn, msg=assert_msg
        )
        self.assertNormsClose(
            R_quat, R_est_quat, rtol=3e-3, norm_fn=norm_fn, msg=assert_msg
        )
    if print_stats:
        torch.set_printoptions(precision=5, sci_mode=False)
        for err_2d, err_3d, R_gt, T_gt in zip(
            sol.err_2d,
            sol.err_3d,
            torch.cat((sol.R, R), dim=-1),
            torch.stack((sol.T, T[:, 0, :]), dim=-1),
        ):
            print("2D Error: %1.4f" % err_2d.item())
            print("3D Error: %1.4f" % err_3d.item())
            print("R_hat | R_gt\n", R_gt)
            print("T_hat | T_gt\n", T_gt)