<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _log(self, x):
 """Modified version of np.log that manually sets values <=0 to -inf Parameters x: ndarray of floats Input to the log function Returns ------- log_ma: ndarray of floats log of x, with x<=0 values replaced with -inf """


        xshape = x.shape
        _x = x.flatten()
        y = utils.masked_log(_x)
        return y.reshape(xshape)