Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
6dc2aac4
提交
6dc2aac4
authored
9月 28, 2015
作者:
Arnaud Bergeron
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move off the device and mode config to a separate file.
上级
3cb88534
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
43 行增加
和
43 行删除
+43
-43
config.py
theano/sandbox/gpuarray/tests/config.py
+26
-0
test_basic_ops.py
theano/sandbox/gpuarray/tests/test_basic_ops.py
+2
-27
test_blas.py
theano/sandbox/gpuarray/tests/test_blas.py
+2
-2
test_conv_cuda_ndarray.py
theano/sandbox/gpuarray/tests/test_conv_cuda_ndarray.py
+1
-1
test_dnn.py
theano/sandbox/gpuarray/tests/test_dnn.py
+1
-1
test_elemwise.py
theano/sandbox/gpuarray/tests/test_elemwise.py
+2
-1
test_neighbours.py
theano/sandbox/gpuarray/tests/test_neighbours.py
+2
-3
test_nerv.py
theano/sandbox/gpuarray/tests/test_nerv.py
+1
-1
test_nnet.py
theano/sandbox/gpuarray/tests/test_nnet.py
+1
-3
test_opt.py
theano/sandbox/gpuarray/tests/test_opt.py
+3
-1
test_scan.py
theano/sandbox/gpuarray/tests/test_scan.py
+1
-1
test_subtensor.py
theano/sandbox/gpuarray/tests/test_subtensor.py
+1
-2
没有找到文件。
theano/sandbox/gpuarray/tests/config.py
0 → 100644
浏览文件 @
6dc2aac4
from
nose.plugins.skip
import
SkipTest
import
theano.sandbox.gpuarray
if
theano
.
sandbox
.
gpuarray
.
pygpu
is
None
:
raise
SkipTest
(
"pygpu not installed"
)
if
not
theano
.
sandbox
.
gpuarray
.
pygpu_activated
:
import
theano.sandbox.cuda
as
cuda_ndarray
if
cuda_ndarray
.
cuda_available
:
cuda_ndarray
.
use
(
'gpu'
,
default_to_move_computation_to_gpu
=
False
,
move_shared_float32_to_gpu
=
False
,
enable_cuda
=
False
)
theano
.
sandbox
.
gpuarray
.
init_dev
(
'cuda'
)
if
not
theano
.
sandbox
.
gpuarray
.
pygpu_activated
:
raise
SkipTest
(
"pygpu disabled"
)
test_ctx_name
=
None
if
theano
.
config
.
mode
==
'FAST_COMPILE'
:
mode_with_gpu
=
theano
.
compile
.
mode
.
get_mode
(
'FAST_RUN'
)
.
including
(
'gpuarray'
)
.
excluding
(
'gpu'
)
mode_without_gpu
=
theano
.
compile
.
mode
.
get_mode
(
'FAST_RUN'
)
.
excluding
(
'gpuarray'
)
else
:
mode_with_gpu
=
theano
.
compile
.
mode
.
get_default_mode
()
.
including
(
'gpuarray'
)
.
excluding
(
'gpu'
)
mode_without_gpu
=
theano
.
compile
.
mode
.
get_default_mode
()
.
excluding
(
'gpuarray'
)
theano/sandbox/gpuarray/tests/test_basic_ops.py
浏览文件 @
6dc2aac4
...
...
@@ -13,7 +13,6 @@ from theano.tensor.basic import alloc
from
theano.tensor.tests
import
test_basic
from
theano.tensor.tests.test_basic
import
rand
,
safe_make_node
from
theano.tests
import
unittest_tools
as
utt
from
theano.tests.unittest_tools
import
SkipTest
import
theano.sandbox.gpuarray
...
...
@@ -25,41 +24,16 @@ from ..basic_ops import (
gpu_join
,
GpuJoin
,
GpuSplit
,
GpuEye
,
gpu_contiguous
)
from
..subtensor
import
GpuSubtensor
import
theano.sandbox.cuda
as
cuda_ndarray
from
.config
import
mode_with_gpu
,
mode_without_gpu
try
:
from
pygpu
import
gpuarray
except
:
pass
if
theano
.
sandbox
.
gpuarray
.
pygpu
is
None
:
raise
SkipTest
(
"pygpu not installed"
)
# If you are writing a new test file, don't copy this code, but rather
# import stuff from this file (like mode_with_gpu) to reuse it.
if
cuda_ndarray
.
cuda_available
and
not
theano
.
sandbox
.
gpuarray
.
pygpu_activated
:
if
not
cuda_ndarray
.
use
.
device_number
:
# We should not enable all the use like the flag device=gpu,
# as many tests don't work in that setup.
cuda_ndarray
.
use
(
'gpu'
,
default_to_move_computation_to_gpu
=
False
,
move_shared_float32_to_gpu
=
False
,
enable_cuda
=
False
)
theano
.
sandbox
.
gpuarray
.
init_dev
(
'cuda'
)
if
not
theano
.
sandbox
.
gpuarray
.
pygpu_activated
:
raise
SkipTest
(
"pygpu disabled"
)
utt
.
seed_rng
()
rng
=
numpy
.
random
.
RandomState
(
seed
=
utt
.
fetch_seed
())
if
theano
.
config
.
mode
==
'FAST_COMPILE'
:
mode_with_gpu
=
theano
.
compile
.
mode
.
get_mode
(
'FAST_RUN'
)
.
including
(
'gpuarray'
)
.
excluding
(
'gpu'
)
mode_without_gpu
=
theano
.
compile
.
mode
.
get_mode
(
'FAST_RUN'
)
.
excluding
(
'gpuarray'
)
else
:
mode_with_gpu
=
theano
.
compile
.
mode
.
get_default_mode
()
.
including
(
'gpuarray'
)
.
excluding
(
'gpu'
)
mode_without_gpu
=
theano
.
compile
.
mode
.
get_default_mode
()
.
excluding
(
'gpuarray'
)
def
inplace_func
(
inputs
,
outputs
,
mode
=
None
,
allow_input_downcast
=
False
,
on_unused_input
=
'raise'
,
name
=
None
):
...
...
@@ -114,6 +88,7 @@ def makeTester(name, op, gpu_op, cases, checks=None, mode_gpu=mode_with_gpu,
def
test_all
(
self
):
if
skip
:
from
nose.plugins.skip
import
SkipTest
raise
SkipTest
(
skip
)
for
testname
,
inputs
in
iteritems
(
cases
):
...
...
theano/sandbox/gpuarray/tests/test_blas.py
浏览文件 @
6dc2aac4
...
...
@@ -10,8 +10,8 @@ from theano.tensor.blas import gemv_inplace, gemm_inplace, _dot22
from
theano.tensor.tests.test_blas
import
TestGer
,
BaseGemv
from
..
import
gpuarray_shared_constructor
from
.
test_basic_ops
import
(
makeTester
,
rand
,
mode_with_gpu
)
from
.
config
import
mode_with_gpu
from
.test_basic_ops
import
makeTester
,
rand
from
..blas
import
(
gpugemv_inplace
,
gpugemv_no_inplace
,
gpugemm_inplace
,
...
...
theano/sandbox/gpuarray/tests/test_conv_cuda_ndarray.py
浏览文件 @
6dc2aac4
...
...
@@ -14,7 +14,7 @@ from theano import tensor
from
theano.tests.unittest_tools
import
seed_rng
# We let that import do the init of the back-end if needed.
from
.
test_basic_ops
import
mode_with_gpu
from
.
config
import
mode_with_gpu
from
..type
import
GpuArrayType
from
..conv
import
GpuConv
from
theano.sandbox.gpuarray
import
dnn
...
...
theano/sandbox/gpuarray/tests/test_dnn.py
浏览文件 @
6dc2aac4
...
...
@@ -15,7 +15,7 @@ from theano.tensor.signal.downsample import MaxPoolGrad, AveragePoolGrad
from
..
import
dnn
from
..basic_ops
import
GpuAllocEmpty
from
.
test_basic_ops
import
mode_with_gpu
,
mode_without_gpu
from
.
config
import
mode_with_gpu
,
mode_without_gpu
from
.
import
test_nnet
...
...
theano/sandbox/gpuarray/tests/test_elemwise.py
浏览文件 @
6dc2aac4
...
...
@@ -7,7 +7,8 @@ from theano.tests.unittest_tools import SkipTest, assert_allclose
from
theano.tensor.tests.test_elemwise
import
(
test_Broadcast
,
test_DimShuffle
,
test_CAReduce
,
T_reduce_dtype
)
from
.test_basic_ops
import
mode_with_gpu
,
rand_gpuarray
from
.config
import
mode_with_gpu
from
.test_basic_ops
import
rand_gpuarray
from
..elemwise
import
(
GpuElemwise
,
GpuDimShuffle
,
GpuCAReduceCuda
,
GpuCAReduceCPY
)
from
..type
import
GpuArrayType
...
...
theano/sandbox/gpuarray/tests/test_neighbours.py
浏览文件 @
6dc2aac4
from
theano.tensor.nnet.tests
import
test_neighbours
# We let that import do the init of the back-end if needed.
from
.
test_basic_ops
import
mode_with_gpu
from
.
config
import
mode_with_gpu
from
..neighbours
import
GpuImages2Neibs
...
...
theano/sandbox/gpuarray/tests/test_nerv.py
浏览文件 @
6dc2aac4
...
...
@@ -6,7 +6,7 @@ from theano import function
from
theano.tests
import
unittest_tools
as
utt
from
theano.tensor
import
vector
,
matrix
,
dot
from
.
test_basic_ops
import
mode_with_gpu
from
.
config
import
mode_with_gpu
from
..nerv
import
Gemm16
,
nerv
...
...
theano/sandbox/gpuarray/tests/test_nnet.py
浏览文件 @
6dc2aac4
...
...
@@ -7,9 +7,7 @@ import theano
import
theano.tensor
as
T
import
theano.tests.unittest_tools
as
utt
# We let that import do the init of the back-end if needed.
from
.test_basic_ops
import
(
mode_with_gpu
,
mode_without_gpu
)
from
.config
import
mode_with_gpu
,
mode_without_gpu
from
..nnet
import
(
GpuCrossentropySoftmaxArgmax1HotWithBias
,
GpuCrossentropySoftmax1HotWithBiasDx
,
...
...
theano/sandbox/gpuarray/tests/test_opt.py
浏览文件 @
6dc2aac4
...
...
@@ -14,7 +14,9 @@ from ..basic_ops import (GpuAlloc, GpuReshape, gpu_alloc,
gpu_from_host
,
host_from_gpu
)
from
..elemwise
import
GpuCAReduceCuda
,
GpuCAReduceCPY
,
GpuElemwise
from
..subtensor
import
GpuSubtensor
from
.test_basic_ops
import
rand_gpuarray
,
mode_with_gpu
,
mode_without_gpu
from
.config
import
mode_with_gpu
,
mode_without_gpu
from
.test_basic_ops
import
rand_gpuarray
def
test_local_assert
():
...
...
theano/sandbox/gpuarray/tests/test_scan.py
浏览文件 @
6dc2aac4
...
...
@@ -9,7 +9,7 @@ import theano.sandbox.rng_mrg
from
..basic_ops
import
gpu_from_host
,
GpuFromHost
,
HostFromGpu
from
..elemwise
import
GpuElemwise
from
.
test_basic_ops
import
mode_with_gpu
from
.
config
import
mode_with_gpu
class
T_Scan
(
TestCase
):
...
...
theano/sandbox/gpuarray/tests/test_subtensor.py
浏览文件 @
6dc2aac4
...
...
@@ -11,8 +11,7 @@ from ..subtensor import (GpuIncSubtensor, GpuSubtensor,
GpuAdvancedIncSubtensor1
)
from
..type
import
gpuarray_shared_constructor
from
.test_basic_ops
import
mode_with_gpu
from
.config
import
mode_with_gpu
class
G_subtensor
(
test_subtensor
.
T_subtensor
):
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论