Yes and indeed nn::sequential just uses a std::vector<AnyModule> as its underlying module list. https://github.com/pytorch/pytorch/blob/master/torch/csrc/api/include/torch/nn/modules/sequential.h#L326 9
nn::sequential should already require each module to have a forward implementation. Is that what you mean?