How can I get weak_intrusive_ptr from a raw pointer

Hi, I am trying to hack in the pytorch codebase, however I need to convert from raw pointer to weak_intrusive_ptr. uppon reading the intrusive_ptr.h file multiple time I cannot find anything that does what I want. Is it possible?

I think you want c10::make_intrusive.
You can see it being used here for example.