提交 045cda93 authored 作者: Benjamin Scellier's avatar Benjamin Scellier

fix flake8

上级 f8d61d19
...@@ -93,7 +93,7 @@ def makeTester(name, op, gpu_op, cases, checks=None, mode_gpu=mode_with_gpu, ...@@ -93,7 +93,7 @@ def makeTester(name, op, gpu_op, cases, checks=None, mode_gpu=mode_with_gpu,
for _ in range(len(inputs)): for _ in range(len(inputs)):
if type(inputs[_]) is float: if type(inputs[_]) is float:
inputs[_] = np.asarray(inputs[_], inputs[_] = np.asarray(inputs[_],
dtype=theano.config.floatX) dtype=theano.config.floatX)
self.run_case(testname, inputs) self.run_case(testname, inputs)
def run_case(self, testname, inputs): def run_case(self, testname, inputs):
......
...@@ -43,9 +43,9 @@ class TestCusolver(unittest.TestCase): ...@@ -43,9 +43,9 @@ class TestCusolver(unittest.TestCase):
def test_diag_solve(self): def test_diag_solve(self):
np.random.seed(1) np.random.seed(1)
A_val = np.asarray([[2, 0, 0], [0, 1, 0], [0, 0, 1]], A_val = np.asarray([[2, 0, 0], [0, 1, 0], [0, 0, 1]],
dtype="float32") dtype="float32")
x_val = np.random.uniform(-0.4, 0.4, (A_val.shape[1], x_val = np.random.uniform(-0.4, 0.4, (A_val.shape[1],
1)).astype("float32") 1)).astype("float32")
self.run_gpu_solve(A_val, x_val) self.run_gpu_solve(A_val, x_val)
def test_bshape_solve(self): def test_bshape_solve(self):
......
...@@ -63,7 +63,7 @@ def test_multinomial_large(): ...@@ -63,7 +63,7 @@ def test_multinomial_large():
for node in f.maker.fgraph.toposort()]) for node in f.maker.fgraph.toposort()])
pval = np.arange(10000 * 4, pval = np.arange(10000 * 4,
dtype='float32').reshape((10000, 4)) + 0.1 dtype='float32').reshape((10000, 4)) + 0.1
pval = pval / pval.sum(axis=1)[:, None] pval = pval / pval.sum(axis=1)[:, None]
uval = np.ones_like(pval[:, 0]) * 0.5 uval = np.ones_like(pval[:, 0]) * 0.5
mval = f(pval, uval) mval = f(pval, uval)
......
...@@ -214,7 +214,7 @@ class T_Scan(TestCase): ...@@ -214,7 +214,7 @@ class T_Scan(TestCase):
def test_gpu4_gibbs_chain(self): def test_gpu4_gibbs_chain(self):
rng = np.random.RandomState(utt.fetch_seed()) rng = np.random.RandomState(utt.fetch_seed())
v_vsample = np.array(rng.binomial(1, .5, size=(3, 20),), v_vsample = np.array(rng.binomial(1, .5, size=(3, 20),),
dtype='float32') dtype='float32')
vsample = theano.shared(v_vsample) vsample = theano.shared(v_vsample)
trng = theano.sandbox.rng_mrg.MRG_RandomStreams( trng = theano.sandbox.rng_mrg.MRG_RandomStreams(
utt.fetch_seed()) utt.fetch_seed())
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论