Subclassing or Extending torch::Tensor in C++

Hi,

Are there any good documentation/examples on how to correctly subclass a torch::Tensor in C++ so that the derived class remains compatible with the usual autograd and optimization workflows?

Thanks in advance to anyone who could add some pointers on how to implement a custom tensor type by inheriting from the torch::Tensor properly.

Related question in How to Extend Torch via it's C++ Frontend