The action is done only on the out.realize call, so scheduling can be added in between algorithm description and execution call.
Halide provides the programmer with a split between specifying the algorithm and the schedule. Therefore, you are able to first focus on writing correct code. And when optimizing with the scheduler there is no chance that you will break the correctness of the code in the process. Its really an ingenious design!