MCPcopy
hub / github.com/ibab/tensorflow-wavenet / testGenerateFast

Method testGenerateFast

test/test_generation.py:34–48  ·  view source on GitHub ↗

Generate a few samples using the fast method and perform sanity checks on the output.

(self)

Source from the content-addressed store, hash-verified

32 self.assertTrue(np.all((proba >= 0) & (proba <= (128 - 1))))
33
34 def testGenerateFast(self):
35 ''&#x27;Generate a few samples using the fast method and
36 perform sanity checks on the output.''&#x27;
37 waveform = tf.placeholder(tf.int32)
38 np.random.seed(0)
39 data = np.random.randint(128)
40 proba = self.net.predict_proba_incremental(waveform)
41
42 with self.test_session() as sess:
43 sess.run(tf.global_variables_initializer())
44 sess.run(self.net.init_ops)
45 proba = sess.run(proba, feed_dict={waveform: data})
46
47 self.assertAllEqual(proba.shape, [128])
48 self.assertTrue(np.all((proba >= 0) & (proba <= (128 - 1))))
49
50 def testCompareSimpleFast(self):
51 waveform = tf.placeholder(tf.int32)

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected