提交 65a3614b authored 作者: Vincent Michalski's avatar Vincent Michalski

one unittest in nnet (should be complete now) and one in test_conv3d2d

上级 7561c1c2
......@@ -10,6 +10,7 @@ except ImportError:
from six.moves import xrange
import theano
import theano.sandbox.cuda as cuda
from theano.tensor.nnet.conv3d2d import *
import theano.tests.unittest_tools as utt
......@@ -73,6 +74,14 @@ def pyconv3d(signals, filters):
r_i += o_i[Tf2:o_i_sh0-Tf2, Hf2:-Hf2, Wf2:-Wf2]
return rval
def check_diagonal_subtensor_view_traces(fn):
if cuda.cuda_available:
for apply_node in fn.maker.fgraph.apply_nodes:
print( 'apply_node.op: {0}'.format(apply_node.op, ))
print( 'apply_node: {0}'.format(apply_node, ))
print( 'apply_node.tag: {0}'.format(apply_node.tag, ))
if isinstance(apply_node.op, (DiagonalSubtensor, IncDiagonalSubtensor)):
assert hasattr(apply_node.tag, 'trace')
def test_conv3d(mode=mode_without_gpu, shared=theano.tensor._shared):
if ndimage is None:
......@@ -100,6 +109,7 @@ def test_conv3d(mode=mode_without_gpu, shared=theano.tensor._shared):
updates={s_output: out},
mode=mode)
check_diagonal_subtensor_view_traces(newconv3d)
t0 = time.time()
newconv3d()
print(time.time() - t0)
......
......@@ -1319,6 +1319,8 @@ def test_argmax_pushdown_bias():
fgraph = gof.FunctionGraph(
[x, b],
[out])
f = theano.function([x, b], out)
assert hasattr(f.maker.fgraph.outputs[0].tag, 'trace')
theano.compile.mode.optdb.query(
theano.compile.mode.OPT_FAST_RUN).optimize(fgraph)
......@@ -1338,6 +1340,8 @@ def test_argmax_pushdown_bias():
fgraph = gof.FunctionGraph(
[x, b],
[out])
f = theano.function([x, b], out)
assert hasattr(f.maker.fgraph.outputs[0].tag, 'trace')
backup = config.warn.argmax_pushdown_bug
config.warn.argmax_pushdown_bug = False
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论