Numpy has an in-depth guide on subclassing ndarray, allowing arrays to be associated with additional attributes and behaviors while still maintaining the core ndarray functionality:
https://docs.scipy.org/doc/numpy/user/basics.subclassing.html 8
Does any similar feature exist for PyTorch tensors? I’ve tried several things, but unfortunately not been able to get it working. I found a similar discussion 10 from a year ago but no good answer was provided.