Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
07d4461d
提交
07d4461d
authored
3月 30, 2015
作者:
Arnaud Bergeron
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use relavtive import in tests too.
上级
fe380388
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
55 行增加
和
65 行删除
+55
-65
test_basic_ops.py
theano/sandbox/gpuarray/tests/test_basic_ops.py
+4
-4
test_blas.py
theano/sandbox/gpuarray/tests/test_blas.py
+8
-8
test_conv_cuda_ndarray.py
theano/sandbox/gpuarray/tests/test_conv_cuda_ndarray.py
+4
-4
test_elemwise.py
theano/sandbox/gpuarray/tests/test_elemwise.py
+4
-5
test_neighbours.py
theano/sandbox/gpuarray/tests/test_neighbours.py
+5
-5
test_nnet.py
theano/sandbox/gpuarray/tests/test_nnet.py
+7
-6
test_opt.py
theano/sandbox/gpuarray/tests/test_opt.py
+10
-17
test_scan.py
theano/sandbox/gpuarray/tests/test_scan.py
+3
-5
test_subtensor.py
theano/sandbox/gpuarray/tests/test_subtensor.py
+8
-9
test_type.py
theano/sandbox/gpuarray/tests/test_type.py
+2
-2
没有找到文件。
theano/sandbox/gpuarray/tests/test_basic_ops.py
浏览文件 @
07d4461d
...
...
@@ -34,16 +34,16 @@ if cuda_ndarray.cuda_available and not theano.sandbox.gpuarray.pygpu_activated:
if
not
theano
.
sandbox
.
gpuarray
.
pygpu_activated
:
raise
SkipTest
(
"pygpu disabled"
)
from
theano.sandbox.gpuarray
.type
import
(
GpuArrayType
,
gpuarray_shared_constructor
)
from
theano.sandbox.gpuarray
.basic_ops
import
(
from
.
.type
import
(
GpuArrayType
,
gpuarray_shared_constructor
)
from
.
.basic_ops
import
(
host_from_gpu
,
gpu_from_host
,
gpu_alloc
,
GpuAlloc
,
gpu_from_cuda
,
cuda_from_gpu
,
HostFromGpu
,
GpuFromHost
,
GpuReshape
,
gpu_join
,
GpuJoin
,
GpuSplit
,
GpuEye
,
gpu_contiguous
)
from
theano.sandbox.gpuarray
.subtensor
import
GpuSubtensor
from
.
.subtensor
import
GpuSubtensor
from
theano.tests
import
unittest_tools
as
utt
utt
.
seed_rng
()
...
...
theano/sandbox/gpuarray/tests/test_blas.py
浏览文件 @
07d4461d
...
...
@@ -8,14 +8,14 @@ from theano.tensor.blas import (gemv_inplace, gemm_inplace, ger_destructive,
_dot22
)
from
theano.tensor.tests.test_blas
import
TestGer
,
BaseGemv
from
theano.sandbox.gpuarray
import
gpuarray_shared_constructor
from
theano.sandbox.gpuarray.tests
.test_basic_ops
import
(
makeTester
,
rand
,
mode_with_gpu
)
from
theano.sandbox.gpuarray
.blas
import
(
gpugemv_inplace
,
gpugemv_no_inplace
,
gpugemm_inplace
,
gpugemm_no_inplace
,
gpuger_inplace
,
gpuger_no_inplace
,
GpuGer
,
gpu_dot22
)
from
..
import
gpuarray_shared_constructor
from
.test_basic_ops
import
(
makeTester
,
rand
,
mode_with_gpu
)
from
.
.blas
import
(
gpugemv_inplace
,
gpugemv_no_inplace
,
gpugemm_inplace
,
gpugemm_no_inplace
,
gpuger_inplace
,
gpuger_no_inplace
,
GpuGer
,
gpu_dot22
)
GpuGemvTester
=
makeTester
(
'GpuGemvTester'
,
...
...
theano/sandbox/gpuarray/tests/test_conv_cuda_ndarray.py
浏览文件 @
07d4461d
...
...
@@ -22,10 +22,10 @@ from theano.compat.python2x import any
from
theano.tests.unittest_tools
import
seed_rng
# We let that import do the init of the back-end if needed.
from
theano.sandbox.gpuarray.tests
.test_basic_ops
import
(
mode_with_gpu
,
mode_without_gpu
)
from
theano.sandbox.gpuarray
.type
import
GpuArrayType
from
theano.sandbox.gpuarray
.conv
import
GpuConv
from
.test_basic_ops
import
(
mode_with_gpu
,
mode_without_gpu
)
from
.
.type
import
GpuArrayType
from
.
.conv
import
GpuConv
import
pygpu
gftensor4
=
GpuArrayType
(
'float32'
,
[
False
]
*
4
)
...
...
theano/sandbox/gpuarray/tests/test_elemwise.py
浏览文件 @
07d4461d
...
...
@@ -6,11 +6,10 @@ from theano.tests.unittest_tools import SkipTest
from
theano.tensor.tests.test_elemwise
import
(
test_Broadcast
,
test_DimShuffle
,
test_CAReduce
,
T_reduce_dtype
)
from
theano.sandbox.gpuarray.tests.test_basic_ops
import
(
mode_with_gpu
,
rand_gpuarray
)
from
theano.sandbox.gpuarray.elemwise
import
(
GpuElemwise
,
GpuDimShuffle
,
GpuCAReduceCuda
,
GpuCAReduceCPY
)
from
theano.sandbox.gpuarray.type
import
GpuArrayType
from
.test_basic_ops
import
mode_with_gpu
,
rand_gpuarray
from
..elemwise
import
(
GpuElemwise
,
GpuDimShuffle
,
GpuCAReduceCuda
,
GpuCAReduceCPY
)
from
..type
import
GpuArrayType
from
pygpu.array
import
gpuarray
...
...
theano/sandbox/gpuarray/tests/test_neighbours.py
浏览文件 @
07d4461d
import
unittest
from
theano.tensor.nnet.tests
import
test_neighbours
# We let that import do the init of the back-end if needed.
from
theano.sandbox.gpuarray.tests
.test_basic_ops
import
(
mode_with_gpu
,
mode_without_gpu
)
from
.test_basic_ops
import
(
mode_with_gpu
,
mode_without_gpu
)
import
theano.tensor.nnet.tests.test_neighbours
from
theano.sandbox.gpuarray.neighbours
import
GpuImages2Neibs
from
..neighbours
import
GpuImages2Neibs
class
T_GpuImages2Neibs
(
t
heano
.
tensor
.
nnet
.
tests
.
t
est_neighbours
.
T_Images2Neibs
):
class
T_GpuImages2Neibs
(
test_neighbours
.
T_Images2Neibs
):
mode
=
mode_with_gpu
op
=
GpuImages2Neibs
dtypes
=
[
'int64'
,
'float32'
,
'float64'
]
...
...
theano/sandbox/gpuarray/tests/test_nnet.py
浏览文件 @
07d4461d
...
...
@@ -9,12 +9,13 @@ import theano.tests.unittest_tools as utt
from
theano.sandbox
import
gpuarray
# We let that import do the init of the back-end if needed.
from
theano.sandbox.gpuarray.tests
.test_basic_ops
import
(
mode_with_gpu
,
mode_without_gpu
)
from
.test_basic_ops
import
(
mode_with_gpu
,
mode_without_gpu
)
from
theano.sandbox.gpuarray
.nnet
import
(
from
.
.nnet
import
(
GpuCrossentropySoftmaxArgmax1HotWithBias
,
GpuCrossentropySoftmax1HotWithBiasDx
)
GpuCrossentropySoftmax1HotWithBiasDx
,
GpuSoftmaxWithBias
,
GpuSoftmax
)
def
test_GpuCrossentropySoftmaxArgmax1HotWithBias
():
...
...
@@ -203,7 +204,7 @@ def softmax_with_bias_unittest_template(dtypeInput, dtypeBias):
f_gpu
=
theano
.
function
([
x
],
z
,
mode
=
mode_with_gpu
)
assert
f
.
maker
.
fgraph
.
toposort
()[
-
1
]
.
op
==
T
.
nnet
.
softmax_with_bias
assert
isinstance
(
f_gpu
.
maker
.
fgraph
.
toposort
()[
-
2
]
.
op
,
theano
.
sandbox
.
gpuarray
.
nnet
.
GpuSoftmaxWithBias
)
GpuSoftmaxWithBias
)
def
cmp
(
n
,
m
):
# print "test_softmax",n,m
...
...
@@ -261,7 +262,7 @@ def softmax_unittest_template(dtypeInput):
f_gpu
=
theano
.
function
([
x
],
z
,
mode
=
mode_with_gpu
)
assert
f
.
maker
.
fgraph
.
toposort
()[
-
1
]
.
op
==
T
.
nnet
.
softmax
assert
isinstance
(
f_gpu
.
maker
.
fgraph
.
toposort
()[
-
2
]
.
op
,
theano
.
sandbox
.
gpuarray
.
nnet
.
GpuSoftmax
)
GpuSoftmax
)
def
cmp
(
n
,
m
):
if
dtypeInput
==
'float32'
:
...
...
theano/sandbox/gpuarray/tests/test_opt.py
浏览文件 @
07d4461d
...
...
@@ -3,19 +3,16 @@ import numpy
import
theano
from
theano
import
tensor
from
theano.tests
import
unittest_tools
as
utt
import
theano.sandbox.gpuarray
from
theano.sandbox.gpuarray.type
import
(
GpuArrayType
,
gpuarray_shared_constructor
)
from
theano.sandbox.gpuarray.basic_ops
import
(
GpuAlloc
,
GpuReshape
,
gpu_alloc
,
gpu_from_host
,
host_from_gpu
)
from
theano.sandbox.gpuarray.elemwise
import
(
GpuCAReduceCuda
,
GpuCAReduceCPY
,
GpuElemwise
)
from
theano.sandbox.gpuarray.subtensor
import
GpuSubtensor
from
theano.sandbox.gpuarray.tests.test_basic_ops
import
(
rand_gpuarray
,
mode_with_gpu
,
mode_without_gpu
)
from
theano.tests.unittest_tools
import
SkipTest
from
theano.tensor.tests.test_basic
import
TestSpecifyShape
from
theano.tensor.tests
import
test_basic
import
theano.sandbox.gpuarray
from
..type
import
GpuArrayType
,
gpuarray_shared_constructor
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
def
test_local_assert
():
...
...
@@ -135,10 +132,9 @@ def test_rebroadcast():
assert
isinstance
(
rebr
.
outputs
[
0
]
.
type
,
GpuArrayType
)
class
TestSpecifyShape
(
TestSpecifyShape
):
class
TestSpecifyShape
(
test_basic
.
TestSpecifyShape
):
mode
=
mode_with_gpu
input_type
=
GpuArrayType
pass
def
test_print_op
():
...
...
@@ -146,9 +142,6 @@ def test_print_op():
b
=
tensor
.
fmatrix
()
f
=
theano
.
function
([
b
],
theano
.
printing
.
Print
()(
b
)
*
2
,
mode
=
mode_with_gpu
)
theano
.
printing
.
debugprint
(
f
)
# print f.maker.fgraph.toposort()
#[GpuFromHost(<TensorType(float32, matrix)>), <theano.printing.Print object at 0x3581210>(GpuFromHost.0), GpuElemwise{mul}(CudaNdarray{[[ 2.]]}, <theano.printing.Print object at 0x3581210>.0), HostFromGpu(GpuElemwise{mul}.0)]
topo
=
f
.
maker
.
fgraph
.
toposort
()
assert
topo
[
0
]
.
op
==
gpu_from_host
assert
isinstance
(
topo
[
1
]
.
op
,
theano
.
printing
.
Print
)
...
...
theano/sandbox/gpuarray/tests/test_scan.py
浏览文件 @
07d4461d
...
...
@@ -5,12 +5,10 @@ import theano
from
theano.tests
import
unittest_tools
as
utt
import
theano.sandbox.rng_mrg
from
theano.sandbox.gpuarray.basic_ops
import
(
gpu_from_host
,
GpuFromHost
,
HostFromGpu
)
from
theano.sandbox.gpuarray.elemwise
import
GpuElemwise
from
..basic_ops
import
gpu_from_host
,
GpuFromHost
,
HostFromGpu
from
..elemwise
import
GpuElemwise
from
theano.sandbox.gpuarray.tests
.test_basic_ops
import
mode_with_gpu
from
.test_basic_ops
import
mode_with_gpu
class
T_Scan
(
TestCase
):
...
...
theano/sandbox/gpuarray/tests/test_subtensor.py
浏览文件 @
07d4461d
import
numpy
import
theano
from
theano.tensor.tests.test_subtensor
import
T_subtensor
from
theano.sandbox.gpuarray.basic_ops
import
(
HostFromGpu
,
GpuFromHost
)
from
theano.sandbox.gpuarray.subtensor
import
(
GpuIncSubtensor
,
GpuSubtensor
,
GpuAdvancedIncSubtensor1
)
from
theano
import
tensor
from
theano.compile
import
DeepCopyOp
from
theano.
sandbox.gpuarray.type
import
gpuarray_shared_construct
or
from
theano.
tensor.tests.test_subtensor
import
T_subtens
or
from
theano.sandbox.gpuarray.tests.test_basic_ops
import
mode_with_gpu
from
..basic_ops
import
HostFromGpu
,
GpuFromHost
from
..subtensor
import
(
GpuIncSubtensor
,
GpuSubtensor
,
GpuAdvancedIncSubtensor1
)
from
..type
import
gpuarray_shared_constructor
from
theano.compile
import
DeepCopyOp
from
.test_basic_ops
import
mode_with_gpu
from
theano
import
tensor
class
G_subtensor
(
T_subtensor
):
...
...
theano/sandbox/gpuarray/tests/test_type.py
浏览文件 @
07d4461d
...
...
@@ -5,9 +5,9 @@ import numpy
import
theano
from
theano.compile
import
DeepCopyOp
from
theano.sandbox.gpuarray.tests
.test_basic_ops
import
rand_gpuarray
from
.test_basic_ops
import
rand_gpuarray
from
theano.sandbox.gpuarray
.type
import
GpuArrayType
from
.
.type
import
GpuArrayType
def
test_deep_copy
():
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论