示例#1
0
 def testUnwrap(self, shape, axis):
   x_np = 5 * np.random.randn(*shape)
   x_tf = tf.convert_to_tensor(x_np)
   res_np = np.unwrap(x_np, axis=axis)
   with self.cached_session() as sess:
     res_tf = sess.run(spectral_ops.unwrap(x_tf, axis=axis))
   self.assertEqual(res_np.shape, res_tf.shape)
   self.assertAllClose(res_np, res_tf)
示例#2
0
 def testUnwrap(self, shape, axis):
   x_np = 5 * np.random.randn(*shape)
   x_tf = tf.convert_to_tensor(x_np)
   res_np = np.unwrap(x_np, axis=axis)
   with self.cached_session() as sess:
     res_tf = sess.run(spectral_ops.unwrap(x_tf, axis=axis))
   self.assertEqual(res_np.shape, res_tf.shape)
   self.assertAllClose(res_np, res_tf)