@tom thank you for crediting me with citing the idea   Note for completeness that the original source of the idea AFAIK is Eric Jiang, https://github.com/ericjang/gumbel-softmax/blob/3c8584924603869e90ca74ac20a6a03d99a91ef9/Categorical%20VAE.ipynb 10
As a somewhat-relevant aside, interestingly, OpenAI used the .detach() operator as an actual mathematical symbol in their paper “DiCE: the infinitely differentiable Monte-Carlo estimator”, https://arxiv.org/abs/1802.05098 2 , see the  second unlabelled equation on page 2.

Screen Shot 2018-06-12 at 2.27.10 AM.png694×370 42.4 KB