I have never seen a constraint like that, but from that loss_constraint it appears that you want sobelx and sobely weights to be orthagonal?
My guess is that this isn’t allowed because the gradients would need to be based off some output as opposed to the weights themselves.
What you might be able to do is run some input through sobelx and sobely and then constrain their outputs to be orthogonal