generating layer init code from layers.json