Your method may work with some networks (though it should handle 1d parameters too) but it is more usual to delegate initialization to submodules for more precise control, as other nn.init initializers all may have their use, depending on distribution of submodule inputs (or preceding “activation function”).