test_next_step.py 文件源码

python
阅读 35 收藏 0 点赞 0 评论 0

项目:generating_sequences 作者: PFCM 项目源码 文件源码
def test_get_model(self):
        """Just make sure we can get a model without errors"""
        # TODO(pfcm) nice helpers for setting up/tearing down a graph & sess
        with tf.Graph().as_default():
            inputs = tf.placeholder(tf.float32, [50, 30, 10])
            cell = tf.nn.rnn_cell.BasicRNNCell(32)

            istate, logits, fstate = ns.standard_nextstep_inference(
                cell, inputs, 5)

            # check shapes are as expected
            self.assertEqual(istate[0].get_shape().as_list(),
                             [30, 32])
            self.assertEqual(len(logits), 50)
            self.assertEqual(logits[0].get_shape().as_list(),
                             [30, 5])
            self.assertEqual(istate[0].get_shape().as_list(),
                             fstate[0].get_shape().as_list())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号