提交 410405cf authored 作者: James Bergstra's avatar James Bergstra

pep8 tensor/tests/test_misc.py

上级 731e2d2f
import copy, sys
import numpy, theano
import copy
import sys
import numpy
import theano
from theano import tensor
from theano.tensor.nnet import crossentropy_softmax_argmax_1hot_with_bias
def test_bug_2009_06_02_trac_387():
def test_bug_2009_06_02_trac_387():
y = tensor.lvector('y')
#f = theano.function([y], tensor.stack(y[0] / 2))
#f = theano.function([y], tensor.join(0,tensor.shape_padleft(y[0] / 2,1)))
f = theano.function([y], tensor.int_div(tensor.DimShuffle(y[0].broadcastable, ['x'])(y[0]), 2))
f = theano.function([y],
tensor.int_div(
tensor.DimShuffle(y[0].broadcastable, ['x'])(y[0]), 2))
sys.stdout.flush()
print f(numpy.ones(1, dtype='int64') * 3)
#z = tensor.lscalar('z')
#f = theano.function([z], tensor.DimShuffle([], ['x'])(z) / 2)
# XXX: there is no assert, nor comment that DEBUGMODE is to do the
# checking. What was the bug, and how is it being tested?
def test_bug_2009_07_17_borrowed_output():
"""Regression test for a bug where output was borrowed by mistake."""
......@@ -68,4 +71,3 @@ def test_bug_2009_07_17_borrowed_output():
assert id_z != id_other
# Just to be 100% sure, ensure that z was not altered.
assert (z == z_backup).all()
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论