Hi,
I have a nested sequential model (I subclassed nn::Sequential so as to have a non templated forward method).
struct MySequentialImpl : torch::nn::SequentialImpl {
public:
    template<typename... Modules>
    explicit MySequentialImpl(Modules &&... modules);

    torch::Tensor forward(torch::Tensor x);
};

TORCH_MODULE(MySequential);

Let’s say I have a module like the following:
    auto module = MySequential(MySequential(nn::Conv1d(6, 6, 3), nn::ReLU()), nn::Identity());

    for (auto &child: module.ptr()->children()) {
        MySequentialImpl *ptr = child->as<MySequential>();
        if (ptr) {
            std::cout << ptr->name() << std::endl;

        }
    }

How do I convert MySequentialImpl *ptr above to a std::shared_ptr<MySequential>?
Thanks