How to make custom c++ class torch compilable

This doc discussed about how to make custom operators work with torch.compile. Is it possible to make custom c++ classes compatible with torch.compile?