test_dictionary_output.py 文件源码

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

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

        '''
        Tests that debug mode works where outputs is a dictionary.
        '''

        x = T.scalar('x')

        f = theano.function([x], outputs={'1': x, '2': 2 * x,
                                          '3': 3 * x}, mode="DEBUG_MODE")

        result = f(3.0)

        assert result['1'] == 3.0
        assert result['2'] == 6.0
        assert result['3'] == 9.0
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号