提交 5534d3ca authored 作者: Frederic's avatar Frederic

pep8

上级 eb49be66
...@@ -7,6 +7,9 @@ import theano.tensor as T ...@@ -7,6 +7,9 @@ import theano.tensor as T
import theano.tests.unittest_tools as utt import theano.tests.unittest_tools as utt
from theano.sandbox import gpuarray from theano.sandbox import gpuarray
from theano.sandbox.gpuarray.nnet import (
GpuCrossentropySoftmaxArgmax1HotWithBias,
GpuCrossentropySoftmax1HotWithBiasDx)
if theano.sandbox.gpuarray.pygpu is None: if theano.sandbox.gpuarray.pygpu is None:
raise SkipTest("pygpu not installed") raise SkipTest("pygpu not installed")
...@@ -25,7 +28,8 @@ if cuda_ndarray.cuda_available and not theano.sandbox.gpuarray.pygpu_activated: ...@@ -25,7 +28,8 @@ if cuda_ndarray.cuda_available and not theano.sandbox.gpuarray.pygpu_activated:
if not gpuarray.pygpu_activated: if not gpuarray.pygpu_activated:
raise SkipTest("pygpu disabled") raise SkipTest("pygpu disabled")
from theano.sandbox.gpuarray.nnet import (GpuCrossentropySoftmaxArgmax1HotWithBias, from theano.sandbox.gpuarray.nnet import (
GpuCrossentropySoftmaxArgmax1HotWithBias,
GpuCrossentropySoftmax1HotWithBiasDx) GpuCrossentropySoftmax1HotWithBiasDx)
if theano.config.mode == 'FAST_COMPILE': if theano.config.mode == 'FAST_COMPILE':
...@@ -94,7 +98,7 @@ def test_GpuCrossentropySoftmaxArgmax1HotWithBias(): ...@@ -94,7 +98,7 @@ def test_GpuCrossentropySoftmaxArgmax1HotWithBias():
T.nnet.CrossentropySoftmaxArgmax1HotWithBias) T.nnet.CrossentropySoftmaxArgmax1HotWithBias)
for node in classify.maker.fgraph.toposort()]) for node in classify.maker.fgraph.toposort()])
assert any([isinstance(node.op, assert any([isinstance(node.op,
gpuarray.nnet.GpuCrossentropySoftmaxArgmax1HotWithBias) GpuCrossentropySoftmaxArgmax1HotWithBias)
for node in classify_gpu.maker.fgraph.toposort()]) for node in classify_gpu.maker.fgraph.toposort()])
out = classify(yy, b_values, dot_value) out = classify(yy, b_values, dot_value)
...@@ -149,7 +153,7 @@ def test_GpuCrossentropySoftmax1HotWithBiasDx(): ...@@ -149,7 +153,7 @@ def test_GpuCrossentropySoftmax1HotWithBiasDx():
assert any([isinstance(node.op, T.nnet.CrossentropySoftmax1HotWithBiasDx) assert any([isinstance(node.op, T.nnet.CrossentropySoftmax1HotWithBiasDx)
for node in cpu_f.maker.fgraph.toposort()]) for node in cpu_f.maker.fgraph.toposort()])
assert any([isinstance(node.op, assert any([isinstance(node.op,
gpuarray.nnet.GpuCrossentropySoftmax1HotWithBiasDx) GpuCrossentropySoftmax1HotWithBiasDx)
for node in gpu_f.maker.fgraph.toposort()]) for node in gpu_f.maker.fgraph.toposort()])
cpu_out = cpu_f(softmax_output_value) cpu_out = cpu_f(softmax_output_value)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论