Ah OK, you don’t need to call this method after each layer.
Just initialize your model and call it once via model.apply(weight_init) as shown in my example.
model.apply will recursively pass each module (and submodule, …) to the passed function.