I found this code when reading the thread:

  
      
      GitHub
  
  
    

ZongxianLee/MMD_Loss.Pytorch 242

A pytorch implementation of Maximum Mean Discrepancies(MMD) loss - ZongxianLee/MMD_Loss.Pytorch