fix ExecutionContext::HasInput and ExecutionContext::HasOutput depend on the scope structure, test=develop (#20721)
fix ExecutionContext::HasInput and ExecutionContext::HasOutput depend on the scope structure, test=develop (#20721)


luotao1/Paddle,PaddlePaddle/Paddle,PaddlePaddle/Paddle,PaddlePaddle/Paddle,luotao1/Paddle,chengduoZH/Paddle,luotao1/Paddle,PaddlePaddle/Paddle,PaddlePaddle/Paddle,luotao1/Paddle,PaddlePaddle/Paddle,chengduoZH/Paddle,chengduoZH/Paddle,luotao1/Paddle,PaddlePaddle/Paddle,chengduoZH/Paddle,chengduoZH/Paddle,luotao1/Paddle,luotao1/Paddle