Skip to content

Commit

Permalink
using generate with float64 causes trouble
Browse files Browse the repository at this point in the history
  • Loading branch information
goodfeli committed Feb 6, 2018
1 parent 1c12f48 commit 1cc2720
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests_tf/test_attacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ def test_generate_np_gives_adversarial_example_l1(self):
def test_generate_np_gives_adversarial_example_l2(self):
self.help_generate_np_gives_adversarial_example(2)

def test_generate_respects_dtype(self):
x = tf.placeholder(dtype=tf.float64, shape=(100, 2))
x_adv = self.attack.generate(x)
self.assertEqual(x_adv.dtype, tf.float64)

def test_targeted_generate_np_gives_adversarial_example(self):
x_val = np.random.rand(100, 2)
x_val = np.array(x_val, dtype=np.float32)
Expand Down

0 comments on commit 1cc2720

Please sign in to comment.