Isn't the gradient of abs() defined in Theano at : github.com - Theano ? It depends on what sgn() gives at zero (which is handled at https://github.com/Theano/Theano/blob/master/theano/scalar/basic.py#L2400).

I guess there could be a problem for abs().grad at zero in the complex plane (different code branch). But that path shouldn't execute in your case.

I guess there could be a problem for abs().grad at zero in the complex plane (different code branch). But that path shouldn't execute in your case.