Mean Reciprocal Rank

In answer selection task, i want to use Mean Reciprocal Rank(MRR) as my measurement. Do any one know how to use it in pytorch?thx!