提交 ab6ba330 authored 作者: Frederic Bastien's avatar Frederic Bastien

Fix a theano.pp printing error and add a test for it.

上级 3dfa558f
......@@ -967,7 +967,7 @@ class SubtensorPrinter:
elif isinstance(r.owner.op, Subtensor):
idxs = r.owner.op.idx_list
inputs = list(r.owner.inputs)
input = inputs.pop()
input = inputs.pop(0)
sidxs = []
old_precedence = getattr(pstate, 'precedence', None)
try:
......
......@@ -738,3 +738,9 @@ def test_printing_scan():
allow_input_downcast=True)
theano.printing.pydotprint(output, scan_graphs=True)
theano.printing.pydotprint(f, scan_graphs=True)
def test_subtensor():
x = theano.tensor.dvector()
y = x[1]
assert theano.pp(y) == "<TensorType(float64, vector)>[Constant{1}]"
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论