In an interview Sunday with CNN, former congressman Barney Frank called Ben Carson's statement that prison can make you gay “abysmally ignorant.”

The 74-year-old openly gay Frank is currently pitching his new memoir, Frank: A Life in Politics from the Great Society to Same-Sex Marriage.

Earlier this month, Ben Carson, a possible GOP presidential candidate, made headlines when he said that prison can make people gay.

“Absolutely,” Carson answered when asked if being gay is a choice. “Because a lot of people go into prison straight and when they come out they're gay.”

(Related: Ben Carson opposed to marriage equality because some inmates turn gay in prison.)

Later in the day, Carson apologized for the remark and vowed he would no longer talk about gay rights.

“It is striking about how human intelligence can vary,” Frank said. “[Carson] is apparently a first rate surgeon but when it comes to something this basic about human nature he's abysmally ignorant.”

“Secondly, he wants to use that ignorance in the defense of prejudice. And most discouraging of all, being ignorant and bigoted against gay and lesbian people doesn't seem to hurt him with the Republican primary electorate.”

Elsewhere in the interview, Frank answered “yes” when asked if there are closeted gay members in the House, which he's okay with.

“The issue where they lose me is hypocrisy,” Frank said. “What I think is unacceptable is to vote a certain set of rules as an elected official and then to violate them yourself. But if you are a Democrat, Republican, whatever, and you vote to allow people to do what you do, then I have no demand that you become public.”