def dropout(self, dropprob, val=0.0):
    """
    Drop entries in this matrix uniformly randomly with given probability
    and set the dropped out unit to state val.
    """
    err_code = _eigenmat.dropout(EigenMatrix.rnd_state_p, self.p_mat,
                  ct.c_float(dropprob), ct.c_float(val))
    if err_code:
      raise generate_exception(err_code)

    return self

    Drop entries in this matrix uniformly randomly with given probability
    and set the dropped out unit to state val.
    
eigenmat/eigenmat.py