I’m tracing back the error and it points at this:
def zlogit(re, im):
    abs_ = t.sqrt(re**2 + im**2)
    ang = t.atan2(im, re)
    mask = ~(ang > 0)
    abs_[mask] = -1 * abs_[mask]
    return abs_

Where is the inplace operation that I did?