test_scan.py 文件源码

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

项目:Theano-Deep-learning 作者: GeekLiB 项目源码 文件源码
def test_inconsistent_inner_fct(self):
        # Test that scan can detect inconsistencies in the inner graph and
        # raises an appropriate exception. The pickled file used in this test
        # relies on the cuda backend.

        # This test has not been extensively tested for Python 3 so it should
        # be skipped if python version is >=3
        version = sys.version_info
        if version >= (3,):
            raise SkipTest("This test relies on a pickled file produced with "
                           "Python 2. The current python version "
                           "(%i.%i.%i.%i) is >= 3 so the test will be "
                           "skipped." % (version.major, version.minor,
                           version.micro, version.serial))

        # When unpickled, the scan op should perform validation on its inner
        # graph, detect the inconsistencies and raise a TypeError
        folder = os.path.dirname(os.path.abspath(__file__))
        path = os.path.join(folder, "inconsistent_scan.pkl")
        assert_raises(TypeError, pickle.load, open(path, "r"))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号