提交 af703ed2 authored 作者: Brandon T. Willard's avatar Brandon T. Willard

Remove low quality FunctionGraph test relying on stale pickle data

This test simply loaded an old example of pickled data. It was both extremely indirect and brittle. Changes to the code base will eventually invalidate nearly all of the old classes used, and whatever the exact issue was, it should've been tested directly.
上级 21daf4e0
import os
import pickle
import pytest
import theano
from theano.compat import PY3
from theano.gof.fg import FunctionGraph
from theano import tensor as tt
from theano.gof.fg import FunctionGraph
class TestFunctionGraph:
......@@ -16,24 +11,3 @@ class TestFunctionGraph:
s = pickle.dumps(func)
pickle.loads(s)
@pytest.mark.skipif(
not theano.config.cxx, reason="G++ not available, so we need to skip this test."
)
@pytest.mark.slow
def test_node_outputs_not_used(self):
# In the past, we where removing some not used variable from
# fgraph.variables event if the apply had other output used in
# the graph. This caused a crash.
# This test run the pickle that reproduce this case.
with open(
os.path.join(os.path.dirname(__file__), "test_fg_old_crash.pkl"), "rb"
) as f:
from theano.misc.pkl_utils import CompatUnpickler
if PY3:
u = CompatUnpickler(f, encoding="latin1")
else:
u = CompatUnpickler(f)
d = u.load()
f = theano.function(**d)
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论