Hinduism has taken various positions, ranging from positive to neutral or discouraging. Homosexuality is regarded as one of the possible expressions of human desire and Hindu mythic stories have portrayed homosexual experience as natural and joyful. There are several Hindu temples which have carvings that depict both men and women indulging in homosexual sex.
Rigveda, one of the four canonical sacred texts of Hinduism says 'Vikruti Evam Prakriti' (diversity is what nature is all about, or, what seems un-natural is also natural), which some scholars believe recognizes homosexuality as natural, if not an approval of homosexuality. Moreover, Rigveda recognizes the cyclical constancy of homosexual/transsexual dimensions of human life, like all forms of universal diversities. The Hindu text Kamasutra written by Sage Vatsyayana has a complete chapter on male-male sex. Chapter six, Auparishtika talks about fellatio (oral sex) between two men. However, sexuality is rarely discussed openly in Hindu society today, and homosexuality is largely a taboo subject — especially among the strongly religious. In a 2004 survey, most swamis said they opposed the concept of a Hindu-sanctified gay marriage. Some of the law codes, such as that of Manu Smriti assert that a woman polluting a virgin is a crime. Punishments include ritual baths, fines, public humiliation and having fingers cut off. However, the bulk of sexual matters dealt with by the law books are heterosexual in nature.
A "third gender" has been acknowledged within Hinduism since Vedic times. Several Hindu texts, such as Manu Smriti and Sushruta Samhita, assert that some people are born with either mixed male and female natures, or sexually neuter, as a matter of natural biology. They worked as hairdressers, flower-sellers, servants, masseurs and prostitutes. Today, many people of a "third gender" (hijras) live throughout India, mostly on the margins of society, and many still work in prostitution, or make a livelihood as beggars.
The Indian Kama Sutra, written in the 4th century AD, contains passages describing eunuchs or "third-sex" males performing oral sex on men. However, the author was "not a fan of homosexual activities" and treated such individuals with disdain, according to historian Devdutt Pattanaik. Similarly, some medieval Hindu temples and artifacts openly depict male homosexuality, lesbianism, and bisexuality within their carvings, such as the temple walls at Khajuraho. Some infer from these images that Hindu society and religion were previously more open to variations in human sexuality than they are at present.
Hindu scriptures contain several stories that metaphorically have homosexual, bisexual, transgender, or other kinds of queer overtones, often involving the most prominent Hindu deities. There are Hindu deities who are intersex (both male and female), e.g., Ardhanari, who is the unified form of Shiva and Parvati; who switch from male to female or from female to male, e.g., Mohini, who is the only female Avatar of Vishnu; male deities with female moods and female deities with male moods, e.g., Krishna turning into Mohini to fulfil Iravan's boon; deities born from two males or from two females, e.g., Ayyappan, who is considered to be "Harihara Putra", the son of Shiva and Vishnu, in his Mohini Avatar, and so on...etc