Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
zironycho committed Nov 21, 2017
1 parent e3719c6 commit 3769559
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/test_influence.py
Expand Up @@ -214,3 +214,14 @@ def test_approx_filename(self):
test_indices = [0]
self.insp.ihvp_config.update(scale=1)
self.assertNotEqual(inv_hvp_filename, self.insp._approx_filename(self.sess, test_indices))

def test_approx_filename_for_weight(self):
test_indices = [0]

filename_1 = self.insp._approx_filename(self.sess, test_indices)
filename_2 = self.insp._approx_filename(self.sess, test_indices)
self.assertEqual(filename_1, filename_2)

self.sess.run(tf.global_variables_initializer())
filename_3 = self.insp._approx_filename(self.sess, test_indices)
self.assertNotEqual(filename_1, filename_3)

0 comments on commit 3769559

Please sign in to comment.