Initializing weights of each module within a Sequential module in Libtorch

Supposing in a struct inheriting from torch::nn::Module I have a registered sequential module like

branch1 = register_module("branch1", torch::nn::Sequential(torch::nn::Conv2d(torch::nn::Conv2dOptions(in_channels, branch_channels, kernel_size).padding(0)),

I am interested in applying a weight initialization function to each component separately, say a function that takes in a torch::nn::Module or a pointer to a torch::nn::Module, what is the simplest way to achieve this?