Hi,
I don’t think there is as we don’t usually deal with sampled function (if that’s what I understand correctly from the numpy doc).
That being said, if you don’t plan on doing backprop through this op, you can simply do: torch.from_numpy(np.gradient(your_f.numpy())).
If you need to be able to get gradient through it, then you’ll need to check how numpy implements this function and reproduce it with pytorch’s ops.