title: Does tensorflow propagate gradients through a pdf
body: <p>Lets say, a distribution function is defined as below:</p>
  
  <pre><code>dist = tf.contrib.distributions.Normal(mu, sigma)
  </code></pre>
  
  <p>and a sample is drawn from the distribution</p>
  
  <pre><code>val = dist.pdf(x)
  </code></pre>
  
  <p>and this value is used in a model to predict a variable</p>
  
  <pre><code>X_hat = f(val)
  loss = tf.norm(X_pred-X_hat, ord=2)
  </code></pre>
  
  <p>and if I want to optimize the variables mu and sigma to reduce my prediction error can I do the following?</p>
  
  <pre><code>train = tf.train.AdamOptimizer(1e-03).minimize(loss, var_list=[mu, sigma])
  </code></pre>
  
  <p>I am interested in knowing if the gradient routines are propagated through the normal distribution, or should I expect some issues because I am taking gradients over the parameters defining a distribution</p>