test_dictionary_output.py 文件源码

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

项目:Theano-Deep-learning 作者: GeekLiB 项目源码 文件源码
def test_output_order_sorted(self):

        '''
        Tests that the output keys are sorted correctly.
        '''

        x = T.scalar('x')
        y = T.scalar('y')
        z = T.scalar('z')
        e1 = T.scalar('1')
        e2 = T.scalar('2')

        f = theano.function([x, y, z, e1, e2], outputs={'x': x, 'y': y, 'z': z,
                                                        '1': e1, '2': e2})

        assert '1' in str(f.outputs[0])
        assert '2' in str(f.outputs[1])
        assert 'x' in str(f.outputs[2])
        assert 'y' in str(f.outputs[3])
        assert 'z' in str(f.outputs[4])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号