NO, Cheng Dieyi was not gay. He just did not recogonize his own sexual identidy. While he played a woman character on stage, for many years, in the era the movie is set it was considered perfectly normal for a (heterosexual) male actor to play such a role. Recall all the women fans swarming to see him during interviews for example. In his personal life however we know that he was gay due to his relationship with Master Yuan Shiqing who first initiated their relationship when he asked Cheng to be his special friend. While they are shown many times spending a lot of time together, we never see Cheng with any lady friends. Also earlier in the movie, when depicted as a child, remember that Cheng Dieyi was molested by Master Zhang the eunuch right after his and Duan Xiaolous first performance of Farewell My Concubine.