Hi,

np.maximum or things, which is wip in Pytorch

Not sure what you mean by that. You can use torch.max() to get element-wise maximum. Or you can use the threshold function if you just want a threshold as seems to be the case in your code.
I would recommend you read the doc that explains how to write a custom Function here: https://pytorch.org/docs/stable/notes/extending.html 5
That will solve your issues with wrong number and type of returns from the backward.

Also a feature request It would be great if our Pytorch provides numpy equivalent library that contains all numpy functions as that jax or other frameworks provided.

This is already work in progress. You can follow the work in this issue: https://github.com/pytorch/pytorch/issues/38349 3