Catch exception and forward NullType to input gradients, instead of failing