Thanks for the code!
Unfortunately I cannot debug it smoothly, as all arguments (with their shapes) are missing as well as the definition of extractiVector().
One issue in your forward method is, that you are detaching torch.norm(x) by calling item on it, thus it works as a constant value.
The error message is strange given your code, as no arguments are passed to g_error.backward().
Could you try to simplify the code a bit or post all arguments using torch.randn with the corresponding shapes?