import tensorflow as tf

      mdl = p.Instantiate()
      mdl.FPropDefaultTheta()
      all_vars = tf.trainable_variables()
      py_utils.SumSquared(all_vars)

  def testCollectVarHistogram(self):
    with self.session(use_gpu=False, graph=tf.Graph()):
      p = self._testParams()
      mdl = p.Instantiate()
      mdl.FPropDefaultTheta()
      var_grads = py_utils.ComputeGradients(mdl.loss, mdl.vars)
      summary_utils.CollectVarHistogram(var_grads)
