I think this is thread-safe although inside the parallel_for, but only since layer_consumers_ is only read from.