提交 e22a1ac6 authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Fix remaining problems with old interfaces.

上级 5f49246d
...@@ -191,3 +191,5 @@ def sparse_grad(var): ...@@ -191,3 +191,5 @@ def sparse_grad(var):
ret = var.owner.op.__class__(sparse_grad=True)(*var.owner.inputs) ret = var.owner.op.__class__(sparse_grad=True)(*var.owner.inputs)
return ret return ret
__import__('theano.tensor.shared_randomstreams')
...@@ -478,7 +478,7 @@ def scan(fn, ...@@ -478,7 +478,7 @@ def scan(fn,
# If we use a regular dict here, the results are non-deterministic # If we use a regular dict here, the results are non-deterministic
if not isinstance(updates, (list, tuple)): if not isinstance(updates, (list, tuple)):
if isinstance(updates, dict) and \ if isinstance(updates, dict) and \
not isinstance(updates, compat.python2x.OrderedDict): not isinstance(updates, OrderedDict):
warnings.warn("Using non-deterministic dictionary.") warnings.warn("Using non-deterministic dictionary.")
dummy_f = function(dummy_args, dummy_f = function(dummy_args,
......
...@@ -10,7 +10,7 @@ def test_make_slice_merge(): ...@@ -10,7 +10,7 @@ def test_make_slice_merge():
s1 = make_slice(0, i) s1 = make_slice(0, i)
s2 = make_slice(0, i) s2 = make_slice(0, i)
f = theano.function([i], [s1, s2]) f = theano.function([i], [s1, s2])
nodes = f.maker.fgraph.nodes nodes = f.maker.fgraph.apply_nodes
assert len([n for n in nodes if isinstance(n.op, MakeSlice)]) == 1 assert len([n for n in nodes if isinstance(n.op, MakeSlice)]) == 1
theano.printing.debugprint(f) theano.printing.debugprint(f)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论