Can I take Imodium while pregnant

Is it safe to take Imodium while pregnant having some diarrhea