I need to set all the values which are greater than 0 to those values itself and all the values less than zeros to exp(a*x), where a is a constant. I tried as follows:
   x[x<=0] = torch.exp(a*x[x<=0])

Is it correct?
I am getting a run time error: a leaf variable that requires grad has been used in an in-place operation.
How to overcome this error?