A West Australian police officer is being investigated for allegedly tasering two men at a social gathering as a party trick.

It is alleged the incident occurred on July 23, when the woman, an officer at Carnarvon in WA's Gascoyne region, visited her boyfriend at the party while on duty.

Police say her boyfriend and another man both asked to be shocked with her Taser, and she complied.

The officer has been stood aside from police duties during the investigation.