I was up late experimenting with Gemini, and we came across the need for circular arithmetic. We couldn't find anything that accomplished it in the way we wanted reliably, for different transformations identically, etc...
Therefore, I wrote and Gemini assisted, with the creation of an _rclamp function you can add as an attribute or just use as-is for a PyTorch tensor. It's 1d right now, didn't want to implement the dimensionality wrong with my "newbie skills".
Have fun!
- <3
https://colab.research.google.com/drive/1aj_iAp0eyfPMznzF-aC1UXrQPTNOeKUj?usp=sharing