code: def _log(self, x):
          
  
          xshape = x.shape
          _x = x.flatten()
          y = utils.masked_log(_x)
          return y.reshape(xshape)
docs: 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