Hi,
If your op is not differentiable, there isn’t much we can do here.
If for your particular use case, you want to specify a special backward for that part that is not differentiable, you can do so with a custom Function: Extending PyTorch — PyTorch 1.7.1 documentation 2