(g_h, t_idx: int)
return grad_and_hess_subtree
grad and hess of sub tree
grad and hess of sub tree
grad and hess of sub tree
def get_subtree_grad_and_hess(g_h, t_idx: int):
        """
        grad and hess of sub tree
        """
        LOGGER.info("get grad and hess of tree {}".format(t_idx))
        grad_and_hess_subtree = g_h.mapValues(
            lambda grad_and_hess: (grad_and_hess[0][t_idx], grad_and_hess[1][t_idx]))
        return grad_and_hess_subtree
def get_subtree_grad_and_hess ( g_h , t_idx : int ) : LOGGER . info ( "get grad and hess of tree {}" . format ( t_idx ) ) grad_and_hess_subtree = g_h . mapValues ( lambda grad_and_hess : ( grad_and_hess [ 0 ] [ t_idx ] , grad_and_hess [ 1 ] [ t_idx ] ) ) return grad_and_hess_subtree