In fact, I am trying to understand how and where is coded a function like torch.sum(). I guess the code is in the C folders somewhere, I was looking in Aten, but no way to find this thing.
For instance, I would like to add a simple thing: a reversed cumsum operation. It would be a great simplification for computing the returns in reinforcement learning, instead of:
returns = rewards.flip(dims).cumsum(dim).flip(dims)

This is only a simple example among hundreds.
Is there a generic way to contribute to these basic functions?