def testResults(self):
    """Tests network produces zero updates with learning rate equal to zero."""
    shape = [10]
    learning_rate = 0.01
    gradients = tf.random_normal(shape)
    net = networks.Sgd(learning_rate=learning_rate)
    state = net.initial_state_for_inputs(gradients)
    update, _ = net(gradients, state)

    with self.test_session() as sess:
      gradients_np, update_np = sess.run([gradients, update])
      self.assertAllEqual(update_np, -learning_rate * gradients_np)
Tests network produces zero updates with learning rate equal to zero.
networks_test.py