Hi! I started implementing a recent paper that seemed to be exciting and useful for the community (it is Riemannian Adaptive Optimization Methods 22). Deciding on API I chose native Tensors to be subclassed as well as Parameters. This allowed generic implementation for Riemannian optimizers. However, having a decent development experience, I also thought it is a good thing to ask pytorch developers if I’m doing things in the right way.
My question is this way to implement such kind of subclasses is right and a follows best practices? (here is it 16)
Some issues/benefits I got with this API


isinstance(r_parameter, torch.nn.Parameter) is True that is a good thing, you can use such params in a module

r_tensor.clone() returns Tensor type. I have not yet decided whether it is expected behaviour or should be changed. and return ManifoldTensor type.

r_rensor.data – same thing

I think the last two concerns are the only I have. Thank you!