docstr: Test that gradients accumulate when tf.gradients doesn't return
  tf.Tensor (IndexedSlices).
docstr_tok: ["Test","that","gradients","accumulate","when","tf.gradients","does","n't","return","tf.Tensor","(","IndexedSlices",")","."]
code: def test_indexedslices(self):
      """Test that gradients accumulate when tf.gradients doesn't return
      tf.Tensor (IndexedSlices)."""
      with self.test_session() as sess:
          N = 10  # number of data points
          K = 2  # number of clusters
          T = 1  # number of MCMC samples
  
          x_data = np.zeros(N, dtype=np.float32)
  
          mu = Normal(0.0, 1.0, sample_shape=K)
          c = Categorical(logits=tf.zeros(N))
          x = Normal(tf.gather(mu, c), tf.ones(N))
  
          qmu = Empirical(params=tf.Variable(tf.ones([T, K])))
          qc = Empirical(params=tf.Variable(tf.ones([T, N])))
  
          inference = ed.HMC({mu: qmu}, data={x: x_data})
          inference.initialize()
  
file_path: edward/tests/inferences/hmc_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import edward
  import numpy
  import tensorflow
  from edward.models import Categorical, Empirical, Normal
label_desc: Use image node_id 5 for calling the test_hmc_class obj's underlying member method code with example usage: obj.test_indexedslices() without return types