test_basic.py 文件源码

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

项目:Theano-Deep-learning 作者: GeekLiB 项目源码 文件源码
def test_Op_integers(self):
        """Test behaviour of ARange Op on integer inputs"""
        start, stop, step = iscalars('start', 'stop', 'step')
        out = ARange(start.type.dtype)(start, stop, step)
        f = function([start, stop, step], out)

        assert numpy.all(f(0, 5, 1) == numpy.arange(0, 5, 1))
        assert numpy.all(f(2, 11, 4) == numpy.arange(2, 11, 4))
        assert numpy.all(f(-5, 1, 1) == numpy.arange(-5, 1, 1))
        assert numpy.all(f(10, 2, -2) == numpy.arange(10, 2, -2))
        assert numpy.all(f(10, 2, 2) == numpy.arange(10, 2, 2))
        assert numpy.all(f(0, 0, 1) == numpy.arange(0, 0, 1))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号