I know it’s not as efficient as it could be, but I implemented a pytorch version for percentile:

  
      
      GitHub
  
  
    

aliutkus/torchpercentile 155

Percentile computation for pytorch. Contribute to aliutkus/torchpercentile development by creating an account on GitHub.