If you have a better formula for your gradient, you can use a custom Function to specify what the backward should compute (see doc here 7).
But not sure what that formula would be as the gradient is just 0 here.