title: How to implement maximum mean discrepancy (MMD) in Tensorflow?
body: <p>I'm doing some deep transfer learning studies and I need to add MMD as loss function to my Tensorflow model. Is there any available API in Tensorflow that can apply MMD as loss function directly? </p>
  
  <p>If there is not, how can I implement it in Tensorflow so that the gradients can be applied automatically? </p>
  
  <p>Thanks for any reply!</p>